/* ============================================================================
 * Cool Hijab SG — Find Your Cool Hijab Colour
 * Premium, feminine, mobile-first styling.
 * ========================================================================== */

:root {
  /* -------------------------------------------------------------------
   * Pulled directly from coolhijabsg.com's live Elementor Kit (Kit #6)
   * so the app reads as part of the same brand, not a separate product.
   * ----------------------------------------------------------------- */
  --ivory: #FAF4EC;          /* site "Cream (Page)" */
  --warm-white: #FFFDF9;     /* site "Paper (Cards)" */
  --sand: #F1E8DC;           /* site "Sand (Footer)" */
  --beige: #E3D3BC;
  --taupe: #B6A796;
  --sage: #A4AFA5;           /* site "Sage Soft" */
  --sage-mist: #E6EBE5;      /* site "Sage Mist" */
  --sage-deep: #3F5E53;      /* site "Sage (Primary)" */
  --sage-darker: #2F4940;    /* site "Sage Dark (Hover)" */
  --dusty-rose: #D9B79E;     /* lightened tint of the site accent, for gradients */
  --dusty-rose-deep: #C08A70;/* site "Dusty Rose (Accent)" — exact brand accent */
  --rose-text: #8F5A43;      /* site "Rose Text (Eyebrows)" */
  --champagne: #F3E3DA;      /* close to site "Blush" — used for warm highlights */
  --powder-blue: #DCE7EE;    /* site "Powder Blue" */
  --charcoal: #1F2D28;       /* site "Ink (Body Text)" */
  --ink: #1F2D28;            /* site "Ink (Body Text)" */
  --muted: #56655F;          /* site "Muted Text" */
  --line: rgba(31, 45, 40, 0.12);
  --shadow: 0 10px 30px rgba(31, 45, 40, 0.10);
  --shadow-soft: 0 4px 14px rgba(31, 45, 40, 0.08);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Marcellus", Georgia, serif;   /* site heading font */
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* site body font */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Root type scale. Every font-size in this file is in rem, so this one value
 * sets the reading size for the entire app and the breakpoints further down
 * step it up on bigger screens. It's a percentage rather than a px value on
 * purpose: it scales with whatever base size the visitor has set in their own
 * browser instead of overriding their accessibility preference. 106.25% is
 * 17px against a default 16px browser setting. */
html { font-size: 106.25%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--dusty-rose-deep); outline-offset: 2px; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--ivory);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}
.brand-logo { height: 32px; width: auto; display: block; }
.brand-subtitle {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--dusty-rose-deep);
  border-left: 1.5px solid var(--line);
  padding-left: 10px;
  white-space: nowrap;
}
.icon-btn {
  border: none;
  background: rgba(31,45,40,0.06);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--charcoal);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(31,45,40,0.12); }

/* ---------- Install banner (PWA) ---------- */
.install-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 16px 10px;
  padding: 10px 12px;
  background: var(--sage-mist);
  border: 1px solid rgba(63, 94, 83, 0.18);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.25s ease;
}
.install-banner.show { display: flex; }
.install-banner-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; }
.install-banner .txt {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--charcoal);
}
.install-banner .install-cta {
  flex-shrink: 0;
  border: none;
  background: var(--sage-deep);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.install-banner .install-cta:hover { background: var(--sage-darker); }
.install-banner .install-close {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.install-banner .install-close:hover { color: var(--charcoal); }
@media (max-width: 380px) {
  .install-banner { flex-wrap: wrap; }
  .install-banner .txt { flex-basis: 100%; order: -1; margin-bottom: 2px; }
}

/* ---------- Screens ---------- */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  /* The bottom clearance that used to live here now sits on .site-footer,
     which follows every screen — otherwise the footer would be stranded
     below a 96px gap on every page. */
  padding: 8px 22px 26px;
  animation: fadeSlideIn 0.35s ease both;
}
.screen.active { display: flex; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  color: var(--rose-text);
  font-weight: 600;
  margin: 0 0 10px;
}
h1.display, h2.display {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.18;
  margin: 0 0 12px;
}
h1.display { font-size: 2.25rem; }
h2.display { font-size: 1.7rem; }
.lead { color: var(--muted); font-size: 1.1rem; line-height: 1.6; margin: 0 0 22px; }
.fine-print { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 22px;
  border-radius: 999px;
  border: none;
  font-size: 1.06rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--sage-deep);
  color: #fff;
  box-shadow: 0 10px 24px rgba(63, 94, 83, 0.30);
}
.btn-primary:hover { background: var(--sage-darker); box-shadow: 0 12px 28px rgba(63, 94, 83, 0.38); }
.btn-secondary {
  background: var(--warm-white);
  color: var(--charcoal);
  border: 1.5px solid var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--dusty-rose-deep);
  padding: 10px 14px;
  width: auto;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-ghost:focus-visible { outline: none; text-decoration: underline; }
