/* =============================================================================
   Kounouz – custom styles (complements Tailwind CDN utilities)
   Uses logical properties (inline-start / inline-end) so RTL and LTR mirror.
   ============================================================================= */

/* ---- Fonts per language ---------------------------------------------------- */
:root {
  --font-display: 'Noto Kufi Arabic', 'Bodoni Moda', serif;
  --font-body: 'Tajawal', 'Montserrat', system-ui, sans-serif;
  --bar-h: 64px;
  /* Corner radii (soft design) */
  --r-field: 14px;
  --r-card: 18px;
  --r-sheet: 24px;
}
html[lang='fr'] {
  --font-display: 'Bodoni Moda', 'Noto Kufi Arabic', serif;
  --font-body: 'Montserrat', 'Tajawal', system-ui, sans-serif;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  background: #fcf9f3;
  color: #1c1c18;
  font-family: var(--font-body);
  font-size: 16px;            /* readable minimum on mobile (Arabic needs ≥16px) */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(253, 164, 145, 0.15);
}
html[lang='fr'] body { font-size: 15px; line-height: 1.65; }
@media (min-width: 768px) { html[lang='fr'] body { font-size: 16px; } }

h1, h2, h3, .font-display { font-family: var(--font-display); font-weight: 500; }
html[lang='ar'] h1, html[lang='ar'] h2, html[lang='ar'] h3, html[lang='ar'] .font-display { line-height: 1.6; font-weight: 600; }
html[lang='fr'] h1, html[lang='fr'] h2 { line-height: 1.15; }

/* Arabic text must never be letter-spaced */
html[lang='ar'] [class*='tracking-'] { letter-spacing: 0 !important; }
html[lang='ar'] .uppercase { text-transform: none; }

/* Flip direction-aware icons (arrows) in RTL */
[dir='rtl'] .flip-rtl { transform: scaleX(-1); }

.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; }

