/* ============================================================
   NAVAM — PAGE COMPONENTS
   Shop, product, cart, checkout, confirmation. Everything here obeys
   the same two rules the design system is built on: hairline borders
   on light surfaces, value lift on dark ones, and pill geometry for
   anything interactive.
   ============================================================ */

/* ---------- Solid nav for pages with no hero behind it ---------- */
.nav--solid {
  position: sticky;
  background: var(--ink-900);
  border-bottom: var(--hairline-dark);
}
.nav--solid.is-stuck { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Pages without a hero need the content pushed clear of the fixed nav. */
.page-top { padding-top: var(--space-32); }

/* ---------- Breadcrumb ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8);
  font-size: var(--text-small); color: var(--ink-500);
  margin-bottom: var(--space-20);
}
.crumbs a:hover { color: var(--ink-800); }
.crumbs span[aria-current] { color: var(--ink-800); }
.crumbs li { list-style: none; display: flex; align-items: center; gap: var(--space-8); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; color: var(--ink-300); }

.page-head { margin-bottom: var(--space-32); }
.page-head h1 { font-size: var(--text-h1); margin-bottom: var(--space-8); }

/* ---------- Shop layout: filter rail + grid ---------- */
.shop-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-40);
  align-items: start;
}
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static !important; }
}
.filters { position: sticky; top: 96px; display: grid; gap: var(--space-28); }
.filter-group { display: grid; gap: var(--space-12); }
.filter-group h3 {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  font-weight: var(--wt-medium);
  color: var(--ink-500);
  padding-bottom: var(--space-8);
  border-bottom: var(--hairline);
}
.filter-opt {
  display: flex; align-items: center; gap: var(--space-12);
  font-size: var(--text-body); cursor: pointer;
  min-height: 44px;                       /* the whole row is the target */
}
.filter-opt input { accent-color: var(--forest); width: 18px; height: 18px; margin: 0; flex: none; }
.filter-opt .count { margin-left: auto; font-size: var(--text-caption); color: var(--ink-500); }
.filter-opt:has(input:disabled) { color: var(--ink-400); cursor: not-allowed; }

.shop-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-16);
  padding-bottom: var(--space-20); margin-bottom: var(--space-24);
  border-bottom: var(--hairline);
}
.shop-count { font-size: var(--text-small); color: var(--ink-500); }

/* Wrapping alone strands the sort control on its own right-aligned row.
   An explicit two-row grid keeps the two actions paired on the first row
   and drops the count underneath, where it belongs. */
@media (max-width: 900px) {
  .shop-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-12) var(--space-12);
    align-items: center;
  }
  .shop-bar .select { margin-left: 0; width: 100%; }
  .shop-count { grid-column: 1 / -1; order: 2; }
}
.select {
  margin-left: auto;
  border: var(--hairline); background: var(--paper);
  border-radius: var(--radius-control);
  padding: 11px 16px; min-height: 44px; font-size: var(--text-small); cursor: pointer;
}

/* ---------- Quantity stepper ---------- */
.qty {
  display: inline-flex; align-items: center;
  border: var(--hairline); border-radius: var(--radius-control);
  background: var(--paper); overflow: hidden;
}
.qty button {
  width: 44px; height: 44px;              /* full touch target */
  background: none; border: 0; cursor: pointer;
  color: var(--ink-600); font-size: 1.15rem; line-height: 1;
  transition: background var(--duration) var(--ease);
}
.qty button:hover:not(:disabled) { background: var(--ink-100); color: var(--ink-950); }
.qty button:disabled { color: var(--ink-300); cursor: not-allowed; }
.qty input {
  width: 44px; height: 44px; text-align: center; border: 0; background: none;
  font-size: var(--text-body); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Cart lines ---------- */
.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0,1fr) auto;
  gap: var(--space-20);
  padding: var(--space-24) 0;
  border-bottom: var(--hairline);
  align-items: start;
}
.cart-line:first-child { border-top: var(--hairline); }
.cart-thumb {
  width: 96px; aspect-ratio: 1; border-radius: var(--radius-badge);
  overflow: hidden; background: var(--ink-100); border: var(--hairline);
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: grid; gap: 6px; min-width: 0; }
.cart-info h3 { font-size: var(--text-body-lg); }
.cart-meta { font-size: var(--text-small); color: var(--ink-500); }
.cart-line-actions { display: flex; align-items: center; gap: var(--space-16); margin-top: var(--space-8); flex-wrap: wrap; }
/* Inline text actions ("Remove", "Save for later"). Padded to a real
   touch height without visually becoming buttons — the negative inline
   margin keeps them optically aligned with the text around them. */
