/* ============================================================
   Lavage — Global foundation
   Reset, design tokens, shared components (switcher, WhatsApp
   widget, buttons, FAQ, before/after, footer bottom, a11y).
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, picture, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.25; overflow-wrap: break-word; }
p { overflow-wrap: break-word; }
cite { font-style: normal; }
fieldset { border: 0; padding: 0; }
:focus-visible { outline: 3px solid #2EC4B6; outline-offset: 3px; border-radius: 4px; }

/* ---------- Language-aware font stacks ---------- */
:root {
  --font-ar-body: "Tajawal", "Cairo", system-ui, sans-serif;
  --font-ar-display: "Cairo", "Tajawal", system-ui, sans-serif;
  --font-ar-soft: "Alexandria", "Tajawal", system-ui, sans-serif;
  --font-ar-kufi: "Noto Kufi Arabic", "Tajawal", system-ui, sans-serif;
  --font-fr-body: "Manrope", system-ui, sans-serif;
  --font-fr-display: "Sora", system-ui, sans-serif;
  --font-fr-soft: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-fr-editorial: "DM Sans", system-ui, sans-serif;
  --font-fr-serif: "Cormorant Garamond", Georgia, serif;

  --wa-green: #25D366;
  --wa-green-dark: #128C7E;
}

body { font-family: var(--font-ar-body); line-height: 1.65; }
:root[lang="fr"] body { font-family: var(--font-fr-body); }

/* Flip directional arrows in RTL */
:root[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 2.5rem, 1200px); margin-inline: auto; }
.container-narrow { max-width: 820px; }

.visually-hidden,
.sr-status {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -100px; inset-inline-start: 1rem; z-index: 300;
  background: #132A24; color: #fff; padding: .7rem 1.2rem; border-radius: .5rem;
  text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

.demo-note { font-size: .78rem; opacity: .62; margin-top: 1.2rem; text-align: center; }

body.nav-locked { overflow: hidden; }
html:has(body.nav-locked) { overflow: hidden; }

/* ---------- Base buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  text-decoration: none; border: 2px solid transparent; min-height: 48px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 1rem 2.1rem; font-size: 1.05rem; }

/* Ripple ink (Model 2) */
.ripple-ink {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); pointer-events: none;
  transform: translate(-50%, -50%) scale(0); animation: ripple-grow .6s ease-out forwards;
}
@keyframes ripple-grow { to { transform: translate(-50%, -50%) scale(22); opacity: 0; } }

