/* ============================================================
   The Store NZ — product.css
   Product detail page, configurator, compare pages.
   ============================================================ */

/* ---------- PDP scaffolding ---------- */

.pdp { padding: clamp(1.4rem, 3vw, 2.6rem) 0 0; }
.pdp-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(1.4rem, 3.4vw, 3.4rem); align-items: start;
}
@media (max-width: 920px) { .pdp-grid { grid-template-columns: 1fr; } }

.pdp-stage {
  position: sticky; top: calc(var(--nav-h) + 20px);
  background: radial-gradient(120% 100% at 50% 0%, #ffffff, #f2f2f5 78%);
  border-radius: var(--r-xl); padding: clamp(1.6rem, 3vw, 3rem);
  display: flex; align-items: center; justify-content: center; min-height: 380px;
  overflow: hidden; position: sticky;
}
@media (max-width: 920px) { .pdp-stage { position: static; min-height: 300px; } }
.pdp-stage .stage-art { width: min(100%, 520px); filter: drop-shadow(0 30px 40px rgba(15,25,50,.2)); }
.pdp-stage .stage-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .84rem; color: var(--faint); }

.color-transition { animation: color-swap .38s var(--ease-out); }
@keyframes color-swap { 0% { opacity: .25; transform: scale(.985); } 100% { opacity: 1; transform: none; } }

/* ---------- configurator ---------- */

