/* ==========================================
   APP UI — grocery-app look (olive / gold)
   Ramazan Market v2
   Loaded last: refines header, offers, cards and adds the
   phone tab bar + floating order bar.
========================================== */

:root {
	--rm-dark: #1F3B2D;
	--rm-dark-2: #2C4A3A;
	--rm-darkest: #16291F;
	--rm-primary: #2F6B4F;
	--rm-primary-dark: #25573F;
	--rm-soft: #EEEADF;
	--rm-gold: #E0B04A;
	--rm-ink: #111827;
	--rm-muted: #6B7280;
	--rm-page: #F7F5EF;
	--rm-card-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 8px 24px rgba(17, 24, 39, .06);
}

body {
	background: var(--rm-page);
}

.rm-icon {
	flex-shrink: 0;
	vertical-align: middle;
}

/* ---------- Header ---------- */

body .header {
	background: var(--rm-dark);
	box-shadow: 0 6px 20px rgba(31, 59, 45, .18);
}

body .header__announcement {
	background: var(--rm-darkest);
	color: #E7EFE9;
}

body .header__announcement strong {
	color: var(--rm-gold);
}

body .header__announcement-inner span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

body .header__main {
	background: transparent;
}

body .header__logo a {
	color: #fff;
	font-weight: 800;
	font-size: 1.4rem;
	text-decoration: none;
}

body .header__search-form {
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
}

body .header__search-input {
	border: 0;
	background: #fff;
	color: var(--rm-ink);
}

body .header__search-button {
	background: var(--rm-gold);
	color: var(--rm-ink);
	font-weight: 700;
	border: 0;
}

body .header__search-button:hover {
	background: #C99A35;
	color: var(--rm-ink);
}

body .header__actions {
	gap: 8px;
}

body .header__actions .rm-lang {
	background: rgba(255, 255, 255, .1);
	border-color: transparent;
}

body .header__actions .rm-lang__item {
	color: #E7EFE9;
}

body .header__actions .rm-lang__item:hover {
	background: rgba(255, 255, 255, .15);
	color: #fff;
}

body .header__actions .rm-lang__item.is-active {
	background: var(--rm-gold);
	color: var(--rm-ink);
}

body .header__account,
body .header__whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	border: 0;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
}

body .header__account:hover,
body .header__whatsapp:hover {
	background: rgba(255, 255, 255, .18);
	color: #fff;
}

body .header__cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	border: 0;
	background: var(--rm-gold);
	color: var(--rm-ink);
	font-weight: 700;
	cursor: pointer;
}

body .header__cart-icon {
	display: inline-flex;
}

body .header__cart-count {
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--rm-ink);
	color: #fff;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

body .header__nav {
	background: rgba(0, 0, 0, .12);
}

body .header__menu a {
	color: #E7EFE9;
	font-weight: 600;
}

body .header__menu a:hover,
body .header__menu .current-menu-item > a {
	color: var(--rm-gold);
}

/* ---------- Sections ---------- */

body .section-header h2 {
	color: var(--rm-ink);
	font-weight: 800;
}

/* "عروض اليوم" — an olive band at the top of the home page */
body .offers--today {
	padding-block: 20px 8px;
}

body .offers--today > .container {
	background: var(--rm-dark);
	border-radius: 28px;
	padding: 24px;
}

body .offers--today .section-header h2 {
	color: #fff;
}

body .offers--today .section-header__eyebrow {
	color: var(--rm-gold);
}

body .offers--today .offers__all {
	color: var(--rm-gold);
	font-weight: 700;
	text-decoration: none;
}

body .offers--today .rm-countdown--header {
	background: rgba(255, 255, 255, .1);
	border-color: transparent;
	color: #E7EFE9;
}

body .offers--today .rm-countdown--header .rm-countdown__time {
	color: var(--rm-gold);
	font-size: 1.15em;
}

body .offers--today .rm-countdown--header.is-urgent {
	background: #FEF2F2;
	color: #B91C1C;
}

body .offers--today .rm-countdown--header.is-urgent .rm-countdown__time {
	color: #B91C1C;
}

/* ---------- Cards ---------- */

body .offer-card,
body .product-card {
	background: #fff;
	border: 0;
	border-radius: 20px;
	box-shadow: var(--rm-card-shadow);
}

body .product-card__image {
	background: var(--rm-page);
	border-radius: 14px;
	overflow: hidden;
}

body .product-card__title a {
	color: var(--rm-ink);
	font-weight: 600;
	text-decoration: none;
}

body .product-card__add,
body .offer-card__button,
body .offer-add-to-cart {
	min-height: 44px;
	border-radius: 12px;
	background: var(--rm-primary);
	color: #fff;
	font-weight: 700;
	border: 0;
}

body .product-card__add:hover,
body .offer-card__button:hover,
body .offer-add-to-cart:hover:not(:disabled) {
	background: var(--rm-primary-dark);
	color: #fff;
}

body .product-card__discount {
	background: #DC2626;
	color: #fff;
	border-radius: 999px;
}

body .product-card__offer-badge,
body .offer-card__badge {
	background: var(--rm-gold);
	color: var(--rm-ink);
	border-radius: 999px;
	font-weight: 700;
}

body .category-card {
	background: #fff;
	border: 0;
	border-radius: 20px;
	box-shadow: var(--rm-card-shadow);
}

body .category-card__image {
	background: var(--rm-soft);
	border-radius: 18px;
}

/* ---------- Footer ---------- */