.btn-outline-shop {
  background: transparent;
  border: 1.5px solid var(--charcoal);
  color: var(--charcoal);
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.btn-outline-shop:hover { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.btn-sm { width: auto; padding: 10px 18px; font-size: 0.95rem; }

/* ---------- Home screen ---------- */
.hero-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--sand) 0%, var(--champagne) 55%, var(--dusty-rose) 130%);
  padding: 34px 24px 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.hero-swatch-row { display: flex; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.hero-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.8); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 14px;
}

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 22px; }
.why-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-soft);
}
.why-card .why-emoji { font-size: 1.55rem; margin-bottom: 8px; display: block; }
.why-card h3 { margin: 0 0 5px; font-size: 1.02rem; color: var(--charcoal); }
.why-card p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.45; }

/* ---------- Photo capture ---------- */
.capture-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  background: var(--charcoal);
  overflow: hidden;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.capture-frame video, .capture-frame img.preview {
  width: 100%; height: 100%; object-fit: cover;
}
.capture-frame img.preview {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.face-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.face-guide .oval {
  width: 62%;
  height: 74%;
  border: 2.5px dashed rgba(255,255,255,0.85);
  border-radius: 50% / 42%;
}
.capture-placeholder { color: rgba(255,255,255,0.75); text-align: center; padding: 20px; font-size: 1rem; line-height: 1.5; }
.capture-placeholder svg { margin-bottom: 10px; }

.tips-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.tips-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.45;
}
.tips-list .check {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.capture-actions { display: grid; gap: 10px; }
.capture-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Take Photo / Upload Photo sit in a tight 2-up row on phones. The default
 * .btn padding + font-size was too wide for that column, so "Take Photo" and
 * "Upload Photo" wrapped onto two lines each — at different line counts,
 * which threw the pair's height and icon alignment out of balance. Sizing
 * this pair down keeps both labels on one line so the two buttons match. */
.capture-actions .row .btn {
  padding: 14px 10px;
  font-size: 0.92rem;
  gap: 6px;
  white-space: nowrap;
}

/* ---------- Analysing screen ---------- */
.analysing-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.pulse-ring {
  width: 132px; height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--champagne), var(--dusty-rose) 70%);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  animation: pulseGrow 1.8s ease-in-out infinite;
  box-shadow: 0 12px 30px rgba(192,136,131,0.35);
}
@keyframes pulseGrow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.progress-track { width: 100%; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 26px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--dusty-rose-deep), var(--sage-deep)); transition: width 0.5s ease; }
.step-list { text-align: left; width: 100%; display: grid; gap: 15px; }
.step-list .step { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 1.04rem; transition: color 0.3s ease; }
.step-list .step.done { color: var(--ink); }
.step-list .step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; flex-shrink: 0; color: transparent;
  transition: all 0.3s ease;
}
.step-list .step.done .dot { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.step-list .step.active .dot { border-color: var(--dusty-rose-deep); }

/* ---------- Results / profile ---------- */
.profile-card {
  background: linear-gradient(160deg, var(--sage-deep), var(--sage-darker));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  margin-bottom: 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.profile-card .eyebrow { color: var(--champagne); }
.profile-card h2 { color: #fff; margin-bottom: 8px; }
.profile-pills { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}
.profile-note { color: rgba(255,255,255,0.72); font-size: 0.88rem; margin-top: 14px; line-height: 1.55; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.28rem; }
.section-title .link { font-size: 0.92rem; color: var(--dusty-rose-deep); font-weight: 600; text-decoration: none; white-space: nowrap; }

.swatch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.swatch {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px;
}
.swatch .chip {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(54,47,43,0.14);
  border: 3px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.swatch:hover .chip { transform: translateY(-2px); }
.swatch.selected .chip { border-color: var(--sage-deep); transform: scale(1.05); }
.swatch .label { font-size: 0.9rem; color: var(--ink); font-weight: 600; text-align: center; line-height: 1.3; }

.tab-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.tab-row::-webkit-scrollbar { display: none; }
.tab-chip {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--warm-white);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab-chip.active { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }

.colour-detail {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}
.colour-detail .big-chip { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.12); }
.colour-detail h3 { margin: 0 0 5px; font-size: 1.12rem; }
.colour-detail p { margin: 0; font-size: 0.95rem; color: var(--muted); line-height: 1.5; }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.product-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.product-card .thumb-wrap { position: relative; aspect-ratio: 4 / 5; background: var(--sand); overflow: hidden; }
.product-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .thumb-wrap img { transform: scale(1.05); }
.product-card .colour-dot { position: absolute; bottom: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.product-card .body { padding: 13px 12px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .pname { font-size: 0.98rem; font-weight: 600; color: var(--charcoal); line-height: 1.35; }
.product-card .pcolour { font-size: 0.88rem; color: var(--muted); }
.product-card .pprice { font-size: 1.02rem; font-weight: 700; color: var(--dusty-rose-deep); margin-bottom: 2px; }
/* The card column is narrow on a phone, so this one button gets tighter side
 * padding than the standard shop button — the label stays full-size and still
 * fits on a single line in a two-up grid. */
.product-card .btn-outline-shop { padding: 12px 8px; font-size: 0.92rem; }

.list-card {
  display: flex;
  gap: 14px;
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
  align-items: center;
}
.list-card img { width: 82px; height: 102px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.list-card .info { flex: 1; min-width: 0; }
.list-card .info h4 { margin: 0 0 5px; font-size: 1.02rem; }
.list-card .info .desc { font-size: 0.9rem; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }

/* ---------- Explore ---------- */
.explore-group { margin-bottom: 26px; }
.explore-group h3 { font-size: 1.08rem; margin: 0 0 12px; color: var(--charcoal); }

/* ---------- Back-to-store footer ----------
 * The Colour Finder is a side door into the shop, so every screen ends with a
 * way back to the full catalogue. It carries the bottom clearance for the
 * sticky mobile nav (see .screen above). Opens in a new tab like every other
 * outbound link here, so an unsaved colour result is never lost by leaving. */
.site-footer {
  margin: 0 22px;
  padding: 24px 0 calc(96px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer-note { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.site-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1.5px solid var(--dusty-rose-deep);
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-footer-link:hover { color: var(--dusty-rose-deep); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: sticky;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  background: rgba(251,247,239,0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 10px 4px calc(10px + var(--safe-bottom));
  z-index: 20;
}
.nav-item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 0.76rem; font-weight: 600;
  padding: 4px 4px;
  flex: 1;
  white-space: nowrap;
}
.nav-item.active { color: var(--dusty-rose-deep); }
.nav-item svg { width: 24px; height: 24px; }

/* ---------- Sticky CTA ---------- */
.sticky-cta {
  position: sticky;
  bottom: calc(70px + var(--safe-bottom));
  padding: 10px 0 4px;
  background: linear-gradient(180deg, rgba(251,247,239,0) 0%, var(--ivory) 40%);
  z-index: 15;
}

/* ---------- Modal / sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(42,37,33,0.55);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.overlay.active { display: flex; }
.sheet {
  background: var(--ivory);
  width: 100%; max-width: 480px;
  border-radius: 26px 26px 0 0;
  padding: 22px 22px calc(26px + var(--safe-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: sheetUp 0.3s ease both;
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: var(--line); border-radius: 999px; margin: 0 auto 16px; }
.sheet .close-row { display: flex; justify-content: flex-end; margin-bottom: -6px; }

.consent-box {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 14px 0 20px;
  box-shadow: var(--shadow-soft);
}
.consent-box h4 { margin: 0 0 9px; font-size: 1rem; }
.consent-box ul { margin: 0; padding-left: 20px; }
.consent-box li { font-size: 0.92rem; color: var(--muted); margin-bottom: 7px; line-height: 1.5; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; }
.check-row input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--dusty-rose-deep); flex-shrink: 0; }
.check-row label { font-size: 0.94rem; color: var(--ink); line-height: 1.45; }

.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 8px; border-radius: var(--radius-sm);
  background: var(--warm-white); border: 1px solid var(--line);
  cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--ink);
}

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px);
  background: var(--sage-darker); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-size: 0.95rem; opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 60;
  max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty-note { text-align: center; color: var(--muted); font-size: 1rem; padding: 30px 10px; line-height: 1.55; }

.privacy-link-row { text-align: center; margin-top: 6px; }
.privacy-link-row button { background: none; border: none; color: var(--muted); text-decoration: underline; font-size: 0.88rem; cursor: pointer; }

/* ---------- Small phones ----------
 * The header lockup (logo + "Colour Finder" + info button) is the one row that
 * can't wrap, so it gets a little relief on narrow handsets. */
@media (max-width: 380px) {
  .brand-logo { height: 28px; }
  .brand-subtitle { font-size: 0.64rem; padding-left: 8px; }
  .screen { padding-left: 18px; padding-right: 18px; }
  .site-footer { margin-left: 18px; margin-right: 18px; }
  .site-footer-link { font-size: 0.94rem; }
}

@media (min-width: 480px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
 * ADAPTIVE LAYOUT — tablet & desktop
 * Placed at the END of the file on purpose: at equal specificity, CSS gives
 * the win to whichever rule comes later in the stylesheet, regardless of
 * which one sits inside a @media block. Putting these overrides before the
 * component rules they target (as an earlier version of this file did)
 * meant the unconditional mobile rules silently won at every width, which
 * is why the desktop layout wasn't actually taking effect. Keep everything
 * below this comment last.
 * ========================================================================== */

/* ---------- Tablet (~640px+): more breathing room, a bit more grid ---------- */
@media (min-width: 640px) {
  html { font-size: 112.5%; }   /* 18px */
  .app-shell { max-width: 640px; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .swatch-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .capture-frame { max-width: 420px; margin-left: auto; margin-right: auto; }
  .hero-card { padding: 40px 34px 32px; }
}

/* ---------- Desktop (~1024px+): a full-width site header + a wide content canvas ----------
 * The header and nav become genuine full-bleed bars (like coolhijabsg.com's own header),
 * and the page background is continuous — no boxed shell, no shadow, no visible margin
 * gutters. Only the page *content* is constrained to a comfortable reading width, the way
 * any real site's content column is, while the chrome around it runs edge to edge. */
@media (min-width: 1024px) {
  /* One step up on the root scale carries every rem-based size in the file
   * with it, so the type hierarchy stays proportional and only a handful of
   * headings below need a genuinely different ratio on a wide screen. */
  html { font-size: 118.75%; }  /* 19px */

  body { background: var(--ivory); }
  .app-shell {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* Full-bleed header. Between 1024px and 1280px the logo and the five-item
     menu together are wider than the window, so they stay on two stacked rows
     here — but the brand row comes FIRST, which is the natural reading order
     (the nav used to be pulled above it with order:-1, which left the logo
     stranded on its own half-empty second row). Past 1280px there's room for
     both on one row, and the block further down collapses them. */
  .topbar {
    /* The shell is a flex column whose last child is the nav, so both header
       rows are ordered explicitly: brand first, menu second, screens after. */
    order: -2;
    background: var(--warm-white);
    padding: 18px clamp(24px, 4vw, 64px) 10px;
  }
  .brand-logo { height: 38px; }
  .brand-subtitle { font-size: 0.72rem; }

  .bottom-nav {
    position: static;
    order: -1;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 clamp(24px, 4vw, 64px) 14px;
    background: var(--warm-white);
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    justify-content: center;
    gap: 6px;
  }
  .nav-item {
    flex: 0 1 auto;
    flex-direction: row;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 0.92rem;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item:hover { background: rgba(31,45,40,0.05); }
  .nav-item.active { background: var(--sage-deep); color: #fff; }

  /* Content canvas: a comfortable, wide max-width centred under the full-bleed
     header, with generous responsive gutters instead of a fixed narrow column. */
  .screen {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 36px clamp(24px, 4vw, 64px) 72px;
  }
  .sticky-cta { position: static; background: none; padding: 4px 0 0; }

  /* The nav isn't sticky at this width, so the footer drops the mobile
     clearance and lines up with the content column instead. */
  .site-footer {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px clamp(24px, 4vw, 64px) 64px;
  }

  h1.display { font-size: 2.9rem; }
  h2.display { font-size: 2rem; }
  .lead { font-size: 1.16rem; max-width: 660px; }
  .section-title h2 { font-size: 1.35rem; }
  .colour-detail h3 { font-size: 1.2rem; }

  /* The hero card holds a chip, a headline, a paragraph and the swatch row as
     direct children, with no image column beside them — so it stays a stacked
     block here and only gains padding and a comfortable measure. (An earlier
     version made it a flex row, which laid all four out side by side and
     squeezed the "60 seconds" chip into a blob.) */
  .hero-card { padding: 56px 56px 48px; }
  .hero-card .lead { max-width: 620px; margin-bottom: 0; }
  .hero-swatch-row { margin-top: 26px; }

  .why-grid { grid-template-columns: repeat(4, 1fr); }
  .swatch-grid { grid-template-columns: repeat(6, 1fr); }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  /* Without a cap the chips inflate to fill their column on a wide screen,
   * which dwarfs the colour name underneath and makes the whole grid read as
   * bigger circles with smaller text. Capping keeps the two in proportion. */
  .swatch .chip { max-width: 124px; }
  /* Room returns in a wide grid, so the shop button goes back to normal padding. */
  .product-card .btn-outline-shop { padding: 12px 14px; font-size: 0.95rem; }

  /* The capture "canvas": cap it to a sane, phone-photo-shaped size and centre
     it, instead of letting aspect-ratio blow it up to fill a wide column. */
  .capture-frame { max-width: 360px; }
  .tips-list { max-width: 440px; margin-left: auto; margin-right: auto; }
  .capture-actions { max-width: 440px; margin-left: auto; margin-right: auto; }

  .analysing-wrap { max-width: 440px; margin: 0 auto; }

  /* Results / explore: let the colour detail sit in a comfortable reading
     width instead of stretching the full content canvas. */
  .colour-detail { max-width: 760px; }
}

/* ---------- Wide desktop (~1280px+): collapse the header into ONE row ----------
 * Logo far left, menu across the middle, info icon far right — the same
 * arrangement coolhijabsg.com's own desktop header uses. The shell turns into a
 * grid so the brand block and the nav sit side by side in that row while the
 * page content underneath still spans the full width. This waits until 1280px
 * because below that the logo and the five menu items can't both fit on a line
 * without overflowing the window. */
@media (min-width: 1280px) {
  .app-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "brand nav"
      "main  main"
      "foot  foot";
  }
  .site-footer { grid-area: foot; }

  .topbar {
    grid-area: brand;
    align-items: center;
    min-height: 76px;
    padding: 12px 0 12px clamp(24px, 4vw, 64px);
    border-bottom: 1px solid var(--line);
  }
  /* The info button lives inside the brand block in the markup, so on a single
     row it's pinned to the far right of the header rather than trailing the
     logo. .app-shell is the positioned ancestor it anchors to. */
  .topbar .icon-btn {
    position: absolute;
    top: 18px;
    right: clamp(24px, 4vw, 64px);
  }

  .bottom-nav {
    grid-area: nav;
    min-height: 76px;
    align-items: center;
    /* The extra right padding reserves room for the pinned info button so the
       menu can never slide underneath it. */
    padding: 12px calc(clamp(24px, 4vw, 64px) + 56px) 12px 0;
  }

  .screen { grid-area: main; }
}

@media (min-width: 1400px) {
  html { font-size: 125%; }     /* 20px */
  .screen, .site-footer { max-width: 1320px; }
}

/* ============================================================
 * ABOUT YOU (optional demographics) SCREEN
 * ============================================================ */
.about-block { margin-top: 22px; }
.about-label {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0 0 10px;
}
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-chip {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--warm-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice-chip:hover { border-color: var(--sage); }
.choice-chip:active { transform: scale(0.97); }
.choice-chip.selected {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .choice-chip { transition: none; }
  .choice-chip:active { transform: none; }
}

/* ============================================================
 * PHOTO ALIGNMENT CONTROLS (capture screen)
 * ============================================================ */
.align-controls { margin: -6px 0 18px; }
.align-hint {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.45;
}
.align-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.align-zoom-ico {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sage-deep);
  width: 18px;
  text-align: center;
  flex: 0 0 auto;
}
.align-zoom input[type="range"] {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: var(--sage-mist);
  outline: none;
}
.align-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage-deep);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.align-zoom input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage-deep);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
/* While aligning, the oval guide sits above the draggable photo. */
.capture-frame .face-guide { z-index: 2; }

/* Zoom slider: vertical, on the right edge of the photo frame (away from the
 * page-scroll area under the photo). */
.zoom-rail {
  position: absolute;
  right: 6px;
  top: 14%;
  bottom: 14%;
  width: 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  touch-action: none;
}
.zoom-rail .align-zoom-ico { width: auto; line-height: 1; font-size: 0.95rem; }
.zoom-rail input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 4px;
  min-height: 0;
  height: 100%;
  margin: 0;
  border-radius: 999px;
  background: var(--sage-mist);
  outline: none;
  touch-action: none;
}
.zoom-rail input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage-deep);
  border: 2px solid #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.zoom-rail input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage-deep);
  border: 2px solid #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
/* === AI try-on (preview sheet) === */
.ai-panel { margin: 2px 0 12px; }
.ai-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; line-height: 1.45; margin: 0 0 12px; cursor: pointer; }
.ai-consent input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: #3F5E53; }
.ai-note { font-size: 0.76rem; opacity: 0.75; text-align: center; margin: 8px 0 0; }
.ai-msg { font-size: 0.82rem; color: #8F5A43; text-align: center; margin: 10px 0 0; }
.ai-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(31, 45, 40, 0.5); color: #fff; font-size: 0.9rem; text-align: center; padding: 16px; }
.ai-spinner { width: 38px; height: 38px; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: chsgAiSpin 0.9s linear infinite; }
@keyframes chsgAiSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spinner { animation-duration: 2.4s; } }
.ai-badge { position: absolute; top: 10px; left: 10px; background: rgba(255, 253, 249, 0.92); color: #1F2D28; font-size: 0.72rem; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.03em; }
/* === AI try-on cross-fade === */
.ai-result-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; z-index: 1; }
.ai-result-img.in { opacity: 1; }
.ai-loading { transition: opacity 0.5s ease; z-index: 2; }
.ai-loading.out { opacity: 0; }
.ai-badge { z-index: 3; transition: opacity 0.3s ease; }
.ai-badge.out { opacity: 0; }
.fade-in { animation: chsgFadeIn 0.5s ease both; }
@keyframes chsgFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ai-result-img, .ai-loading, .ai-badge { transition: none; }
  .fade-in { animation: none; }
}