/* =========================================================================
   Atheer — base: design tokens, reset, type, buttons, forms, layout helpers.
   Owner: orchestrator. Area files (layout/home/product/cart/pages.css) build on these
   tokens and never redefine them. Ask for a new token instead of hard-coding a color.

   RTL: the site is dir="rtl". Use logical properties only
   (margin-inline-start, padding-inline-end, inset-inline-start, text-align: start).
   ========================================================================= */

:root {
	/* Colors (each pair measured, see plan "Colors") */
	--olive-950: #0f1c0a; /* footer, top bar */
	--olive-900: #142709; /* dark bands */
	--olive-800: #1a3210; /* every button, headings */
	--olive-700: #254419; /* hover of olive-800 surfaces */
	--olive-600: #3e5f1f; /* links, icons, focus ring */
	--olive-100: #e9eee0; /* very light tint: selected chips, success notice */
	--gold: #c9a24a;      /* decoration only; text ONLY on olive-900/950 */
	--gold-700: #8a6a1f;  /* small gold text on light backgrounds — 4.72 */
	--gold-200: #ecdcb3;  /* thin borders on light backgrounds (decoration) */
	--star: #b07a00;      /* rating stars — 3.73 on white */
	--ivory: #fffefb;     /* page background */
	--cream-100: #f9f6ef; /* alternate sections, card image area */
	--white: #ffffff;
	--ink-900: #1e2119;   /* body text — 15.26 */
	--ink-600: #5b5e52;   /* secondary text — 6.20 */
	--line: #e7dbbd;      /* hairlines and borders: a thin line of gold everywhere */
	--sale: #cf2a1e;      /* discount badge (white text 5.05), old price */
	--danger-bg: #fdecea;
	--success-bg: #e7eedb;

	/* Type */
	--font-head: "Amiri", "IBM Plex Sans Arabic", serif;
	--font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--text-xs: 0.8125rem;  /* 13px — never for paragraphs */
	--text-sm: 0.875rem;   /* 14px */
	--text-md: 1rem;       /* 16px — body on every screen */
	--text-lg: 1.125rem;   /* 18px */
	--text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	--text-2xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
	--text-3xl: clamp(1.875rem, 1.35rem + 2.4vw, 3rem);
	--leading: 1.75;
	--leading-tight: 1.5; /* Amiri's tall letters need the room */

	/* Space and shape */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: clamp(3.5rem, 2.25rem + 5.5vw, 7.5rem); /* between home sections */
	--gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
	--container: 1240px;
	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 22px;
	--radius-pill: 999px;
	--shadow-sm: 0 1px 2px rgba(22, 41, 10, 0.06), 0 2px 8px rgba(22, 41, 10, 0.05);
	--shadow: 0 2px 6px rgba(22, 41, 10, 0.06), 0 12px 32px rgba(22, 41, 10, 0.08);
	--tap: 48px; /* minimum size of anything you can tap */
	--header-h: 76px;
	--bottom-bar-h: 64px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--ivory);
	color: var(--ink-900);
	font-family: var(--font-body);
	font-size: var(--text-md);
	line-height: var(--leading);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
img { border-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul, ol)[class] { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Type ---------- */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	font-weight: 700;
	line-height: var(--leading-tight);
	color: var(--olive-800);
	margin: 0 0 var(--space-4);
	text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
a { color: var(--olive-600); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--olive-800); }
strong, b { font-weight: 700; }
small { font-size: var(--text-sm); }
.text-muted { color: var(--ink-600); }

/* Prices: olive, bold, Latin digits like the reference. */
.price, .amount { color: var(--olive-800); font-weight: 700; }
del, del .amount { color: var(--sale); font-weight: 500; }
ins { text-decoration: none; }
/* WooCommerce wraps prices in <bdi> and the currency word in dir="auto", so the browser sees no Arabic letter
   and lays "570 جنيه" out left-to-right ("جنيه 570"). Force right-to-left so it reads "570 جنيه". */
.woocommerce-Price-amount bdi { direction: rtl; unicode-bidi: isolate; }