/* ---- Accessibility ---------------------------------------------------------- */
.skip-link {
  border-radius: 9999px;
  position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 100;
  background: #1c1c18; color: #fcf9f3; padding: 0.75rem 1rem;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid #fda491; outline-offset: 2px; }
.focus-ring:focus-visible { outline: 2px solid #fda491; outline-offset: 4px; }

/* Minimum 44×44 tap target for icon buttons */
.tap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0.5rem;
}

/* ---- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.75rem 1.5rem;
  font-weight: 600; font-size: 16px; text-align: center; line-height: 1.3;
  border: 1px solid transparent; border-radius: 9999px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary, .btn-dark, .btn-wa { box-shadow: 0 8px 20px -10px rgba(28, 28, 24, .35); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #fda491; color: #1c1c18; }
.btn-primary:hover { background: #f58a72; }
.btn-dark { background: #1c1c18; color: #fcf9f3; }
.btn-dark:hover { background: #33332c; }
.btn-wa { background: #1d7a52; color: #fff; }
.btn-wa:hover { background: #166442; }
.btn-outline { background: transparent; color: #1c1c18; border-color: #1c1c18; }
.btn-outline:hover { background: #1c1c18; color: #fcf9f3; }
.btn-light { background: #fcf9f3; color: #1c1c18; }
.btn-light:hover { background: #fff; }
html[lang='fr'] .btn { font-size: 15px; }

/* ---- Forms ------------------------------------------------------------------ */
.field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 0.4rem; }
.input {
  display: block; width: 100%; min-height: 52px;
  padding: 0.75rem 1rem; font-size: 16px; /* 16px prevents zoom on iOS */
  background: #fff; color: #1c1c18;
  border: 1px solid #d9d0bf; border-radius: var(--r-field);
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #8a8273; }
.input:focus { outline: none; border-color: #fda491; box-shadow: 0 0 0 3px rgba(253, 164, 145, .18); }
.input[aria-invalid='true'] { border-color: #994535; box-shadow: 0 0 0 3px rgba(153, 69, 53, .12); }
textarea.input { min-height: 96px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fda491' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px;
  background-position: left 0.9rem center; padding-inline-end: 2.75rem;
}
[dir='ltr'] select.input { background-position: right 0.9rem center; }
.field-error { color: #994535; font-size: 14px; margin-top: 0.35rem; font-weight: 500; }
.field-hint { color: #5f584c; font-size: 14px; margin-top: 0.35rem; }

/* Chips = checkbox / radio styled as big tappable buttons */
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip > span {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; min-width: 44px; padding: 0.5rem 1rem;
  border: 1px solid #d9d0bf; border-radius: 9999px; background: #fff; font-size: 15px; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip input:checked + span { background: #1c1c18; border-color: #1c1c18; color: #fcf9f3; }
.chip input:focus-visible + span { outline: 2px solid #fda491; outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* Option cards (payment method, appointment place) */
.option-card { position: relative; display: block; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card > .option-card__ui {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: 1rem; border: 1px solid #d9d0bf; border-radius: var(--r-card); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.option-card .option-card__dot {
  flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 9999px;
  border: 2px solid #8a8273; display: inline-flex; align-items: center; justify-content: center;
}
.option-card input:checked + .option-card__ui { border-color: #fda491; box-shadow: inset 0 0 0 1px #fda491; background: #fffdf8; }
.option-card input:checked + .option-card__ui .option-card__dot { border-color: #fda491; }
.option-card input:checked + .option-card__ui .option-card__dot::after {
  content: ''; width: 10px; height: 10px; border-radius: 9999px; background: #fda491;
}
.option-card input:focus-visible + .option-card__ui { outline: 2px solid #fda491; outline-offset: 2px; }

/* Color swatches */
.swatch { position: relative; display: inline-flex; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span {
  width: 44px; height: 44px; border-radius: 9999px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(28,28,24,.15); border: 3px solid #fcf9f3; outline: 1px solid transparent;
  transition: outline-color .15s;
}
.swatch input:checked + span { outline: 2px solid #1c1c18; outline-offset: 1px; }
.swatch input:focus-visible + span { outline: 2px solid #fda491; outline-offset: 3px; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: stretch; border: 1px solid #d9d0bf; border-radius: 9999px; overflow: hidden; background: #fff; }
.qty button { width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.qty button:disabled { opacity: .35; }
.qty output, .qty input { width: 44px; text-align: center; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; font-size: 16px; }

/* ---- Accordion (<details>) ------------------------------------------------- */
.acc { border-bottom: 1px solid #e6dfd0; }
.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 56px; padding: 0.9rem 0; font-weight: 600; font-size: 16px;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .acc__icon { flex: none; width: 20px; height: 20px; color: #fda491; transition: transform .2s; }
.acc[open] > summary .acc__icon { transform: rotate(180deg); }
.acc__body { padding-bottom: 1.1rem; color: #3d3a33; }

/* ---- Drawer & overlay ------------------------------------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 55; background: rgba(28, 28, 24, .5);
  opacity: 0; transition: opacity .25s;
}
.overlay.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 60;
  width: 86%; max-width: 380px; background: #fcf9f3; display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.2);
  border-start-end-radius: var(--r-sheet); border-end-end-radius: var(--r-sheet); overflow: hidden;
  transform: translateX(-100%); visibility: hidden;
  transition: transform .28s ease, visibility 0s linear .28s;
}
[dir='rtl'] .drawer { transform: translateX(100%); }
.drawer.is-open, [dir='rtl'] .drawer.is-open { transform: none; visibility: visible; transition: transform .28s ease; }

/* ---- Bottom sheet (catalog filters on mobile) ------------------------------ */
@media (max-width: 1023.98px) {
  .sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    max-height: 88vh; background: #fcf9f3; display: flex; flex-direction: column;
    box-shadow: 0 -12px 40px rgba(0,0,0,.2);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; overflow: hidden;
    transform: translateY(100%); visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
  }
  .sheet.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
}

/* ---- Mobile bottom bar ----------------------------------------------------- */
.bottom-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  background: #fcf9f3; border-top: 1px solid #e6dfd0; border-radius: 20px 20px 0 0; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 20px rgba(28,28,24,.06);
}
.bottom-bar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--bar-h); font-size: 13px; font-weight: 600;
}
.bottom-bar__item + .bottom-bar__item { border-inline-start: 1px solid #e6dfd0; }
body.has-bottom-bar { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { body.has-bottom-bar { padding-bottom: 0; } }

/* ---- Toast ----------------------------------------------------------------- */
.toast {
  position: fixed; z-index: 70; inset-inline: 16px;
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 12px);
  display: flex; align-items: center; gap: .75rem;
  background: #1c1c18; color: #fcf9f3; padding: .5rem 1rem; min-height: 56px; border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: transform .25s, opacity .25s;
}
.toast.is-visible { transform: none; opacity: 1; pointer-events: auto; }
@media (min-width: 768px) {
  .toast { bottom: 24px; inset-inline: auto 24px; max-width: 26rem; }
  [dir='rtl'] .toast { inset-inline: auto 24px; }
}

/* ---- Gallery (swipe with scroll-snap) -------------------------------------- */
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track > * { flex: 0 0 100%; scroll-snap-align: start; }
.thumb { border-radius: 12px; }
.thumb[aria-current='true'] { outline: 2px solid #1c1c18; outline-offset: 2px; }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---- Decorative ------------------------------------------------------------ */
.kicker { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: #b0462f; font-weight: 700; }
html[lang='ar'] .kicker { font-size: 14px; }
.rule-gold { width: 56px; height: 1px; background: #c5a059; }
.placeholder-box { border: 1px dashed #c5a059; border-radius: var(--r-card); background: repeating-linear-gradient(135deg, #fcf9f3, #fcf9f3 10px, #f6f0e4 10px, #f6f0e4 20px); }

/* Legal / long text */
.prose-kz h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: .75rem; }
.prose-kz h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: .5rem; }
.prose-kz p, .prose-kz li { color: #3d3a33; margin-bottom: .6rem; }
.prose-kz ul { list-style: disc; padding-inline-start: 1.25rem; }

/* Language-specific blocks (used for long legal texts) */
html[lang='ar'] [data-lang-only='fr'], html[lang='fr'] [data-lang-only='ar'] { display: none !important; }

/* Hidden attribute must win over utility display classes */
[hidden] { display: none !important; }

/* The header wrapper must not limit the sticky header to its own height */
#site-header { display: contents; }

/* =============================================================================
   Stories (home page) – bubbles + full-screen viewer
   ============================================================================= */
.flip-ltr { transform: none; }
[dir='ltr'] .flip-ltr { transform: scaleX(-1); }

.story-bubble {
  flex: none; width: 80px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer; color: #1c1c18;
}
.story-ring {
  position: relative; display: inline-flex; padding: 3px; border-radius: 9999px;
  background: conic-gradient(from 200deg, #fda491, #c5a059, #fda491);
}
.story-ring.is-seen { background: #d9d0bf; }
.story-ring > .story-ring__img {
  display: block; width: 68px; height: 68px; border-radius: 9999px; overflow: hidden;
  border: 3px solid #fcf9f3; background: #f4eee2;
}
.story-ring img { width: 100%; height: 100%; object-fit: cover; }
.story-badge {
  position: absolute; inset-inline-end: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 9999px;
  background: #1c1c18; color: #fcf9f3; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fcf9f3;
}
.story-label { font-size: 13px; line-height: 1.3; max-width: 80px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-bubble:focus-visible { outline: 2px solid #1c1c18; outline-offset: 4px; border-radius: 16px; }
@media (min-width: 768px) {
  .story-bubble { width: 88px; }
  .story-ring > .story-ring__img { width: 76px; height: 76px; }
  .story-label { max-width: 88px; font-size: 14px; }
}
.stories-scroll {
  display: none; position: absolute; top: 24px; z-index: 5; width: 44px; height: 44px; border-radius: 9999px;
  align-items: center; justify-content: center; background: #fcf9f3; color: #1c1c18; border: 1px solid #e6dfd0;
  box-shadow: 0 8px 20px -10px rgba(28,28,24,.4); cursor: pointer;
}
.stories-scroll:hover { background: #f4eee2; }
.stories-scroll--start { inset-inline-start: -14px; }
.stories-scroll--end { inset-inline-end: -14px; }
@media (min-width: 768px) { .stories-scroll { display: inline-flex; } }

.story-viewer {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: rgba(15, 15, 12, .94);
}
.story-frame {
  position: relative; width: 100%; height: 100%; background: #111; overflow: hidden; color: #fff;
  touch-action: pan-y;
}
@media (min-width: 768px) {
  .story-frame { width: min(420px, 92vw); height: min(90vh, 747px); border-radius: 24px; }
}
.story-media { position: absolute; inset: 0; }
.story-media video { width: 100%; height: 100%; object-fit: cover; }
.story-media .bg { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(28px) brightness(.7); }
.story-media .fg { position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); width: 100%; max-height: 72%; object-fit: contain; }
.story-progress {
  position: absolute; z-index: 4; inset-inline: 10px; top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 4px;
}
.story-progress i { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 9999px; overflow: hidden; }
.story-progress b { display: block; height: 100%; width: 0; background: #fff; }
.story-head {
  position: absolute; z-index: 4; inset-inline: 6px; top: calc(20px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 8px; padding-top: 4px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); padding-bottom: 28px; margin-top: -6px;
}
.story-head .story-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-start: 6px; }
.story-head button { color: #fff; }
.story-hit { position: absolute; z-index: 2; top: 90px; bottom: 170px; background: none; border: 0; cursor: pointer; }
.story-hit--prev { inset-inline-start: 0; width: 35%; }
.story-hit--next { inset-inline-end: 0; width: 65%; }
.story-foot {
  position: absolute; z-index: 4; inset-inline: 0; bottom: 0;
  padding: 40px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.45) 60%, transparent);
}
.story-foot .story-name { font-family: var(--font-display); font-size: 18px; line-height: 1.4; }
.story-foot .story-price { font-size: 15px; opacity: .9; margin-top: 2px; }
.story-foot .story-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.story-nav {
  display: none; flex: none; width: 48px; height: 48px; border-radius: 9999px; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15); color: #fff; border: 0; cursor: pointer;
}
.story-nav:hover { background: rgba(255,255,255,.28); }
.story-nav:disabled { opacity: .3; cursor: default; }
@media (min-width: 768px) { .story-nav { display: inline-flex; } }

/* ---- Dropdown menu (desktop "Women") -------------------------------------- */
.dropdown {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 50; min-width: 270px;
  background: #fcf9f3; border: 1px solid #e6dfd0; border-radius: 18px; padding: 8px;
  box-shadow: 0 18px 40px -18px rgba(28, 28, 24, .35);
}
.dropdown a {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; color: #1c1c18;
}
.dropdown a:hover, .dropdown a:focus-visible { background: #f4eee2; }
.dropdown .dropdown__all { font-weight: 600; margin-bottom: 4px; border-bottom: 1px solid #e6dfd0; border-radius: 12px 12px 0 0; }
.dd-chev { display: inline-flex; transition: transform .2s; }
[aria-expanded='true'] > .dd-chev { transform: rotate(180deg); }

/* ---- Home hero video player ---------------------------------------------------
   Portrait 9:16 box (same shape as the video) → the full frame is shown, nothing is cropped.
   Height = 78% of the screen height (max 820px); width follows from the ratio. */
.hero-stage { display: flex; justify-content: center; }
.hero-player {
  position: relative; overflow: hidden; background: #f4eee2; border-radius: 24px;
  aspect-ratio: var(--hero-r, 0.5625);          /* width / height of the video (9:16 = 0.5625) */
  width: min(100%, calc(min(78vh, 820px) * var(--hero-r, 0.5625)));
  width: min(100%, calc(min(78svh, 820px) * var(--hero-r, 0.5625)));
  box-shadow: 0 28px 60px -32px rgba(28, 28, 24, .5);
}

@media (max-width: 767.98px) {
  .hero-player {
    width: min(100%, calc(min(70vh, 820px) * var(--hero-r, 0.5625)));
    width: min(100%, calc(min(70svh, 820px) * var(--hero-r, 0.5625)));
  }
}

/* anti-spam honeypot field (off-screen, not display:none, so bots still see it) */
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice-paused { border-radius: 12px; padding: 12px 14px; background: #fff7e0; border: 1px solid #f0dca0; font-size: 15px; }

/* cookie / pixel consent (shown only when "consent banner" is on in the admin panel) */
.consent-bar {
  position: fixed; z-index: 75; inset-inline: 12px; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 12px);
  background: #fcf9f3; border: 1px solid #e6dfd0; border-radius: 18px; padding: 14px 16px; box-shadow: 0 20px 40px -20px rgba(28,28,24,.45);
  display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin-inline: auto; font-size: 15px;
}
.consent-bar p { margin: 0; }
.consent-bar div { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-bar .btn { min-height: 44px; flex: 1; }
@media (min-width: 768px) { .consent-bar { bottom: 16px; inset-inline-start: 16px; inset-inline-end: auto; margin: 0; } }

/* ---- Readability (Arabic): heavier strokes, larger small text, stronger greys ---------------------------- */
html[lang='ar'] body { font-weight: 500; font-size: 17px; line-height: 1.75; }
html[lang='ar'] .font-display, html[lang='ar'] h1, html[lang='ar'] h2, html[lang='ar'] h3 { font-weight: 700; }
html[lang='ar'] .text-muted { color: #46403a; }
html[lang='ar'] .text-\[11px\] { font-size: 13px; }
html[lang='ar'] .text-\[12px\] { font-size: 14px; }
html[lang='ar'] .text-\[13px\] { font-size: 14.5px; }
html[lang='ar'] .text-\[14px\] { font-size: 15.5px; }
html[lang='ar'] .text-\[15px\] { font-size: 16.5px; }
html[lang='ar'] .text-xs { font-size: 13.5px; }
html[lang='ar'] .text-sm { font-size: 15.5px; }
html[lang='ar'] .field-hint, html[lang='ar'] .field-error { font-size: 15px; }
html[lang='ar'] .chip > span, html[lang='ar'] .input { font-weight: 500; }
.text-muted { color: #4a443a; }
.kicker, .nav-link { font-weight: 700; }