/* ---------- Model visibility & transitions ---------- */
.landing-model { min-height: 100vh; }
.landing-model[hidden] { display: none; }
.model-exit { animation: model-fade-out .32s ease forwards; }
.model-enter { animation: model-fade-in .32s ease; }
@keyframes model-fade-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes model-fade-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Floating model switcher ---------- */
.model-switcher {
  position: fixed; z-index: 220; inset-inline-end: 1.1rem; top: 50%;
  transform: translateY(-50%); display: flex; flex-direction: column; gap: .6rem;
}
.switcher-btn {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 26, 34, .82); color: #fff; border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 700; font-size: .8rem; letter-spacing: .05em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
}
.switcher-btn:hover { transform: scale(1.1); }
.switcher-btn.is-active {
  background: linear-gradient(135deg, #C8F04C, #8B7CF6);
  color: #131309;
  border-color: #fff; box-shadow: 0 0 0 3px rgba(200, 240, 76, .3), 0 6px 18px rgba(0, 0, 0, .3);
}
.switcher-num { pointer-events: none; }
.switcher-tip {
  position: absolute; inset-inline-end: calc(100% + .7rem); top: 50%;
  transform: translateY(-50%) scale(.92); transform-origin: right center;
  background: #10161f; color: #fff; font-size: .78rem; font-weight: 600;
  padding: .4rem .8rem; border-radius: .5rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.switcher-btn:hover .switcher-tip,
.switcher-btn:focus-visible .switcher-tip { opacity: 1; transform: translateY(-50%) scale(1); }

/* ---------- WhatsApp widget ---------- */
.wa-widget {
  position: fixed; z-index: 240;
  inset-inline-end: 1.2rem; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: .9rem;
}
:root[dir="rtl"] .wa-widget { align-items: flex-start; }

.wa-fab {
  position: relative; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
  box-shadow: 0 8px 24px rgba(18, 140, 126, .45);
  transition: transform .2s ease;
}
.wa-fab:hover { transform: scale(1.07); }
.wa-fab-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--wa-green); animation: wa-pulse 2.4s ease-out infinite;
}
@keyframes wa-pulse {
  0% { transform: scale(1); opacity: .8; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}
.wa-dot {
  position: absolute; top: 4px; inset-inline-end: 4px; width: 13px; height: 13px;
  border-radius: 50%; background: #FF9F43; border: 2px solid #fff;
}
.wa-tip {
  position: absolute; inset-inline-end: calc(100% + .8rem); top: 50%;
  transform: translateY(-50%); background: #10161f; color: #fff;
  font-size: .78rem; font-weight: 600; padding: .45rem .85rem; border-radius: .55rem;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.wa-fab:hover .wa-tip, .wa-fab:focus-visible .wa-tip { opacity: 1; }
.wa-widget.is-open .wa-tip { opacity: 0 !important; }

.wa-panel {
  width: min(340px, calc(100vw - 2.2rem));
  background: #fff; color: #132A24; border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(14px) scale(.97);
  transition: opacity .22s ease, transform .22s ease;
}
.wa-panel.is-open { opacity: 1; transform: none; }
.wa-panel[hidden] { display: none; }

.wa-panel-head {
  display: flex; align-items: center; gap: .7rem;
  background: linear-gradient(135deg, var(--wa-green-dark), #075E54);
  color: #fff; padding: .9rem 1rem;
}
.wa-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18);
  display: grid; place-items: center; flex-shrink: 0;
}
.wa-panel-id { flex: 1; min-width: 0; line-height: 1.3; }
.wa-panel-id strong { display: block; font-size: .95rem; }
.wa-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; opacity: .9; }
.wa-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #7CFC9B; }
.wa-close { color: #fff; padding: .4rem; border-radius: .5rem; display: grid; place-items: center; }
.wa-close:hover { background: rgba(255, 255, 255, .15); }

.wa-panel-body { padding: 1rem; display: flex; flex-direction: column; gap: .8rem; background: #F4F6F5; }
.wa-greeting {
  background: #fff; border-radius: 4px 14px 14px 14px; padding: .75rem .9rem;
  font-size: .88rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
:root[dir="rtl"] .wa-greeting { border-radius: 14px 4px 14px 14px; }
.wa-quick { display: flex; flex-wrap: wrap; gap: .45rem; }
.wa-quick-btn {
  font-size: .78rem; font-weight: 600; padding: .42rem .75rem; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--wa-green-dark); color: var(--wa-green-dark);
  transition: background .15s ease, color .15s ease;
}
.wa-quick-btn:hover { background: var(--wa-green-dark); color: #fff; }
.wa-input {
  border: 1.5px solid #d5ddd9; border-radius: 12px; padding: .7rem .85rem;
  font-size: .88rem; resize: vertical; min-height: 70px; background: #fff;
}
.wa-input:focus { border-color: var(--wa-green-dark); outline: none; }
.wa-send {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--wa-green); color: #fff; font-weight: 700; font-size: .92rem;
  padding: .75rem 1rem; border-radius: 12px; transition: background .15s ease, transform .15s ease;
}
.wa-send:hover { background: var(--wa-green-dark); transform: translateY(-1px); }
.wa-privacy { font-size: .68rem; opacity: .6; text-align: center; }

/* ---------- Back to top ---------- */
.back-top {
  position: fixed; z-index: 230; inset-inline-start: 1.2rem;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(19, 42, 36, .85); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .2s ease, opacity .2s ease;
}
.back-top:hover { transform: translateY(-3px); }
.back-top[hidden] { display: none; }

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex; border-radius: 999px; padding: 3px;
  background: rgba(127, 127, 127, .14); gap: 2px;
}
.lang-btn {
  padding: .32rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  opacity: .75; transition: background .15s ease, opacity .15s ease;
}
.lang-btn:hover { opacity: 1; }
.lang-btn.is-active { background: #fff; color: #132A24; opacity: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

/* ---------- Burger ---------- */
.nav-burger { display: none; padding: .5rem; border-radius: .6rem; }
.nav-burger .ic-close { display: none; }
.nav-burger[aria-expanded="true"] .ic-open { display: none; }
.nav-burger[aria-expanded="true"] .ic-close { display: block; }

/* ---------- Package feature lists ---------- */
.pkg-list { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.pkg-list li { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.pkg-list svg { flex-shrink: 0; color: currentColor; opacity: .85; }
.pkg-meta { font-size: .78rem; opacity: .68; margin-bottom: 1rem; }
.pkg-badge {
  position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(-50%);
  background: #FF9F43; color: #4a2c00; font-size: .74rem; font-weight: 800;
  padding: .3rem .95rem; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
}
:root[dir="rtl"] .pkg-badge { transform: translateX(50%); }

/* ---------- Before / After slider ---------- */
.ba-slider {
  --ba-pos: 50%;
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 2 / 1; max-width: 860px; margin-inline: auto;
  isolation: isolate; touch-action: pan-y;
}
.ba-pane { position: absolute; inset: 0; }
.ba-art { width: 100%; height: 100%; object-fit: cover; }
/* clip must be direction-agnostic: always from the physical left */
.ba-after { clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0); }
:root[dir="rtl"] .ba-after { clip-path: inset(0 0 0 var(--ba-pos)); }
.ba-tag {
  position: absolute; top: .9rem; left: .9rem; z-index: 3;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; font-weight: 700;
  padding: .3rem .8rem; border-radius: 999px;
}
.ba-tag-after { left: auto; right: .9rem; background: rgba(8, 127, 91, .85); }
:root[dir="rtl"] .ba-tag { left: auto; right: .9rem; }
:root[dir="rtl"] .ba-tag-after { right: auto; left: .9rem; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba-pos); z-index: 2;
  width: 3px; background: #fff; transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(0, 0, 0, .4); pointer-events: none;
}
:root[dir="rtl"] .ba-handle { left: auto; right: var(--ba-pos); transform: translateX(50%); }
.ba-handle-knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #132A24;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.ba-range {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; margin: 0;
}
.ba-range:focus-visible ~ * { outline: none; }
.ba-slider:has(.ba-range:focus-visible) { outline: 3px solid #2EC4B6; outline-offset: 3px; }

/* ---------- FAQ accordion ---------- */
.faq { display: flex; flex-direction: column; gap: .8rem; }
.faq-item h3 { margin: 0; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  text-align: start; font-size: .98rem; font-weight: 700; padding: 1rem 1.2rem;
}
.faq-ic { flex-shrink: 0; transition: transform .25s ease; }
.faq-q[aria-expanded="true"] .faq-ic { transform: rotate(45deg); }
.faq-a { padding: 0 1.2rem 1.1rem; font-size: .92rem; }
.faq-a[hidden] { display: none; }

/* ---------- Footer bottom strip (shared skeleton) ---------- */
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .8rem; padding: 1.3rem 0; font-size: .8rem;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-legal a { text-decoration: none; opacity: .72; transition: opacity .15s ease; }
.footer-legal a:hover { opacity: 1; text-decoration: underline; }
.footer-copy { opacity: .72; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid currentColor; opacity: .75; transition: opacity .15s ease, transform .15s ease;
}
.footer-social a:hover { opacity: 1; transform: translateY(-2px); }

/* ---------- Logo ---------- */
.logo-word { font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }

/* ---------- Testimonial slider controls (Model 1) ---------- */
.testi-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid currentColor; opacity: .8; transition: opacity .15s, transform .15s;
}
.testi-btn:hover { opacity: 1; transform: scale(1.06); }
.testi-dots { display: flex; gap: .45rem; align-items: center; }
.testi-dot {
  width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .3;
  transition: opacity .15s ease, transform .15s ease; padding: 0;
}
.testi-dot.is-active { opacity: 1; transform: scale(1.3); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .wa-fab-pulse { display: none; }
}