.link-quiet {
  font-size: var(--text-small); color: var(--ink-500);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  background: none; border: 0;
  padding: 12px 6px; margin-inline: -6px;
  min-height: 44px;
}
.link-quiet:hover { color: var(--chilli); }
.cart-line-price { text-align: right; white-space: nowrap; }
.cart-line-price .price { font-size: var(--text-body-lg); }
.cart-line-was { font-size: var(--text-small); color: var(--ink-400); text-decoration: line-through; display: block; }

@media (max-width: 560px) {
  .cart-line { grid-template-columns: 72px minmax(0,1fr); }
  .cart-thumb { width: 72px; }
  .cart-line-price { grid-column: 2; text-align: left; }
}

/* ---------- Free-shipping progress ---------- */
.progress-wrap { margin-bottom: var(--space-24); }
.progress {
  height: 6px; border-radius: 999px; background: var(--ink-200);
  overflow: hidden; margin-top: var(--space-8);
}
.progress-bar { height: 100%; background: var(--forest); border-radius: 999px; transition: width 400ms var(--ease); }
.progress-label { font-size: var(--text-small); color: var(--ink-600); }
.progress-label b { color: var(--forest); font-weight: var(--wt-medium); }

/* ---------- Order summary panel ---------- */
.summary {
  background: var(--paper);
  border: var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--card-padding);
  position: sticky; top: 96px;
  display: grid; gap: var(--space-16);
}
.summary h2 { font-size: var(--text-sub); }
.summary-rows { display: grid; gap: var(--space-12); font-size: var(--text-body); }
.summary-row { display: flex; justify-content: space-between; gap: var(--space-16); }
.summary-row span:last-child { font-variant-numeric: tabular-nums; }
.summary-row--discount { color: var(--forest); }
.summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: var(--space-16); border-top: var(--hairline);
  font-size: var(--text-sub); font-weight: var(--wt-medium); color: var(--ink-950);
}
.summary-note { font-size: var(--text-caption); color: var(--ink-500); }

/* Inline apply-code row: input + button share one pill, Mercury style. */
.apply-row { display: flex; }
.apply-row input {
  flex: 1; min-width: 0;
  border: var(--hairline); border-right: 0;
  border-radius: var(--radius-control) 0 0 var(--radius-control);
  padding: 11px 18px; background: var(--ink-50);
  font-size: var(--text-small);
}
.apply-row button {
  border: var(--hairline); border-left: 0;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  padding: 11px 18px; background: var(--ink-50);
  font-size: var(--text-small); font-weight: var(--wt-medium);
  cursor: pointer; white-space: nowrap;
}
.apply-row button:hover { background: var(--ink-100); }

.applied-chip {
  display: inline-flex; align-items: center; gap: var(--space-8);
  background: var(--forest-tint); color: var(--forest);
  border-radius: var(--radius-badge);
  padding: 7px 12px; font-size: var(--text-small); font-weight: var(--wt-medium);
}
.applied-chip button { background: none; border: 0; color: inherit; cursor: pointer; line-height: 1; padding: 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--text-small); color: var(--ink-600); }
.field label .req { color: var(--chilli); }
.field input, .field select, .field textarea {
  border: var(--hairline); background: var(--paper);
  border-radius: var(--radius-control);
  padding: 12px 18px; font-size: var(--text-body); width: 100%;
  transition: border-color var(--duration) var(--ease);
}
.field textarea { border-radius: var(--radius-card); resize: vertical; min-height: 88px; }
.field input:hover, .field select:hover { border-color: var(--ink-400); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest); outline: none; }
.field input::placeholder { color: var(--ink-400); }
.field .hint { font-size: var(--text-caption); color: var(--ink-500); }
.field .err { font-size: var(--text-caption); color: var(--chilli); }
.field--invalid input { border-color: var(--chilli); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Checkout steps ---------- */
.checkout-layout {
  display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,1fr);
  gap: var(--space-40); align-items: start;
}
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
.step {
  background: var(--paper); border: var(--hairline);
  border-radius: var(--radius-card); padding: var(--card-padding);
  margin-bottom: var(--space-20);
}
.step-head {
  display: flex; align-items: center; gap: var(--space-12);
  margin-bottom: var(--space-20);
}
.step-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--forest); color: var(--paper);
  display: grid; place-items: center;
  font-size: var(--text-caption); font-weight: var(--wt-medium);
}
.step-head h2 { font-size: var(--text-sub); }
.step-body { display: grid; gap: var(--space-16); }

