/* =========================================================================
   Forever Nails Boutique — "Sorbet drops"
   Tokens from research/design-language.md. Light default + [data-theme="dark"].
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  --ground: #FCF7F2;
  --surface: #FFFFFF;
  --ink: #2A1D2F;
  --muted: #5E4F63;
  --brand: #43284F;
  --brand-text: #43284F;
  --peach: #F4A98F;
  --mint: #A6DCCB;
  --ink-on-fill: #2A1D2F;   /* text on peach/mint — NEVER white, both themes */
  --peach-text: #A5442A;
  --on-brand: #FFFFFF;      /* text on brand/dark bands — fixed both themes */
  --accent-on-dark: #FFC2AD;/* peach-light text on always-dark bands — fixed */
  --band: #24152B;          /* always-dark header/hero/footer/CTA band */

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --gap: clamp(1rem, 3vw, 2rem);
  --shadow: 0 6px 24px rgba(42, 29, 47, 0.10);
  --shadow-sm: 0 2px 10px rgba(42, 29, 47, 0.08);

  --font-head: 'Gloock', Georgia, serif;
  --font-body: 'Figtree', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --ground: #16101A;
  --surface: #352840; /* dark card: 1.36:1 vs ground (meets >=1.35 target) */
  --ink: #F6EEF4;
  --muted: #BBAAC0;
  --brand: #6B4580;
  --brand-text: #E6C8F0;
  /* peach, mint, ink-on-fill, on-brand, accent-on-dark are fixed both themes */
  --peach-text: #FFB9A3;
  --band: #0F0914;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* ---- Reset / base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  overflow-x: hidden; /* belt-and-braces against stray overflow */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-text); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0 0 .6em; }
