/* ==========================================
   LANGUAGES + COUNTDOWN
   Ramazan Market
========================================== */

/* Direction helpers: 1 in Arabic (RTL), -1 in Turkish / English (LTR). */
:root { --rm-dir: 1; }
html[dir="ltr"],
body.is-ltr { --rm-dir: -1; }

html[dir="ltr"] .rm-arrow,
body.is-ltr .rm-arrow {
	display: inline-block;
	transform: scaleX(-1);
}

/* Latin text reads better with a Latin-first font stack. */
body.is-ltr {
	font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Language switcher ---------- */

.rm-lang {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	background: var(--color-bg, #f8fafc);
	border: 1px solid var(--color-border, #e5e7eb);
	border-radius: 999px;
	flex-shrink: 0;
}

.rm-lang__item {
	min-width: 34px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	color: var(--color-text, #374151);
	text-decoration: none;
	transition: background var(--transition, .3s ease), color var(--transition, .3s ease);
}

.rm-lang__item:hover {
	color: var(--color-secondary, #111827);
	background: #fff;
}

.rm-lang__item.is-active {
	background: var(--color-secondary, #111827);
	color: #fff;
}

/* ---------- Countdown ---------- */

.rm-countdown {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.rm-countdown__time {
	font-variant-numeric: tabular-nums;
	letter-spacing: .5px;
	font-weight: 800;
}

.rm-countdown.is-urgent {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
	animation: rm-pulse 1.4s ease-in-out infinite;
}

@keyframes rm-pulse {
	50% { opacity: .65; }
}

/* In the "عروض اليوم" header */
.offers__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rm-countdown--header {
	font-size: 14px;
	padding: 8px 14px;
}

/* On offer cards */
.offer-card {
	position: relative;
}

.rm-countdown--card {
	margin: 0 16px 4px;
}

/* On product cards (over the image) */
.product-card__image {
	position: relative;
}

.rm-countdown--product {
	position: absolute;
	inset-block-end: 10px;
	inset-inline-start: 10px;
	z-index: 2;
	padding: 4px 9px;
	font-size: 11.5px;
	background: rgba(255, 255, 255, .95);
	box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, .05));
}

@media (prefers-reduced-motion: reduce) {
	.rm-countdown.is-urgent { animation: none; }
}

@media (max-width: 768px) {
	.header__actions .rm-lang__item {
		min-width: 30px;
		padding: 5px 7px;
		font-size: 12px;
	}

	.offers__header .rm-countdown--header {
		order: 3;
		width: 100%;
		justify-content: center;
	}
}