/* Delivery/payment option rows reuse the buy-option pattern. */
.opt-row {
  display: flex; align-items: flex-start; gap: var(--space-12);
  border: var(--hairline); border-radius: var(--radius-card);
  padding: var(--space-16); cursor: pointer;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.opt-row:hover { border-color: var(--ink-400); }
.opt-row:has(input:checked) { border-color: var(--forest); background: var(--forest-tint); }
.opt-row input { accent-color: var(--forest); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.opt-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.opt-row-title { font-weight: var(--wt-medium); color: var(--ink-950); }
.opt-row-sub { font-size: var(--text-small); color: var(--ink-500); }
.opt-row-price { font-weight: var(--wt-medium); white-space: nowrap; }
.opt-row--disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Product gallery ---------- */
.pdp-layout {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: var(--space-48); align-items: start;
}
@media (max-width: 900px) { .pdp-layout { grid-template-columns: 1fr; } }
.gallery { position: sticky; top: 96px; display: grid; gap: var(--space-12); }
.gallery-main {
  border-radius: var(--radius-card); overflow: hidden;
  border: var(--hairline); background: var(--ink-100); aspect-ratio: 1;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-12); }
.gallery-thumb {
  border-radius: var(--radius-badge); overflow: hidden;
  border: var(--hairline); background: var(--ink-100);
  aspect-ratio: 1; cursor: pointer; padding: 0;
  transition: border-color var(--duration) var(--ease);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb[aria-pressed="true"] { border-color: var(--forest); }
@media (max-width: 900px) { .gallery { position: static; } }

/* ---------- Prose blocks ---------- */
.prose { display: grid; gap: var(--space-16); color: var(--ink-600); font-size: var(--text-body); line-height: 1.7; }
.prose h3 { font-size: var(--text-h3); color: var(--ink-950); }
.prose ul { margin: 0; padding-left: 1.15rem; display: grid; gap: var(--space-8); }

.spec-table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
.spec-table th, .spec-table td { text-align: left; padding: 11px 0; border-bottom: var(--hairline); vertical-align: top; }
.spec-table th { font-weight: var(--wt-regular); color: var(--ink-500); width: 40%; }
.spec-table td { color: var(--ink-800); }

/* ---------- FAQ accordion ----------
   Built on <details>/<summary> so it works with no JavaScript, is
   keyboard-operable for free, and — the reason it matters here — the
   answers are in the DOM at load, so Google indexes them whether or not
   they are expanded. A JS-driven accordion that injects answers on click
   would waste the FAQPage markup entirely. */
.faq { display: grid; }
.faq-item { border-bottom: var(--hairline); }
.faq-item:first-child { border-top: var(--hairline); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: var(--space-24) var(--space-40) var(--space-24) 0;
  position: relative; min-height: 44px;
  display: flex; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h2 {
  font-size: var(--text-sub); font-weight: var(--wt-display);
  font-variation-settings: "opsz" 32;
  margin: 0; color: var(--ink-950);
}
.faq-item summary::after {
  content: ""; position: absolute; right: 4px; top: 50%;
  width: 11px; height: 11px; margin-top: -7px;
  border-right: 1.5px solid var(--ink-500);
  border-bottom: 1.5px solid var(--ink-500);
  transform: rotate(45deg);
  transition: transform var(--duration) var(--ease);
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-item summary:hover h2 { color: var(--forest); }
.faq-answer {
  padding: 0 var(--space-40) var(--space-24) 0;
  color: var(--ink-600); font-size: var(--text-body-lg);
  line-height: 1.7; max-width: 46rem;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: var(--space-80) var(--space-24);
  border: 1px dashed var(--ink-300); border-radius: var(--radius-card);
  display: grid; gap: var(--space-16); justify-items: center;
}
.empty svg { width: 40px; height: 40px; stroke: var(--ink-400); }

/* ---------- Order confirmation ---------- */
.confirm-hero { text-align: center; display: grid; gap: var(--space-16); justify-items: center; padding-block: var(--space-48); }
.confirm-tick {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--forest); display: grid; place-items: center;
}
.confirm-tick svg { width: 28px; height: 28px; stroke: var(--paper); }
.confirm-order-no {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: var(--text-body-lg); letter-spacing: 0.04em;
  background: var(--ink-100); border-radius: var(--radius-badge);
  padding: 8px 16px; color: var(--ink-950);
}
.timeline { display: grid; gap: 0; }
.timeline li { display: flex; gap: var(--space-16); list-style: none; }
.timeline-dot { display: grid; justify-items: center; }
.timeline-dot i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-300); display: block; margin-top: 5px;
}
.timeline li.is-done .timeline-dot i { background: var(--forest); }
.timeline-line { width: 1px; flex: 1; background: var(--ink-200); min-height: 34px; }
.timeline-body { padding-bottom: var(--space-20); }
.timeline-body b { display: block; color: var(--ink-950); font-weight: var(--wt-medium); }
.timeline-body span { font-size: var(--text-small); color: var(--ink-500); }

/* ---------- Sticky mobile action bar ----------
   Used on product, cart and checkout. On a phone the primary action
   otherwise sits below a long scroll, and on checkout the summary (with
   the Pay button in it) lands underneath the entire form.
   env(safe-area-inset-bottom) keeps it clear of the iPhone home bar. */
.buybar {
  position: fixed; inset: auto 0 0 0; z-index: 90;
  background: rgba(26, 21, 15, 0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: var(--hairline-dark);
  padding: var(--space-12) 0 calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  display: none;
}
.buybar-inner { display: flex; align-items: center; gap: var(--space-16); }
.buybar-price { color: var(--ivory); font-weight: var(--wt-medium); white-space: nowrap; }
.buybar-price small { display: block; font-size: var(--text-caption); color: var(--ash); font-weight: var(--wt-regular); }
.buybar .btn { margin-left: auto; }
@media (max-width: 900px) {
  .buybar { display: block; }
  body:has(.buybar) { padding-bottom: 92px; }
}

/* ---------- Mobile filter drawer ----------
   The filter rail is a sticky sidebar on desktop. Left to stack on a
   phone it pushes every product below three screens of checkboxes, so
   below 900px it becomes a bottom sheet opened from a toolbar button. */
.filter-trigger { display: none; }

@media (max-width: 900px) {
  .filter-trigger {
    display: inline-flex; align-items: center; gap: var(--space-8);
    border: var(--hairline); background: var(--paper);
    border-radius: var(--radius-control);
    padding: 11px 18px; min-height: 44px;
    font-size: var(--text-small); font-weight: var(--wt-medium); cursor: pointer;
  }
  .filter-trigger svg { width: 15px; height: 15px; stroke: currentColor; }

  .filters {
    position: fixed !important;
    inset: auto 0 0 0; z-index: 120;
    background: var(--paper);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    border-top: var(--hairline);
    padding: var(--space-24) var(--space-24) calc(var(--space-24) + env(safe-area-inset-bottom, 0px));
    max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
    transform: translateY(100%);
    transition: transform var(--duration) var(--ease);
    display: grid; gap: var(--space-24);
  }
  .filters.is-open { transform: translateY(0); }
  /* Grab handle — the affordance that tells people this is a sheet. */
  .filters::before {
    content: ""; width: 40px; height: 4px; border-radius: 999px;
    background: var(--ink-300); justify-self: center;
  }
  /* The sticky action sits over the scrolling filter list, so it needs a
     solid base plus a short fade above it — without the fade, rows scroll
     up and collide with the button edge instead of dissolving under it. */
  .filters-done {
    position: sticky; bottom: 0;
    background: var(--paper);
    padding: var(--space-16) 0 var(--space-4);
    margin-top: var(--space-8);
  }
  .filters-done::before {
    content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px;
    background: linear-gradient(to bottom, rgba(255,253,248,0), var(--paper));
    pointer-events: none;
  }
}
@media (min-width: 901px) {
  .filters-done { display: none; }
}

/* ---------- Form / cart feedback ---------- */
.form-flash {
  padding: var(--space-12) var(--space-16); border-radius: var(--radius-card);
  font-size: var(--text-small); margin-bottom: var(--space-16);
  background: var(--forest-tint, #E6F0EA); color: var(--forest, #00613A);
}
.form-flash--error { background: #F6E3DC; color: var(--chilli, #B24A2A); }
.field .err-block { color: var(--chilli); font-size: var(--text-small); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pay-steps { counter-reset: s; display: grid; gap: var(--space-12); padding: 0; list-style: none; margin: 0; }
.pay-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: var(--space-12); font-size: var(--text-body); }
.pay-steps li::before {
  content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--forest); color: #fff; font-size: var(--text-small);
}

/* MRP shown struck through beside the selling price. */
.mrp { color: var(--ink-500); font-size: var(--text-small); font-weight: 400; margin-left: 6px; white-space: nowrap; text-decoration: line-through; }
#liveMrp { text-decoration: none; }
#liveMrp s { color: var(--ink-500); }
#liveMrp b { color: var(--forest); font-weight: 500; margin-left: 6px; }

/* Checkout: make a failed field impossible to miss. */
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--chilli); box-shadow: 0 0 0 3px rgba(178, 74, 42, 0.14); }
.field .err { font-weight: 500; }