.cfg-group { margin: 0 0 1.5rem; }
.cfg-group > .cfg-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 1.02rem; margin-bottom: .7rem; }
.cfg-label .sel-value { color: var(--muted); font-weight: 400; font-size: .92rem; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { position: relative; width: 42px; height: 42px; }
.swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch .sw-dot {
  position: absolute; inset: 4px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), inset 0 -3px 6px rgba(0,0,0,.16), inset 0 3px 6px rgba(255,255,255,.28);
  transition: transform .18s var(--ease-spring), box-shadow .18s;
}
.swatch input:checked + .sw-dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 0 0 2.5px var(--surface), 0 0 0 5.5px var(--accent); }
.swatch input:focus-visible + .sw-dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 0 0 2.5px var(--surface), 0 0 0 5.5px rgba(0,113,227,.6); }
.swatch:hover .sw-dot { transform: scale(1.08); }
.swatch .sw-name {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  font-size: .74rem; color: var(--muted); white-space: nowrap; opacity: 0;
  transition: opacity .16s; pointer-events: none;
}
.swatch:hover .sw-name, .swatch input:checked ~ .sw-name { opacity: 1; }
.swatches { padding-bottom: 26px; }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.opt {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 13px 14px; cursor: pointer; transition: border-color .16s, box-shadow .16s, background .16s;
}
.opt:hover { border-color: #b8b8bf; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt input:checked ~ .opt-body { color: var(--ink); }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 18px rgba(0,113,227,.12); }
.opt:has(input:focus-visible) { outline: 3px solid rgba(0,113,227,.5); outline-offset: 2px; }
.opt .opt-title { font-weight: 600; font-size: .98rem; display: flex; align-items: center; gap: .45em; }
.opt .opt-sub { font-size: .8rem; color: var(--muted); }
.opt .opt-delta { font-size: .84rem; color: var(--ink-2); margin-top: 3px; }
.opt .badge { align-self: flex-start; margin-top: 6px; }
.opt.disabled { cursor: not-allowed; background: #f6f6f8; }
.opt.disabled .opt-title { color: var(--muted); }

.cfg-accordion { border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cfg-accordion + .cfg-accordion { margin-top: 10px; }
.cfg-acc-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: 0; padding: 16px 20px; cursor: pointer; text-align: left;
  font-size: 1rem; font-weight: 600; color: var(--ink);
}
.cfg-acc-head .acc-value { font-weight: 400; color: var(--muted); font-size: .88rem; }
.cfg-acc-head .acc-caret { transition: transform .22s var(--ease-out); color: var(--faint); flex: none; }
.cfg-accordion.open .acc-caret { transform: rotate(180deg); }
.cfg-acc-body { display: none; padding: 0 20px 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.cfg-accordion.open .cfg-acc-body { display: block; animation: fade-swap .25s var(--ease-out); }

/* ---------- PDP buy box ---------- */

.pdp-buy { font-size: 1.02rem; }
.pdp-price-row { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin: .2rem 0 .1rem; }
.pdp-price { font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; }
.pdp-price s { color: var(--faint); font-weight: 400; font-size: .62em; margin-right: .35em; }
.pdp-monthly { color: var(--muted); font-size: .95rem; }
.pdp-gst { color: var(--faint); font-size: .84rem; margin-bottom: 1rem; }
.pdp-delivery-eta {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 13px 15px; margin: 0 0 1.3rem;
}
.pdp-delivery-eta svg { flex: none; width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.pdp-delivery-eta .eta-main { font-size: .95rem; }
.pdp-delivery-eta .eta-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.pdp-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0 .9rem; }
.pdp-cta .btn { flex: 1; min-width: 180px; }
.express-row { margin: .4rem 0 1rem; }
.express-pay {
  width: 100%; border: 0; border-radius: 980px; background: #000; color: #fff;
  padding: 13px 22px; font-size: 1.02rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .55em;
  transition: transform .15s, background .15s;
}
.express-pay:hover { background: #1a1a1c; }
.express-pay:active { transform: scale(.98); }
.express-pay .xp-mark { width: 17px; height: 17px; }

/* ---------- highlights / features ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature-cell { background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); }
.feature-cell .f-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature-cell .f-icon svg { width: 22px; height: 22px; }
.feature-cell h3 { font-size: 1.02rem; margin-bottom: 5px; }
.feature-cell p { font-size: .9rem; color: var(--muted); margin: 0; }

.hl-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.hl-cell { padding: 10px 14px; }
.hl-cell .hl-val { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.hl-cell .hl-key { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ---------- specs table ---------- */

.spec-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.spec-table th, .spec-table td { text-align: left; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { width: 220px; color: var(--muted); font-weight: 400; font-size: .9rem; }
.spec-table td { font-size: .95rem; }
@media (max-width: 640px) {
  .spec-table th, .spec-table td { display: block; width: auto; padding: 6px 20px; }
  .spec-table tr { padding: 10px 0; display: block; }
  .spec-table th { padding-top: 14px; }
  .spec-table tr:last-child td:last-child { padding-bottom: 14px; }
}

/* ---------- sticky mobile buy bar ---------- */

.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
  background: rgba(251,251,253,.9); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-top: 1px solid rgba(0,0,0,.07); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 1rem; justify-content: space-between;
  transform: translateY(110%); transition: transform .3s var(--ease-out);
}
.buy-bar.show { transform: none; }
.buy-bar .bb-price { font-weight: 700; font-size: 1.12rem; }
.buy-bar .bb-sub { font-size: .76rem; color: var(--muted); }
.buy-bar .btn { padding: 11px 26px; }
@media (max-width: 700px) { .buy-bar { display: flex; } body { padding-bottom: 74px; } }

/* ---------- compare ---------- */

.compare-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1.4rem; }
.compare-table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
table.compare-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.compare-table th, .compare-table td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.compare-table thead th { border-bottom: 2px solid var(--line); position: relative; }
.compare-table tbody th { color: var(--muted); font-weight: 400; font-size: .88rem; width: 190px; }
.compare-table .rec-col { background: rgba(0,113,227,.045); }
.compare-table thead .rec-col::after {
  content: "Recommended"; position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff; font-size: .64rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .04em;
}
.compare-art { display: flex; align-items: flex-end; justify-content: center; height: 120px; margin-bottom: 10px; }
.compare-name { font-weight: 600; }
.compare-price { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.compare-swatches { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.compare-swatches i { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }

.which-card { display: grid; grid-template-columns: 200px 1fr; gap: 1.4rem; align-items: center; background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); margin-bottom: 14px; }
.which-card .wc-art { display: flex; justify-content: center; }
.which-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.which-card p { margin: 0; color: var(--muted); font-size: .92rem; }
@media (max-width: 640px) { .which-card { grid-template-columns: 1fr; text-align: center; } }
