/* Arencia Vit C — conversion landing page
   Single product, cash on delivery, mobile first (90% of traffic).
   Palette: olive-lime sampled from the tube. Background white, alternate
   sections soft tint, solid dark-olive CTA. Tajawal only (400 body, 700 head). */

/* ---------- Fonts (Tajawal only, self-hosted) ---------- */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tajawal-arabic-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tajawal-arabic-700.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --bg: #FFFFFF;
  --tint: #F4F7E6;
  --ink: #1B1B18;
  --muted: #5F6458;
  --olive: #4F6B12;   /* accent: dark olive, CTA fill + text on light */
  --lime: #C5D93D;    /* accent: lime, small highlights only (dark text) */
  --card: #FFFFFF;
  --line: #E4E8D4;

  --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;

  --radius: 12px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;

  --max: 560px;      /* single-column reading width */
  --wide: 1080px;    /* full-bleed media width */
}

/* ---------- Reset ---------- */
html {
  scroll-behavior: smooth;
  overflow-x: clip; /* safety net only; root causes fixed below */
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  text-align: right;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
  outline: 0;
  box-shadow: none;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  margin: 0 0 var(--space-2);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

p {
  margin: 0 0 var(--space-2);
}

a {
  color: var(--olive);
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.media-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding: var(--space-4) 0;
}

.section--tint {
  background: var(--tint);
}

.section__title {
  font-size: 22px;
  margin-bottom: 12px;
}

.section--tint .section__title {
  color: var(--ink);
}

.lead {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: var(--space-3);
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 10px var(--space-3);
  text-align: center;
}

.topbar__logo {
  display: inline-block;
  height: 36px;
  width: auto;
  max-width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-3) 0 var(--space-4);
}

.hero__frame {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
}

.hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero__title {
  font-size: 28px;
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

.hero__product {
  color: var(--muted);
  font-weight: 400;
  font-size: 17px;
  margin-bottom: var(--space-3);
}

/* Price tag: lime chip with dark ink (AA on lime) */
.price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  background: var(--lime);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: var(--space-2);
}

.price-tag__now {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.price-tag__was {
  font-size: 15px;
  color: #43472F;
  text-decoration: line-through;
}

.trust-line {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: var(--space-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: 14px;
  background: var(--olive);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.btn:hover { filter: brightness(1.08); }

.btn:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

.btn:disabled {
  background: #9AA383;
  cursor: not-allowed;
  filter: none;
}

/* ---------- Benefits (unnumbered rows) ---------- */
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
}

.benefits li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.benefits li:last-child {
  border-bottom: 0;
}

.benefits svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 4px;
}

.benefits span {
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Full-width media sections ---------- */
.media {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tint);
  margin-bottom: var(--space-3);
}

.media img {
  width: 100%;
  height: auto;
}

/* ---------- Disclosure (INCI + FAQ) ---------- */
.disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.disclosure__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 14px var(--space-3);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  list-style: none;
  text-decoration: none;
  color: var(--ink);
}

.disclosure__summary::-webkit-details-marker { display: none; }

.disclosure__chevron {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.disclosure[open] .disclosure__chevron {
  transform: rotate(180deg);
}

.disclosure__body {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.disclosure__body p {
  margin: 0 0 var(--space-2);
}

.disclosure__body p:last-child { margin-bottom: 0; }

/* INCI list is Latin, keep it LTR and left aligned inside the RTL page */
.inci {
  direction: ltr;
  text-align: left;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  word-break: break-word;
}

/* ---------- Order form ---------- */
.order {
  background: var(--tint);
  padding: var(--space-4) 0;
}

.order__title {
  font-size: 22px;
  margin-bottom: 12px;
}

.order__intro {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: var(--space-3);
}

.form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-3);
}

.field:last-of-type {
  margin-bottom: var(--space-3);
}

