/* ============================================================
   Al-Souq website — custom styles
   Layered on top of Tailwind's utility classes (loaded via CDN).
   Only styles Tailwind utilities can't express live here.
   ============================================================ */

:root {
  --shadow-soft:    0 1px 2px rgba(15,68,40,0.04), 0 8px 24px rgba(15,68,40,0.08);
  --shadow-feature: 0 1px 2px rgba(0,0,0,0.04), 0 12px 28px rgba(15,68,40,0.08);
  --brand-emerald:  #1A6B3C;
  --brand-gold:     #C8962B;
  --brand-cream:    #FAF8F3;
  --brand-ink:      #0E1A14;
}

html { scroll-behavior: smooth; }

/* When switching languages via JS, all elements get an inert flag
   so the brief moment between DOM swap and font-load doesn't flicker. */
html.is-lang-switching body { opacity: 0.001; }
html.is-lang-switching body.lang-ready { opacity: 1; transition: opacity .18s ease; }

body {
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic fonts apply only when html[lang="ar"] is set (JS toggles it). */
html[lang="ar"] body { font-family: var(--font-arabic, "IBM Plex Sans Arabic"), "Segoe UI", system-ui, sans-serif; }
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 { letter-spacing: -0.01em; line-height: 1.35; }

/* ====== Fixed nav backdrop polish ====== */
header nav a { scroll-margin-top: 80px; }

/* ====== Phone-frame mockup (hero) ====== */
.phone-frame {
  position: relative;
  width: 300px;
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  background: linear-gradient(160deg, #1f2937 0%, #0b1220 100%);
  padding: 12px;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.06) inset,
    0 20px 50px rgba(15,68,40,0.25),
    0 6px 18px rgba(0,0,0,0.20);
  transform: rotate(-3deg);
  transition: transform .35s ease;
  will-change: transform;
}
.phone-frame:hover { transform: rotate(0deg) translateY(-4px); }

.phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 22px;
  background: #0b1220;
  border-radius: 0 0 16px 16px;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4) inset;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, var(--brand-cream) 0%, #ffffff 80%);
  border-radius: 32px;
  overflow: hidden;
  font-size: 11px;
}

/* ====== Feature cards ====== */
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid #ece6d8;
  border-radius: 20px;
  padding: 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(26,107,60,0.35);
  box-shadow: var(--shadow-feature);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-title  { font-weight: 700; font-size: 1.05rem; color: var(--brand-ink); }
.feature-body  { font-size: 0.95rem; line-height: 1.55; color: rgba(14,26,20,0.75); }

/* RTL: small icon nudge for natural feel. */
[dir="rtl"] .feature-card { text-align: right; }

/* ====== How-it-works step tiles ====== */
.step {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 1.75rem;
  position: relative;
}
.step-number {
  position: absolute;
  top: -22px;
  left: 1.75rem;
  width: 44px; height: 44px;
  background: var(--brand-gold);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(200,150,43,0.45);
}
[dir="rtl"] .step-number { left: auto; right: 1.75rem; }
.step-title { font-weight: 700; font-size: 1.2rem; }
.step-body  { margin-top: 0.5rem; color: rgba(255,255,255,0.85); line-height: 1.55; }

/* ====== Trust tiles ====== */
.trust-tile {
  background: #fff;
  border: 1px solid #ece6d8;
  border-radius: 18px;
  padding: 1.25rem;
  transition: border-color .2s ease, transform .2s ease;
}
.trust-tile:hover { border-color: rgba(200,150,43,0.5); transform: translateY(-2px); }
.trust-tile-num {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-gold-700, #A07918);
  background: rgba(200,150,43,0.12);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
[dir="rtl"] .trust-tile-num { letter-spacing: 0; }

/* ====== Play Store + APK badges ====== */
.play-badge, .apk-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #000;
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  min-width: 200px;
  transition: transform .2s ease, background .2s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.apk-badge { background: var(--brand-ink); }
.play-badge:hover, .apk-badge:hover { transform: translateY(-2px); background: #1a1a1a; }
.play-badge::before {
  content: "";
  width: 28px; height: 28px;
  background: radial-gradient(circle at 65% 35%, #34a853 0 25%, transparent 25%),
              radial-gradient(circle at 35% 65%, #fbbc05 0 25%, transparent 25%),
              radial-gradient(circle at 65% 65%, #ea4335 0 25%, transparent 25%),
              radial-gradient(circle at 35% 35%, #4285f4 0 25%, transparent 25%);
  border-radius: 6px;
}
/* The .apk-badge icon (storefront glyph) is now supplied inline by index.html
   instead of via this ::before pseudo-element, so the brand surface is the
   SAME SVG used in the top-left nav — single source of truth. The X-like icon
   that previously rendered here was a placeholder. */
.play-badge-text { line-height: 1.1; text-align: left; }
[dir="rtl"] .play-badge { flex-direction: row-reverse; }
[dir="rtl"] .play-badge-text { text-align: right; }

/* ====== FAQ accordion ====== */
.faq-item {
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: background .2s ease;
  list-style: none;
}
.faq-item + .faq-item { margin-top: -1px; border-top: 1px solid #ece6d8; }
.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--brand-ink);
  list-style: none;
  cursor: pointer;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-chev {
  display: inline-flex;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(26,107,60,0.08);
  color: var(--brand-emerald);
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  transition: transform .25s ease, background .2s ease;
  flex-shrink: 0;
}
.faq-item[open] {
  background: #fff;
  box-shadow: var(--shadow-soft);
  border-radius: 14px;
}
.faq-item[open] .faq-chev { transform: rotate(90deg); background: var(--brand-emerald); color: #fff; }
.faq-item > p {
  margin-top: 0.75rem;
  color: rgba(14,26,20,0.75);
  line-height: 1.6;
  font-size: 0.97rem;
}
[dir="rtl"] .faq-chev { transform: rotate(180deg); }
[dir="rtl"] .faq-item[open] .faq-chev { transform: rotate(90deg); }
[dir="rtl"] .faq-item > summary { flex-direction: row-reverse; }

/* ====== Language picker active state (JS sets aria-pressed) ====== */
[data-lang-btn][aria-pressed="true"] {
  background: var(--brand-emerald);
  color: #fff;
}

/* ====== Mobile menu open state ====== */
#mobile-menu.is-open { display: block; }

/* ====== Reduce motion ====== */
@media (prefers-reduced-motion: reduce) {
  .phone-frame, .feature-card, .trust-tile, .play-badge, .apk-badge, .feature-card, .trust-tile { transition: none; }
  .faq-chev { transition: none; }
  html { scroll-behavior: auto; }
}

/* ====== Print-friendly rules ====== */
@media print {
  header, #download, footer, .phone-frame { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}

/* ====== A11y — visible focus rings ====== */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 3px;
  border-radius: 8px;
}
