/* Wafra (getwafra.com, the UAE brand) on top of funnel.css and sales.css: the same pages, its own colours, scripts and
   reading direction. Colours are the platform's Wafra theme (packages/ui/src/tokens.css, owner decision 2026-10-24:
   warm sand and gold with a dark ink) mapped onto the funnel's tokens. Arabic and Urdu read right to left: the layout
   already uses logical properties, so this file only turns what logical properties cannot (arrows, slides, the
   marquee, the cut corners, the progress bars). No inline style anywhere (CSP). */

/* The scripts: the same self-hosted Arabic, Urdu and Devanagari files as the platform (packages/ui/src/fonts),
   in families of their own, listed after the Latin faces in --text and --display: folded into "AP Text" and "AP Display"
   with different weight ranges, the browser picked one weight bucket per family and dropped either Geist or the
   script (Arabic at 600 fell to the system font). */
@font-face { font-family: "WF Arabic"; src: url("/a/ap-arabic-400.woff2") format("woff2"); font-weight: 100 449; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Arabic"; src: url("/a/ap-arabic-500.woff2") format("woff2"); font-weight: 450 549; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Arabic"; src: url("/a/ap-arabic-600.woff2") format("woff2"); font-weight: 550 649; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Arabic"; src: url("/a/ap-arabic-700.woff2") format("woff2"); font-weight: 650 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Arabic Display"; src: url("/a/ap-arabic-600.woff2") format("woff2"); font-weight: 100 649; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Arabic Display"; src: url("/a/ap-arabic-700.woff2") format("woff2"); font-weight: 650 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "AP Urdu"; src: url("/a/ap-urdu-400.woff2") format("woff2"); font-weight: 100 549; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "AP Urdu"; src: url("/a/ap-urdu-700.woff2") format("woff2"); font-weight: 550 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "WF Devanagari"; src: url("/a/ap-devanagari-400.woff2") format("woff2"); font-weight: 100 549; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF, U+200C-200D, U+25CC; }
@font-face { font-family: "WF Devanagari"; src: url("/a/ap-devanagari-600.woff2") format("woff2"); font-weight: 550 900; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF, U+200C-200D, U+25CC; }
@font-face { font-family: "WF Devanagari Display"; src: url("/a/ap-devanagari-600.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF, U+200C-200D, U+25CC; }

:root[data-brand="wafra"] {
  --paper: #f4efe5;
  --paper-2: #eae2d3;
  --surface: #fbf8f2;
  --ink: #16120c;
  --ink-2: #4f4637;
  --ink-3: #6a604f;
  --field: #d6cab4;
  --accent: #8a5a12;
  --accent-strong: #70470b;
  --accent-ink: #7a4f0f;
  --accent-soft: #f2e5c9;
  --on-accent: #fffaf0;
  --night: #14110c;
  --night-2: #1f1a12;
  --night-3: #2b241a;
  --night-ink: #f1ebe0;
  --night-soft: #b9ae9a;
  --ui-line: #ddd2bf;
  --ui-bg: #fffdf8;
  --ui-ink: #16120c;
  --ui-soft: #6a604f;
  --wf-glow: #e3b36a;
  /* AED takes three letters (or a word in Arabic) where the euro takes one: the big price steps down to fit 390px. */
  --fig: clamp(5.25rem, 14vw, 15.5rem);
}
@media (prefers-color-scheme: dark) {
  :root[data-brand="wafra"]:not([data-scheme="light"]) {
    --paper: #14110c;
    --paper-2: #1c1811;
    --surface: #221d15;
    --ink: #f1ebe0;
    --ink-2: #c2b8a6;
    --ink-3: #968c7a;
    --field: #3d3427;
    --accent: #c9923a;
    --accent-strong: #dba552;
    --accent-ink: #e3b36a;
    --accent-soft: #3a2c16;
    --on-accent: #14110c;
    --night: #0d0b07;
    --night-2: #1a160f;
    --night-3: #262017;
    --ui-line: #362e22;
    --ui-bg: #1c1811;
    --ui-ink: #f1ebe0;
    --ui-soft: #a99f8c;
  }
}

/* The cobalt tints sales.css draws on dark grounds become the gold of the theme. */
[data-brand="wafra"] .sp-marq__track .ap-icon,
[data-brand="wafra"] .ag__toast .ap-icon,
[data-brand="wafra"] .sp-note-n__app .ap-icon,
[data-brand="wafra"] .sp-plan__name .ap-icon { color: var(--wf-glow); }
[data-brand="wafra"] .pn__hand { background: var(--wf-glow); }
[data-brand="wafra"] .sp-letter mark { background: #f2e5c9; }

/* The scripts: Urdu in its own face; connected scripts never take negative tracking (it breaks the joins); taller
   lines for the marks above and below the letters. */
:root[data-brand="wafra"] { --display: "AP Display", "WF Arabic Display", "WF Devanagari Display", system-ui, sans-serif; --text: "AP Text", "WF Arabic", "WF Devanagari", system-ui, sans-serif; }
:root[data-brand="wafra"]:lang(ur) { --display: "AP Urdu", "AP Display", "WF Arabic Display", system-ui, sans-serif; --text: "AP Urdu", "AP Text", "WF Arabic", system-ui, sans-serif; }
[data-brand="wafra"]:lang(ar), [data-brand="wafra"]:lang(ar) *, [data-brand="wafra"]:lang(ur), [data-brand="wafra"]:lang(ur) * { letter-spacing: 0 !important; }
[data-brand="wafra"]:lang(ar) body.ap-body { line-height: 1.7; }
[data-brand="wafra"]:lang(ur) body.ap-body { line-height: 1.95; }
[data-brand="wafra"]:lang(hi) body.ap-body { line-height: 1.7; }
[data-brand="wafra"]:lang(ar) .sp-h1, [data-brand="wafra"]:lang(hi) .sp-h1 { line-height: 1.2; }
[data-brand="wafra"]:lang(ar) .sp-h2, [data-brand="wafra"]:lang(ar) .sp-h3, [data-brand="wafra"]:lang(hi) .sp-h2, [data-brand="wafra"]:lang(hi) .sp-h3 { line-height: 1.3; }
[data-brand="wafra"]:lang(ur) .sp-h1 { line-height: 1.45; }
[data-brand="wafra"]:lang(ur) .sp-h2, [data-brand="wafra"]:lang(ur) .sp-h3 { line-height: 1.55; }
[data-brand="wafra"]:lang(ar) h1, [data-brand="wafra"]:lang(ar) h2, [data-brand="wafra"]:lang(ar) h3,
[data-brand="wafra"]:lang(hi) h1, [data-brand="wafra"]:lang(hi) h2, [data-brand="wafra"]:lang(hi) h3 { line-height: 1.3; }
[data-brand="wafra"]:lang(ur) h1, [data-brand="wafra"]:lang(ur) h2, [data-brand="wafra"]:lang(ur) h3 { line-height: 1.6; }
/* Figures, codes and prices keep their own order inside right-to-left lines. */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"] { direction: ltr; text-align: end; }

/* A Latin name inside a right-to-left line (the seller in the footer) is set apart and never broken across lines,
   or its words and brackets come out of order. */
[data-brand="wafra"] bdi { white-space: nowrap; }

/* The logo: Latin letters in every language (its outlines carry their own spacing), the notebook and underline gold. */
.wf-logo { direction: ltr; }

/* The language switcher: four native names, always visible, the current one filled. */
.wf-lang { display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 4px; margin-inline-start: auto; padding: 4px; border-radius: 999px; background: var(--paper-2); font-size: .9rem; line-height: 1; }
.sp-top__nav + .wf-lang { margin-inline-start: 0; }
.wf-lang a { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
svg.ap-flag { display: inline-block; flex: none; width: 21px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(128 128 128 / .3); vertical-align: -2px; }
.wf-lang a:hover { color: var(--ink); }
/* a 44px target around the small pill, without changing its look */
.wf-lang a::after { content: ""; position: absolute; inset: -5px -2px; }
.wf-lang a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; }
.wf-lang a:lang(ur) { font-family: "AP Urdu", "AP Text", "WF Arabic", system-ui, sans-serif; }
.wf-lang a:lang(hi) { font-family: "AP Text", "WF Devanagari", system-ui, sans-serif; }
.wf-lang a:lang(ar) { font-family: "AP Text", "WF Arabic", system-ui, sans-serif; }
.wf-top .ap-top__in { flex-wrap: wrap; }
@media (max-width: 699px) {
  .wf-top .ap-top__in { row-gap: 12px; }
  .wf-top .sp-top__act { display: none; }
  .wf-lang { font-size: .84rem; }
  .wf-lang a { min-height: 34px; padding: 0 10px; }
}
/* Narrow phones: the other languages show only their flag (the name stays for screen readers) */
@media (max-width: 429px) {
  .wf-lang a:not([aria-current]) { padding: 0 9px; }
  .wf-lang a:not([aria-current]) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Right to left: what logical properties do not turn. */
/* Only the arrow points somewhere (icons.js draws it as arrow-right, matched by its path so the shared markup stays
   as it is); play, check and the other glyphs read the same both ways. */
[dir="rtl"] .ap-icon:has(> path[d^="M221.66,133.66"]), [dir="rtl"] .sp-ft--go svg { scale: -1 1; }
/* the arrow's hover nudge needs no RTL rule: the mirror above turns the shared translateX(4px) the right way */
[dir="rtl"] .bk[data-step] [data-bk-step], [dir="rtl"] .bk-done, [dir="rtl"] .sp-how__stage, [dir="rtl"] .hw__s, [dir="rtl"] .dlg__form.is-stepped .dlg__step.is-on { animation-name: wf-in-rtl; }
@keyframes wf-in-rtl { from { opacity: 0; transform: translateX(-14px); } }
[dir="rtl"] .ap-player__progress span, [dir="rtl"] .ap-vp__bar span, [dir="rtl"] .ap-timer__bar span, [dir="rtl"] .dlg__bar span { transform-origin: right; }
[dir="rtl"] .ap-select { background-position: left 16px center; }
[dir="rtl"] .sp-stage { clip-path: polygon(0 0, calc(100% - 72px) 0, 100% 72px, 100% 100%, 0 100%); }
@media (min-width: 1000px) {
  [dir="rtl"] .sp-stage { clip-path: polygon(0 0, calc(100% - 180px) 0, 100% 180px, 100% 100%, 0 100%); }
}
[dir="rtl"] .sp-marq__track { padding: 0 0 0 44px; }
@media (prefers-reduced-motion: no-preference) {
  [dir="rtl"] .sp-marq__track { animation-name: wf-marq-rtl; }
  @keyframes wf-marq-rtl { to { transform: translateX(100%); } }
  [dir="rtl"].js .sp-shutter.is-in { clip-path: polygon(0 0, calc(100% - 72px) 0, 100% 72px, 100% 100%, 0 100%); }
}
[dir="rtl"] .pn__msg { border-radius: 14px 4px 14px 14px; }
/* the loss line's falling trend runs with the reading direction */
[dir="rtl"] .sp-pane__loss .ap-icon { scale: -1 1; }

/* The price: four figures and a three-letter currency fill the column, so the 15-minute tag sits above the figure
   instead of over its end, and the line under it clears the comma's tail. */
[data-brand="wafra"] .sp-price__fig { display: flex; flex-direction: column; align-items: flex-start; }
[data-brand="wafra"] .sp-price__timer { position: static; order: -1; margin-block-end: 22px; }
[data-brand="wafra"] .sp-price__was { margin-block-start: 30px; }
[data-brand="wafra"] .sp-price__inc, [data-brand="wafra"] .sp-price__fig > p { align-self: stretch; }

/* The cards on the gold take a warm shade, not the cobalt one; the letter's photo a warm ring. */
[data-brand="wafra"] .sp-letter__photo img { box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #f2e5c9; }
[data-brand="wafra"] .dlg, [data-brand="wafra"] .sp-ticket { box-shadow: 0 24px 60px rgba(40, 24, 4, .35); }
[data-brand="wafra"] .ag__toast { box-shadow: 0 14px 34px rgba(40, 24, 4, .28); } /* taste-skill-ignore: inside a [data-ui] fragment, an overlay, or visually-hidden */