.label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.label__opt {
  font-weight: 400;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

.input--phone {
  direction: ltr;
  text-align: right;
}

textarea.input {
  min-height: 84px;
  resize: vertical;
}

.input:focus {
  outline: 2px solid var(--olive);
  outline-offset: 1px;
  border-color: var(--olive);
}

.input::placeholder { color: #8A8F80; }

.error {
  color: #B3261E;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
  min-height: 0;
}

.error:empty { display: none; }

/* Delivery type: two large tap cards */
.delivery {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 480px) {
  .delivery { grid-template-columns: 1fr 1fr; }
}

.delivery__card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 72px;
  padding: var(--space-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.delivery__card input {
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

.delivery__card input:checked {
  border-color: var(--olive);
}

.delivery__card input:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--olive);
}

.delivery__card.is-selected {
  border-color: var(--olive);
  background: #FAFCEF;
}

.delivery__fee {
  margin-right: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Quantity stepper: RTL order, minus on the right */
.qty {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  direction: rtl;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 6px;
  background: var(--card);
  width: 130px;
}

.qty__btn {
  flex: 1 1 0;
  min-width: 36px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  color: var(--olive);
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.qty__btn:disabled { color: #9AA383; cursor: not-allowed; }

.qty__value {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Note toggle */
.note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--olive);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.note-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Summary card */
.summary {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 15px;
  padding: 4px 0;
}

.summary__row--total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

/* Turnstile */
.turnstile-wrap {
  margin-bottom: var(--space-2);
}

.turnstile-wrap .error { display: block; }

/* Success / error states */
.state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
  text-align: center;
}

.state h3 {
  font-size: 20px;
  margin-bottom: var(--space-2);
}

.state p {
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.state--error { border-color: #E9C4C0; }

.state__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.state__icon--ok { background: #E7F1D6; color: var(--olive); }

.state__icon--err { background: #FBE9E7; color: #B3261E; }

/* ---------- FAQ ---------- */
.faq { margin: 0; }

.faq .disclosure { margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-4) 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer p { margin: 0; }

.footer__sub {
  margin-top: 4px !important;
  font-size: 12px;
  opacity: 0.8;
}

/* Real vs fake */
.real-fake-media {
  max-width: 420px;
  margin: 0 auto var(--space-2);
  aspect-ratio: 1086 / 1448;
}

.real-fake-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.real-fake-note {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* Plain bullet list inside disclosures */
.plain-list {
  margin: 0;
  padding-right: 18px;
  list-style: disc;
}

.plain-list li {
  margin-bottom: 6px;
}

.plain-list li:last-child { margin-bottom: 0; }

/* ---------- Sticky order bar (mobile) ---------- */
.sticky-bar {
  position: fixed;
  inset: auto 0 0 0;
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 60;
}

.sticky-bar__prices {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sticky-bar__was {
  font-size: 13px;
  color: #43472F;
  text-decoration: line-through;
}

.sticky-bar__price {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

.sticky-bar .btn {
  flex: 1 1 auto;
  min-height: 56px;
  padding: 12px 16px;
  font-size: 16px;
}

@media (max-width: 767px) {
  .sticky-bar { display: flex; }
  /* keep the footer and summary clear of the bar */
  body { padding-bottom: 92px; }
}

/* ---------- Messenger icon (only) ---------- */
.messenger-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.messenger-fab svg { width: 46px; height: 46px; }

.messenger-fab:focus-visible {
  outline: 3px solid var(--olive);
  outline-offset: 2px;
}

/* Keep the floating icon clear of the footer text on desktop */
@media (min-width: 900px) {
  .footer {
    padding-bottom: 92px;
  }
}

@media (max-width: 767px) {
  .messenger-fab {
    bottom: calc(84px + env(safe-area-inset-bottom));
    right: 12px;
    width: 52px;
    height: 52px;
  }
  .messenger-fab svg { width: 42px; height: 42px; }
}

/* ---------- Utilities ---------- */
[hidden] { display: none !important; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ================= Desktop (>= 900px) =================
   The phone view above is the approved base. Nothing below 900px changes. */

@media (min-width: 900px) {
  .wrap,
  .media-wrap {
    max-width: 1120px;
    padding-left: 24px;
    padding-right: 24px;
  }

  body { font-size: 17px; }

  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .hero__title { font-size: 40px; }
  .section__title,
  .order__title { font-size: 28px; }

  /* Hero: two columns, image ~45% */
  .hero {
    padding: 56px 0 48px;
  }
  .hero .wrap {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 48px;
    align-items: center;
  }
  .hero__frame {
    aspect-ratio: 4 / 5;
    max-height: 460px; /* keeps the hero section under ~640px tall */
    margin-bottom: 0;
    order: 0;
  }
  .hero__content { order: 1; }
  .hero .btn {
    width: 300px;
  }

  /* Benefits: row of 4 cards */
  .benefits {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .benefits li {
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    padding: 20px 18px;
  }
  .benefits li:last-child { border-bottom: 1px solid var(--line); }

  /* The two info images side by side, equal height */
  .info-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
  }
  .info-sections > * { min-width: 0; }
  .info-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
  .info-media {
    padding-left: 0;
    padding-right: 0;
  }
  #usage .media,
  #ingredients .media {
    max-width: 540px;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0;
  }
  #usage .media img,
  #ingredients .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  .info-col .disclosure {
    max-width: 540px;
    margin-top: 0;
  }

  /* Order form: centered card, name/phone and wilaya/commune in pairs */
  .order .wrap { max-width: 680px; }
  .form {
    max-width: 680px;
    margin: 0 auto;
  }
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
  .form-row > .field { min-width: 0; }
  .delivery {
    grid-template-columns: 1fr 1fr;
  }
  .delivery__card { min-width: 0; }
  .hero .wrap > * { min-width: 0; }
  .info-sections > * { min-width: 0; }

  /* FAQ centered, wider */
  #faq .wrap { max-width: 760px; }

  /* Footer centered */
  .footer .wrap { max-width: 760px; }

  /* Larger logo on desktop */
  .topbar__logo { height: 44px; }
}
