/* Riviera 2027 — global design foundation (step 1, Option B). Tokens: Elementor kit V4 variables (--rv-*). */

/* Latin-first font stacks. Manrope / Public Sans have no Arabic glyphs, so Arabic falls through to Alexandria / Alyamama. */
:root:root {
  --font-heading: Manrope, Alexandria, system-ui, sans-serif;
  --font-body: "Public Sans", Alyamama, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-ar-heading: Alexandria, system-ui, sans-serif;
  --font-ar-body: Alyamama, system-ui, sans-serif;
  --rv-shadow: 0 12px 32px -12px rgba(10, 37, 64, .18);
  --rv-scrim: rgba(10, 37, 64, .55);
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  color: var(--rv-text, #334155);
  background-color: var(--rv-bg, #fff);
  -webkit-tap-highlight-color: transparent;
}
:where(h1, h2, h3, h4, h5, h6) { font-family: var(--font-heading); }

/* Focus ring: 2 px, offset 2 (components that define their own focus style keep it). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--rv-focus, #0ea5e9);
  outline-offset: 2px;
}

/* Grid items never grow past their track (stops the min-content blowout on single-column grids, LTR and RTL). */
.elementor .e-grid-base > *,
.elementor .e-collection-loop-layout-base > * { min-width: 0; }

/* Touch targets >= 44 px for text links in navigation, footer, filters and inline arrow links. */
.elementor :is(.rv-nav-link, .rv-footer-link, .rv-filter-link, .rv-sort-link, .rv-mega-link, .rv-btn-ghost) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.woocommerce-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }

/* Search fields: ellipsis at the end of the text, never at the start (RTL placeholder fix, handoff § 10.4). */
input[type="search"], .e-search-input { text-overflow: ellipsis; }
input[type="search"]::placeholder, .e-search-input::placeholder { text-overflow: ellipsis; }
[dir="rtl"] :is(input[type="search"], .e-search-input) { text-align: start; }
[data-rv-search-label] { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Phone numbers always read left to right. */
a[href^="tel:"] { direction: ltr; unicode-bidi: isolate; }

/* ---------- RTL / Arabic ---------- */
[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, label, blockquote, button, a, summary, legend) { unicode-bidi: plaintext; }
[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, .rv-display, .rv-h1, .rv-h2, .rv-h3, .rv-h4, .rv-eyebrow, .rv-btn) { letter-spacing: 0 !important; }
html[lang|="ar"] body :is(p, li, dd, .rv-body, .rv-body-lg) { line-height: 1.9; }
[dir="rtl"] .rv-arrow, [dir="rtl"] [data-rv-arrow] { transform: scaleX(-1); }
/* Mono labels (eyebrows, indexes): IBM Plex Mono has no Arabic glyphs, so Arabic text falls through to the Arabic body face, not a system font (W2, R2). */
:root:root[dir="rtl"], [dir="rtl"] body { --font-mono: "IBM Plex Mono", Alyamama, ui-monospace, monospace; }
[dir="rtl"] :is(.rvb, .rvb-sheet), :is(.rvb, .rvb-sheet)[dir="rtl"] { --rvb-mono: "IBM Plex Mono", Alyamama, ui-monospace, monospace; }
[dir="rtl"] :is(.rv-eyebrow, .rv-index) { font-family: "IBM Plex Mono", var(--font-ar-body), ui-monospace, monospace; }
[dir="rtl"] .rv-index { direction: rtl; unicode-bidi: plaintext; }   /* «خطأ 404» reads right to left; digit-only indexes are unaffected */
/* Hero / section buttons never run past a 320 px screen: long Arabic labels wrap (W2, R3). */
.elementor .rv-chip { max-width: 100%; }
/* W4: ingredient Arabic subtitle under the Latin INN; optional Arabic type line under the Latin product name. */
.rv-inn-ar { display: block; font-family: var(--font-ar-body); font-size: .82em; font-weight: 400; line-height: 1.5; opacity: .78; letter-spacing: 0; text-transform: none; }
:is(.rvs-chip, .rv-chip, .rvd-tag) .rv-inn-ar { display: inline; margin-inline-start: .35em; font-size: .9em; }   /* compact in chips */
.rvc-desc-ar, .rvb-desc-ar { display: block; margin-top: 2px; font-family: var(--font-ar-body); font-size: 14px; line-height: 1.5; color: var(--rv-muted, #5b6b7f); }
.rvb-desc-ar { margin-top: 4px; font-size: 16px; }   /* long Arabic chip labels never push the page wider (W3) */
@media (max-width: 359px) { .rvh-actions .rvh-btn { max-width: 100%; height: auto; min-height: 48px; white-space: normal; text-align: center; } }

/* ---------- Dark: one site-wide token set (v0.8.0, step 4.5) ----------
   Theme preference (Riviera_I18n): Dark = body.rv-dark; Light = body.rv-light; System = neither (follows prefers-color-scheme).
   Same dark palette as Product Page B (M10.33, handoff 3.1). Media canvases stay light (--rv-media). Semantic tokens only. */
body.rv-dark {
  --rv-bg: #0B0B0C; --rv-canvas: #111113; --rv-surface: #18181B; --rv-surface-2: #141416; --rv-media: #E9EEF3;
  --rv-heading: #F2F2F3; --rv-text: #D4D4D8; --rv-muted: #A1A1AA; --rv-line: #2A2A2E; --rv-line-strong: #3F3F46;
  --rv-accent: #3CCFB2; --rv-accent-soft: #123A3A; --rv-action: #0B7D68; --rv-action-hover: #0A6B59; --rv-action-ink: #FFFFFF;
  --rv-navy: #ECECEE; --rv-navy-ink: #0B0B0C; --rv-band-navy: #18181B;
  --rv-star: #E2B04A; --rv-star-empty: #3F3F46; --rv-sale: #FF8A7A; --rv-sale-soft: #3A1F22; --rv-focus: #5FD8C0;
  --rv-scrim: rgba(0,0,0,.72); --rv-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55);
  --rv-ink: #F2F2F3; --rv-slate: #A1A1AA; --rv-mist: #111113; --rv-canvas-warm: #111113; --rv-paper: #111113; --rv-teal-ink: #3CCFB2; --rv-aqua-50: #123A3A;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body:not(.rv-light) {
  --rv-bg: #0B0B0C; --rv-canvas: #111113; --rv-surface: #18181B; --rv-surface-2: #141416; --rv-media: #E9EEF3;
  --rv-heading: #F2F2F3; --rv-text: #D4D4D8; --rv-muted: #A1A1AA; --rv-line: #2A2A2E; --rv-line-strong: #3F3F46;
  --rv-accent: #3CCFB2; --rv-accent-soft: #123A3A; --rv-action: #0B7D68; --rv-action-hover: #0A6B59; --rv-action-ink: #FFFFFF;
  --rv-navy: #ECECEE; --rv-navy-ink: #0B0B0C; --rv-band-navy: #18181B;
  --rv-star: #E2B04A; --rv-star-empty: #3F3F46; --rv-sale: #FF8A7A; --rv-sale-soft: #3A1F22; --rv-focus: #5FD8C0;
  --rv-scrim: rgba(0,0,0,.72); --rv-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55);
  --rv-ink: #F2F2F3; --rv-slate: #A1A1AA; --rv-mist: #111113; --rv-canvas-warm: #111113; --rv-paper: #111113; --rv-teal-ink: #3CCFB2; --rv-aqua-50: #123A3A;
  color-scheme: dark;
  }
  html:has(body:not(.rv-light)) { background-color: #0B0B0C; }
}
html:has(body.rv-dark) { background-color: #0B0B0C; }

/* Forms (WooCommerce cart / checkout / account, review form, search): fields follow the tokens in both themes. */
:where(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="search"], input[type="url"], select, textarea) {
  background-color: var(--rv-surface); color: var(--rv-ink); border-color: var(--rv-line-strong);
}
:where(input, select, textarea)::placeholder { color: var(--rv-muted); opacity: 1; }
.wc-block-components-text-input input, .wc-block-components-textarea, .wc-block-components-select select, .wc-block-components-combobox input,
.woocommerce form .form-row :is(input.input-text, textarea, select), .woocommerce-cart table.cart td.actions .coupon .input-text {
  background-color: var(--rv-surface) !important; color: var(--rv-ink) !important; border-color: var(--rv-line-strong) !important;
}
.wc-block-components-text-input label, .wc-block-components-combobox label { color: var(--rv-muted) !important; }
:is(.woocommerce, .wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) { color: var(--rv-text); }
:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) :is(.wc-block-components-product-name, .wc-block-components-totals-item__label, .wc-block-components-title, h1, h2, h3) { color: var(--rv-heading); }

/* LTR isolation for English source content, brand names, SKU, GTIN, email, URL, phone inside the Arabic UI. */
.rv-ltr { unicode-bidi: isolate; direction: ltr; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 0.77.5 (Hazem 2026-11-12): Arabic headings on two or more lines need room between the lines */
html[lang^="ar"] :is(h1,h2,h3,h4) { line-height: 1.38 !important; letter-spacing: 0 !important; }
html[lang^="ar"] :is(h1,h2,h3,h4) :is(bdi,[lang="en"]) { letter-spacing: normal; }