/* ---------- Focus and motion ---------- */
:focus-visible { outline: 2px solid var(--olive-600); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--space-8); }
.section--cream { background: var(--cream-100); }
.section--dark { background: var(--olive-900); color: var(--white); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.stack > * + * { margin-block-start: var(--space-4); }
.visually-hidden, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; inset-block-start: var(--space-2); inset-inline-start: var(--space-2); z-index: 1000; width: auto; height: auto; clip: auto; padding: var(--space-3) var(--space-4); background: var(--white); color: var(--olive-800); border-radius: var(--radius-sm); box-shadow: var(--shadow); }

/* Section title with the two gold diamonds of the logo on both sides. */
.section-title {
	display: flex; align-items: center; justify-content: center; gap: var(--space-4);
	text-align: center; margin-block-end: var(--space-7);
}
.section-title h2 { margin: 0; }
.section-title::before, .section-title::after {
	content: ""; flex: 0 1 72px; height: 18px;
	background: url("../icons/ornament-diamonds.svg") center / contain no-repeat;
}
.section-title::before { transform: scaleX(-1); }
.section-subtitle { text-align: center; color: var(--ink-600); max-width: 60ch; margin: calc(-1 * var(--space-4)) auto var(--space-6); }

/* ---------- Buttons ---------- */
.btn,
.button,
button.button,
input[type="submit"].button {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
	min-height: var(--tap); padding: 0 var(--space-5);
	border: 1px solid transparent; border-radius: var(--radius-pill);
	font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; line-height: 1;
	text-decoration: none; white-space: nowrap; cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn .atheer-icon, .button .atheer-icon { width: 20px; height: 20px; flex: none; }
.btn:active, .button:active { transform: translateY(1px); }

/* Main action: every primary button on the site. */
.btn--primary,
.button,
button.button.alt,
.single_add_to_cart_button {
	background: var(--olive-800); color: var(--ivory); border-color: color-mix(in srgb, var(--gold) 60%, var(--olive-800));
}
.btn--primary:hover,
.button:hover,
.single_add_to_cart_button:hover { background: var(--olive-700); border-color: var(--gold); color: var(--ivory); box-shadow: var(--shadow-sm); }

/* Quiet action: outline. */
.btn--outline { background: transparent; color: var(--olive-800); border-color: var(--olive-800); }
.btn--outline:hover { background: var(--olive-800); color: var(--ivory); }

/* On dark green: ivory outline with a thin gold underline feel. */
.btn--on-dark { background: var(--ivory); color: var(--olive-900); border-color: var(--ivory); }
.btn--on-dark:hover { background: var(--white); color: var(--olive-900); }
.btn--line-gold { background: transparent; color: var(--ivory); border-color: var(--gold); }
.btn--line-gold:hover { background: rgba(201, 162, 74, 0.14); color: var(--white); }

/* WhatsApp: the brand green is too light for white text (2.0), so a deep WhatsApp green is used. */
.btn--whatsapp { background: #0b6b3a; color: var(--white); border-color: #0b6b3a; }
.btn--whatsapp:hover { background: #095a31; border-color: #095a31; color: var(--white); }

.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: var(--text-lg); padding-inline: var(--space-6); }
.btn[disabled], .button.disabled, .button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-block-end: var(--space-2); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"],
input[type="search"], input[type="url"], select, textarea {
	width: 100%; min-height: var(--tap); padding: var(--space-3) var(--space-4);
	background: var(--white); color: var(--ink-900);
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	font-size: var(--text-md); /* 16px also stops iPhone from zooming in */
	transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive-600); box-shadow: 0 0 0 3px rgba(71, 112, 28, 0.18); }
::placeholder { color: var(--ink-600); opacity: 1; }
input[type="tel"], input[type="number"] { direction: ltr; text-align: end; }
.required, abbr.required { color: var(--sale); text-decoration: none; border: 0; }

/* ---------- Notices (WooCommerce and theme) ---------- */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .atheer-notice {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
	margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5);
	border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
	list-style: none;
}
.woocommerce-message { background: var(--success-bg); border-color: #cddbb8; }
.woocommerce-error { background: var(--danger-bg); border-color: #f3c5bf; color: #7a1a12; }
.woocommerce-message .button, .woocommerce-info .button { margin-inline-start: auto; }

/* ---------- Motion helper: fade up on scroll (layout.js adds .is-visible) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