body .rm-footer {
	background: var(--rm-dark);
	color: #E7EFE9;
	margin-top: 32px;
}

.rm-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-block: 24px;
}

.rm-footer__inner p {
	margin: 0;
}

.rm-footer__logo {
	color: #fff;
	font-weight: 800;
	font-size: 1.2rem;
	text-decoration: none;
}

.rm-footer__logo span {
	color: var(--rm-gold);
}

/* ---------- Phones: tab bar + floating order bar ---------- */

.rm-tabbar,
.rm-cartbar {
	display: none;
}

@media (max-width: 768px) {

	/* Header: logo + language + account on one row, search below. */
	body .header__main-inner {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"logo actions"
			"search search";
		gap: 12px;
		padding: 12px 16px 16px;
	}

	body .header__logo { grid-area: logo; max-width: none; }
	body .header__search { grid-area: search; }
	body .header__actions { grid-area: actions; }

	/* The tab bar and order bar replace these on phones. */
	body .header__actions .header__cart,
	body .header__whatsapp,
	body .header__account-text {
		display: none;
	}

	body .header__account {
		width: 44px;
		padding: 0;
		justify-content: center;
	}

	body .header__search-input {
		height: 46px;
	}

	body .header__nav {
		display: none;
	}

	body .offers--today {
		padding-inline: 0;
	}

	body .offers--today > .container {
		border-radius: 0 0 24px 24px;
		padding: 18px 16px;
	}

	/* The older round floating cart is replaced by the order bar. */
	.rm-floating-cart {
		display: none !important;
	}

	body {
		padding-bottom: 72px;
	}

	body.has-cartbar {
		padding-bottom: 140px;
	}

	.rm-tabbar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 1001;
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		height: 64px;
		padding-bottom: env(safe-area-inset-bottom);
		background: #fff;
		border-top: 1px solid #E5E7EB;
		box-shadow: 0 -4px 16px rgba(17, 24, 39, .06);
	}

	.rm-tabbar a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		color: var(--rm-muted);
		font-size: 11px;
		font-weight: 600;
		text-decoration: none;
	}

	.rm-tabbar a.is-active {
		color: var(--rm-primary);
	}

	.rm-cartbar:not([hidden]) {
		position: fixed;
		inset-inline: 12px;
		bottom: 74px;
		z-index: 1001;
		display: block;
	}

	.rm-cartbar .rm-cartbar__button.header__cart {
		width: 100%;
		min-width: 0;
		height: 56px;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 0 12px;
		border: 0;
		border-radius: 16px;
		background: var(--rm-dark);
		color: #fff;
		font-family: inherit;
		font-size: 15px;
		box-shadow: 0 10px 30px rgba(31, 59, 45, .35);
		cursor: pointer;
	}

	.rm-cartbar__count {
		min-width: 36px;
		height: 36px;
		border-radius: 10px;
		background: var(--rm-gold);
		color: var(--rm-ink);
		font-weight: 800;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.rm-cartbar__label {
		flex: 1;
		text-align: start;
		font-weight: 600;
	}

	.rm-cartbar__cta {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		color: var(--rm-gold);
		font-weight: 700;
	}
}

@media (max-width: 380px) {
	body .header__actions .rm-lang__item {
		min-width: 28px;
		padding: 5px 6px;
	}
}

/* ==========================================
   v3 — olive / gold design: home sections
========================================== */

/* Section headers: title + "عرض الكل" on one line */
body .best-sellers .section-header,
body .categories .section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

body .best-sellers .section-header a,
body .categories .section-header a {
	color: var(--rm-primary);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}

/* "الأكثر طلباً" */
.best-sellers {
	padding-block: 24px 8px;
}

.best-sellers__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}

/* Countdown in the deals header: digit boxes */
body .offers--today .rm-countdown--header .rm-countdown__time {
	letter-spacing: 1px;
}

/* Category tiles */
body .category-card__image {
	background: var(--rm-soft);
}

body .category-card__button {
	background: var(--rm-primary);
	color: #FFFFFF;
}

body .category-card:hover .category-card__button {
	background: var(--rm-dark);
	color: var(--rm-gold);
}

/* Prices */
body .product-card__price strong,
body .product-card__unit-price {
	color: var(--rm-ink);
}

body .product-card__price del {
	color: var(--rm-muted);
}

/* Quantity selector on cards */
body .product-card__quantity {
	background: var(--rm-soft);
	border-radius: 12px;
}

body .product-card__quantity button {
	color: var(--rm-dark);
}

@media (max-width: 768px) {

	/* Group offers scroll sideways like an app carousel */
	body .offers--today .offers__group-grid {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		margin-inline: -16px;
		padding-inline: 16px;
		padding-bottom: 6px;
		scrollbar-width: none;
	}

	body .offers--today .offers__group-grid::-webkit-scrollbar {
		display: none;
	}

	body .offers--today .offers__group-grid > .offer-card {
		flex: 0 0 82%;
		scroll-snap-align: start;
	}

	/* Categories: 4 small tiles per row */
	body .categories__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 10px;
	}

	body .category-card {
		padding: 8px 4px;
		box-shadow: none;
		background: transparent;
	}

	body .category-card__image {
		width: 64px;
		height: 64px;
		margin-inline: auto;
	}

	body .category-card h3 {
		font-size: 12px;
		line-height: 1.3;
	}

	body .category-card__description,
	body .category-card__button {
		display: none;
	}

	/* Best sellers: 2 columns */
	.best-sellers__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
}