h3 { font-size: clamp(1.15rem, 2.6vw, 1.5rem); margin: 0 0 .4em; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(2.5rem, 7vw, 5rem); }
.center { text-align: center; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 999;
  background: var(--brand); color: var(--on-brand); padding: .6rem 1rem; border-radius: 8px;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: .72rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  max-width: 100%;
  overflow-wrap: anywhere; /* big buttons wrap instead of overflowing at 320px */
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--accent   { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--accent:hover { background: var(--brand-text); border-color: var(--brand-text); color: var(--on-brand); }
:root[data-theme="dark"] .btn--accent:hover { background: #7d51a0; border-color: #7d51a0; }

.btn--ghost    { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand); color: var(--on-brand); }

.btn--whatsapp { background: #25D366; color: #06331A; border-color: #25D366; }
.btn--whatsapp:hover { background: #1fb257; border-color: #1fb257; color: #06331A; }

.btn--fresha   { background: var(--peach); color: var(--ink-on-fill); border-color: var(--peach); }
.btn--fresha:hover { background: #ef9777; border-color: #ef9777; color: var(--ink-on-fill); }

.btn--call     { background: var(--mint); color: var(--ink-on-fill); border-color: var(--mint); }
.btn--call:hover { background: #8fd0bb; border-color: #8fd0bb; color: var(--ink-on-fill); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-row--center { justify-content: center; }

/* ---- "To confirm" chip ------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--peach); color: var(--ink-on-fill);
  font-size: .82rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px;
  border: 1px solid rgba(42,29,47,.15);
}
.chip--mint { background: var(--mint); }
.chip--note { background: transparent; border-color: var(--muted); color: var(--muted); }

.demo-note {
  font-size: .85rem; color: var(--muted); font-style: italic;
}

/* =========================================================================
   HEADER  (always-dark band)
   ========================================================================= */
.site-header {
  background: var(--band); color: var(--on-brand);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
/* BUG FIX (1): always-dark band sets light colours on everything inside */
.site-header, .site-header h1, .site-header h2, .site-header h3,
.site-header p, .site-header a, .site-header .nav-link { color: var(--on-brand); }
.site-header .chip { color: var(--ink-on-fill); } /* chips keep dark ink on fill */
/* BUG FIX (6): the header CTA is a WhatsApp button — restate its ink so the
   broad ".site-header a" white rule doesn't override it. */
.site-header .btn--whatsapp { color: #06331A; }
.site-header .btn--fresha, .site-header .btn--call { color: var(--ink-on-fill); }

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .75rem; flex-wrap: nowrap;
}
.brand {
  display: flex; flex-direction: column; text-decoration: none; min-width: 0; flex: 1 1 auto;
}
.brand__name {
  font-family: var(--font-head); font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--on-brand); line-height: 1.1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand__tag { font-size: .78rem; color: var(--accent-on-dark); } /* subtitle */

.main-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav-link {
  color: var(--on-brand); text-decoration: none; font-weight: 600;
  padding: .4rem .6rem; border-radius: 8px; font-size: .95rem; white-space: nowrap;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: rgba(255,255,255,.14); color: var(--on-brand); }
.nav-link[aria-current="page"] { color: var(--accent-on-dark); }

.header-cta { white-space: nowrap; } /* BUG FIX (3): header CTA nowrap */

.theme-toggle {
  background: rgba(255,255,255,.12); color: var(--on-brand);
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto; font-size: 1.1rem; line-height: 1;
}
.theme-toggle:hover { background: rgba(255,255,255,.22); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: rgba(255,255,255,.12); color: var(--on-brand);
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
  width: 42px; height: 42px; cursor: pointer; font-size: 1.2rem; flex: 0 0 auto;
}

/* BUG FIX (3): responsive header to kill 320px overflow */
@media (max-width: 1100px) {
  .header-cta { display: none; } /* hide header CTA <=1100px */
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--band); flex-direction: column; align-items: stretch;
    padding: .5rem clamp(1rem,4vw,2rem) 1rem; gap: .2rem;
    box-shadow: var(--shadow-sm); display: none;
  }
  .main-nav.open { display: flex; }
  .nav-link { padding: .7rem .6rem; }
}
@media (max-width: 480px) {
  .brand__tag { display: none; }  /* hide subtitle <=480px */
}

/* =========================================================================
   HERO (always-dark band)
   ========================================================================= */
.hero {
  position: relative; background: var(--band); color: var(--on-brand);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .22; z-index: 0;
}
.hero__inner { position: relative; z-index: 1; padding-block: clamp(3rem, 9vw, 6rem); }
/* BUG FIX (1): hero band sets light colours on headings/text/links/buttons/chips */
.hero, .hero h1, .hero h2, .hero h3, .hero p, .hero a, .hero li { color: var(--on-brand); }
.hero .lead { color: #EADEE8; }
.hero .accent { color: var(--accent-on-dark); }
.hero .chip { color: var(--ink-on-fill); }
.hero .btn--ghost { color: var(--on-brand); border-color: var(--on-brand); }
.hero .btn--ghost:hover { background: var(--on-brand); color: var(--band); }
/* BUG FIX (6): the broad ".hero a" rule above would force white onto coloured
   buttons too — restate their correct ink so WhatsApp/Fresha/Call stay legible. */
.hero .btn--accent { color: var(--on-brand); }
.hero .btn--whatsapp { color: #06331A; }
.hero .btn--fresha, .hero .btn--call { color: var(--ink-on-fill); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.5rem; }
.hero__stat { display: flex; flex-direction: column; min-width: 0; }
.hero__stat b { font-family: var(--font-head); font-size: 1.6rem; color: var(--accent-on-dark); }
.hero__stat span { font-size: .85rem; color: #EADEE8; }

/* =========================================================================
   CARDS / GRIDS
   ========================================================================= */
.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; } /* BUG FIX (3): grid children min-width:0 */
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
  border: 1px solid rgba(42,29,47,.06);
}
.card h3 { color: var(--ink); }
.card p { color: var(--muted); }
.card__media { border-radius: var(--radius); overflow: hidden; margin: -1.5rem -1.5rem 1.25rem; }
.card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.price { font-family: var(--font-head); color: var(--brand-text); font-size: 1.25rem; }
.dur { color: var(--muted); font-size: .9rem; }

/* =========================================================================
   DARK BAND (reusable CTA/section) + LIGHT CARDS INSIDE IT
   ========================================================================= */
.band {
  background: var(--band); color: var(--on-brand);
}
/* BUG FIX (1): dark band covers headings, text, links, buttons, chips */
.band, .band h1, .band h2, .band h3, .band p, .band a, .band li { color: var(--on-brand); }
.band .lead { color: #EADEE8; }
.band .accent { color: var(--accent-on-dark); }
.band .chip { color: var(--ink-on-fill); }
.band .btn--ghost { color: var(--on-brand); border-color: var(--on-brand); }
.band .btn--ghost:hover { background: var(--on-brand); color: var(--band); }
/* BUG FIX (6): restate coloured-button ink so the broad ".band a" rule
   doesn't force white text onto WhatsApp/Fresha/Call buttons. */
.band .btn--accent { color: var(--on-brand); }
.band .btn--whatsapp { color: #06331A; }
.band .btn--fresha, .band .btn--call { color: var(--ink-on-fill); }
/* BUG FIX (2): a light card inside a dark band must restate its own ink */
.band .card, .band .card h3, .band .card p { color: var(--ink); }
.band .card .price { color: var(--brand-text); }
.band .card p { color: var(--muted); }

/* location strip */
.loc-strip { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap); align-items: center; }
.loc-strip > * { min-width: 0; }
@media (max-width: 760px) { .loc-strip { grid-template-columns: 1fr; } }
.nap { overflow-wrap: anywhere; } /* BUG FIX (3): wrap long NAP text */
.nap dt { font-weight: 700; color: var(--ink); }
.nap dd { margin: 0 0 .75rem; color: var(--muted); }

/* =========================================================================
   STACK YOUR VISIT (signature feature)
   ========================================================================= */
.stack { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); align-items: start; }
.stack > * { min-width: 0; }
@media (max-width: 920px) { .stack { grid-template-columns: 1fr; } }

.treat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.treat-grid > * { min-width: 0; }
@media (max-width: 520px) { .treat-grid { grid-template-columns: 1fr; } }

.treat {
  display: flex; flex-direction: column; gap: .25rem; text-align: left;
  background: var(--surface); color: var(--ink);
  border: 2px solid rgba(42,29,47,.12); border-radius: var(--radius);
  padding: .9rem 1rem; cursor: pointer; font-family: var(--font-body);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  width: 100%;
}
.treat:hover { border-color: var(--brand); }
.treat[aria-pressed="true"] {
  border-color: var(--brand); background: color-mix(in srgb, var(--mint) 30%, var(--surface));
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .treat[aria-pressed="true"] {
  background: color-mix(in srgb, var(--brand) 30%, var(--surface));
}
.treat__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.treat__name { font-weight: 700; color: var(--ink); }
.treat__check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--brand);
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem; color: transparent;
}
.treat[aria-pressed="true"] .treat__check { background: var(--brand); color: var(--on-brand); }
.treat__meta { color: var(--muted); font-size: .9rem; }
.treat__ask { color: var(--peach-text); font-size: .85rem; font-weight: 600; }

.start-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.start-chip {
  background: var(--surface); color: var(--ink); border: 2px solid rgba(42,29,47,.12);
  border-radius: 999px; padding: .5rem 1rem; cursor: pointer; font-weight: 600; font-family: var(--font-body);
}
.start-chip[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.field-label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.date-input {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius);
  border: 2px solid rgba(42,29,47,.15); background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem;
}

/* The ALWAYS-DARK visit-summary panel — bug fix (1)+(6) applied here too */
.summary-panel {
  position: sticky; top: 84px;
  background: var(--band); color: var(--on-brand);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
}
.summary-panel, .summary-panel h2, .summary-panel h3, .summary-panel p,
.summary-panel a, .summary-panel li, .summary-panel span, .summary-panel strong { color: var(--on-brand); }
.summary-panel .accent { color: var(--accent-on-dark); }
.summary-panel .chip { color: var(--ink-on-fill); } /* chip keeps dark ink on peach/mint */
.summary-panel .total-time { font-family: var(--font-head); font-size: 2rem; color: var(--on-brand); }
.summary-panel .total-price { font-family: var(--font-head); font-size: 1.6rem; color: var(--accent-on-dark); }
.summary-panel .finish { color: #EADEE8; }
.summary-panel .warn {
  background: var(--peach); color: var(--ink-on-fill); /* dark ink on peach, never white */
  border-radius: var(--radius); padding: .6rem .8rem; font-weight: 600; font-size: .9rem;
}
.summary-panel .muted-note { color: #D9CBD6; font-size: .82rem; }
/* buttons inside dark panel keep their explicit fills + ink (bug fix 6) */
.summary-panel .btn--ghost { color: var(--on-brand); border-color: var(--on-brand); }
.summary-panel .btn--ghost:hover { background: var(--on-brand); color: var(--band); }
.summary-panel .btn--whatsapp { color: #06331A; }
.summary-panel .btn--fresha { color: var(--ink-on-fill); }
.summary-panel .btn--call { color: var(--ink-on-fill); }
.summary-panel .summary-selected { list-style: none; padding: 0; margin: .5rem 0; }
.summary-panel .summary-selected li { padding: .2rem 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.summary-panel .empty { color: #D9CBD6; }

/* =========================================================================
   REVIEWS
   ========================================================================= */
.stat-big {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg);
  padding: 1.75rem 1rem; box-shadow: var(--shadow); min-width: 0;
}
.stat-big b { font-family: var(--font-head); font-size: 2.6rem; color: var(--brand-text); line-height: 1; }
.stat-big .stars { color: var(--peach-text); font-size: 1.3rem; letter-spacing: 2px; }
.stat-big span { color: var(--muted); font-size: .95rem; margin-top: .4rem; }

/* =========================================================================
   MAP
   ========================================================================= */
.map-embed {
  width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); background: var(--surface);
}

/* =========================================================================
   FOOTER (always-dark band)
   ========================================================================= */
.site-footer {
  background: var(--band); color: var(--on-brand); padding-block: clamp(2.5rem,6vw,4rem);
}
/* BUG FIX (1): footer covers headings/text/links/chips */
.site-footer, .site-footer h2, .site-footer h3, .site-footer p, .site-footer li { color: var(--on-brand); }
/* generic footer link colour — but must NOT override button text (bug fix 6) */
.site-footer a:not(.btn) { color: var(--accent-on-dark); }
.site-footer a:not(.btn):hover { color: var(--on-brand); }
.site-footer .chip { color: var(--ink-on-fill); }
/* buttons in footer keep their explicit ink (bug fix 6) */
.site-footer .btn--whatsapp { color: #06331A; }
.site-footer .btn--fresha { color: var(--ink-on-fill); }
.site-footer .btn--call { color: var(--ink-on-fill); }
.site-footer .btn--ghost { color: var(--on-brand); border-color: var(--on-brand); }
.site-footer .btn--ghost:hover { background: var(--on-brand); color: var(--band); }

.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.footer-grid > * { min-width: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15);
  font-size: .85rem; color: #D9CBD6; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}
.footer-bottom a:not(.btn) { color: var(--accent-on-dark); }

/* small helpers */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack-sm > * + * { margin-top: .75rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .btn:hover { transform: none; }
}

/* QA fixes: text on always-dark bands/footer (light theme) */
.band .nap dt, .site-footer .nap dt { color: var(--on-brand); }
.band .nap dd, .site-footer .nap dd { color: #EADEE8; }
.band .demo-note, .site-footer .demo-note, .site-footer .footer-bottom span { color: #EADEE8; }
.band .chip--note, .site-footer .chip--note { background: transparent; color: var(--accent-on-dark); border-color: var(--accent-on-dark); }
