/* ============================================================
   The Store NZ — commerce.css
   Bag, checkout, payment, confirmation, tracking, orders.
   ============================================================ */

/* ---------- bag ---------- */

.bag-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
@media (max-width: 900px) { .bag-grid { grid-template-columns: 1fr; } }

.bag-items { display: flex; flex-direction: column; gap: 14px; }
.bag-item {
  display: grid; grid-template-columns: 128px 1fr; gap: 16px;
  background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-1);
  animation: fade-swap .3s var(--ease-out);
}
.bag-item.unavailable { outline: 2px solid var(--warn); }
@media (max-width: 560px) { .bag-item { grid-template-columns: 92px 1fr; } }
.bag-item .bi-art { display: flex; align-items: center; justify-content: center; }
.bag-item h3 { font-size: 1.02rem; margin-bottom: 2px; }
.bi-config { font-size: .84rem; color: var(--muted); line-height: 1.5; }
.bi-config .bi-engrave { font-style: italic; }
.bi-price { font-size: .98rem; font-weight: 600; margin-top: 6px; }
.bi-notice { margin-top: 8px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-size: .82rem; padding: 8px 12px; }
.bi-notice .btn-link { color: inherit; text-decoration: underline; }
.bi-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.bi-actions .btn-link { color: var(--muted); font-size: .84rem; padding: 4px 8px; border-radius: 6px; }
.bi-actions .btn-link:hover { color: var(--danger); background: rgba(0,0,0,.04); }
.bi-actions .btn-link.save-action:hover { color: var(--accent); }

.qty-stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px;
}
.qty-stepper button { width: 34px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 1.05rem; color: var(--ink-2); transition: background .14s; display: flex; align-items: center; justify-content: center; }
.qty-stepper button:hover:not(:disabled) { background: rgba(0,0,0,.05); }
.qty-stepper button:disabled { opacity: .3; cursor: not-allowed; }
.qty-stepper .qty-val { min-width: 30px; text-align: center; font-size: .92rem; font-weight: 600; }

.summary-card {
  background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-1);
  position: sticky; top: calc(var(--nav-h) + 20px);
}
@media (max-width: 900px) { .summary-card { position: static; } }
.summary-card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 1rem; padding: 6px 0; font-size: .95rem; }
.sum-row.muted { color: var(--muted); font-size: .88rem; }
.sum-row .strike { text-decoration: line-through; color: var(--faint); margin-right: .4em; }
.sum-total { border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 14px; font-size: 1.18rem; font-weight: 700; display: flex; justify-content: space-between; }
.sum-gst { font-size: .8rem; color: var(--faint); margin-top: 6px; }
.sum-note { font-size: .8rem; color: var(--faint); margin-top: 10px; }
.sum-free-ship { background: var(--success-soft); color: var(--success); border-radius: var(--r-sm); padding: 8px 12px; font-size: .82rem; margin: 10px 0; }

.empty-state {
  text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.5rem;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-1);
}
.empty-state .es-art { margin: 0 auto 1.4rem; width: min(280px, 70vw); }
.empty-state h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .4em; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto 1.4rem; }
.empty-state .hero-cta { justify-content: center; }

.saved-block { margin-top: 2.2rem; }
.saved-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-1); margin-bottom: 10px; }
@media (max-width: 560px) { .saved-item { grid-template-columns: 64px 1fr; } .saved-item .si-actions { grid-column: 1 / -1; display: flex; gap: .6rem; } }
.saved-item h3 { font-size: .98rem; }
.saved-item .si-config { font-size: .8rem; color: var(--muted); }

/* ---------- checkout ---------- */

.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; padding-bottom: 3rem; }
@media (max-width: 920px) { .checkout-grid { grid-template-columns: 1fr; } }

.steps { display: flex; align-items: center; gap: 4px; margin: 8px 0 1.6rem; flex-wrap: wrap; }
.step-chip { display: inline-flex; align-items: center; gap: .5em; font-size: .8rem; color: var(--faint); padding: 5px 12px 5px 6px; border-radius: 999px; }
.step-chip .sc-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: var(--faint);
  background: var(--surface); transition: all .2s;
}
.step-chip.current { color: var(--ink); font-weight: 600; }
.step-chip.current .sc-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.step-chip.done { color: var(--success); }
.step-chip.done .sc-dot { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.step-sep { width: 18px; height: 1.5px; background: var(--line); border-radius: 2px; }
a.step-chip { text-decoration: none; }

.checkout-card { background: var(--surface); border-radius: var(--r-xl); padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-1); }
.checkout-card > h2 { font-size: 1.4rem; margin-bottom: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .span2 { grid-column: 1 / -1; }

.radio-card { position: relative; display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 15px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.radio-card + .radio-card { margin-top: 10px; }
.radio-card:hover { border-color: #b8b8bf; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card .rc-dot { flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid var(--line); margin-top: 2px; position: relative; transition: border-color .15s; }
.radio-card input:checked ~ .rc-dot { border-color: var(--accent); }
.radio-card input:checked ~ .rc-dot::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--accent); }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 16px rgba(0,113,227,.1); }
.radio-card:has(input:focus-visible) { outline: 3px solid rgba(0,113,227,.5); outline-offset: 2px; }
.radio-card .rc-main { flex: 1; }
.radio-card .rc-title { font-weight: 600; display: flex; justify-content: space-between; gap: 1em; }
.radio-card .rc-title .rc-price { font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.radio-card .rc-sub { font-size: .84rem; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.radio-card.disabled { opacity: .55; cursor: not-allowed; }
.rc-badge { margin-top: 6px; }

/* payment */
.card-brand-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: #fff; background: #3a3a3f; }
.card-brand-chip.visa { background: #1a1f71; }
.card-brand-chip.mastercard { background: #16130f; }
.card-brand-chip.amex { background: #006fcf; }
.card-brand-chip.generic { background: #6e6e73; }
.card-field { position: relative; }
.card-field .brand-slot { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.input.card-num { padding-right: 84px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.card-preview { perspective: 900px; margin: 0 0 1.2rem; }
.card-preview .cp-inner {
  position: relative; width: min(100%, 340px); aspect-ratio: 1.586; margin: 0 auto;
  border-radius: 16px; background: linear-gradient(120deg, #2b2b31, #17171c 55%, #26262c);
  color: #f2f2f7; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow-2); transform-style: preserve-3d;
  transition: background .4s; overflow: hidden;
}
.card-preview .cp-sheen { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.09) 46%, transparent 60%); }
.card-preview .cp-top { display: flex; justify-content: space-between; align-items: center; }
.card-preview .cp-chip { width: 34px; height: 25px; border-radius: 5px; background: linear-gradient(135deg, #d9b96a, #a8863c); position: relative; }
.card-preview .cp-chip::after { content: ""; position: absolute; inset: 6px 4px; border-left: 1px solid rgba(0,0,0,.25); border-right: 1px solid rgba(0,0,0,.25); }
.card-preview .cp-number { font-size: 1.02rem; letter-spacing: .13em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.card-preview .cp-bottom { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .06em; opacity: .9; text-transform: uppercase; }
.card-preview.visa .cp-inner { background: linear-gradient(120deg, #23286b, #10133f 55%, #1b1f56); }
.card-preview.mastercard .cp-inner { background: linear-gradient(120deg, #2d2115, #171009 55%, #241a10); }
.card-preview.amex .cp-inner { background: linear-gradient(120deg, #0a5aa8, #043464 55%, #074a8c); }

.secure-note { display: flex; gap: .55em; align-items: center; font-size: .8rem; color: var(--faint); margin-top: .8rem; }
.secure-note svg { width: 15px; height: 15px; }

.review-list { display: flex; flex-direction: column; gap: 4px; }
.review-item { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.review-item:last-child { border-bottom: 0; }
.review-item .rv-name { font-weight: 600; font-size: .95rem; }
.review-item .rv-config { font-size: .8rem; color: var(--muted); }
.review-block { background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; font-size: .92rem; }
.review-block h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 6px; }
.review-block .rb-row { display: flex; justify-content: space-between; gap: 1em; padding: 1.5px 0; }
.review-block .rb-edit { margin-top: 6px; }

/* ---------- confirmation ---------- */

.confirm-wrap { max-width: 760px; margin: 0 auto; text-align: center; padding: clamp(2rem, 5vw, 3.6rem) 0 3rem; }
.success-burst { position: relative; width: 120px; height: 120px; margin: 0 auto 1.6rem; }
.success-burst .sb-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--success); animation: sb-draw .7s var(--ease-out) forwards; stroke-dasharray: 302; stroke-dashoffset: 302; }
.success-burst svg { width: 100%; height: 100%; }
.success-burst .sb-check path { stroke: var(--success); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-dasharray: 80; stroke-dashoffset: 80; animation: sb-check .45s .45s var(--ease-out) forwards; }
@keyframes sb-draw { to { stroke-dashoffset: 0; } }
@keyframes sb-check { to { stroke-dashoffset: 0; } }
.order-number { font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.confirm-card { text-align: left; margin-top: 2rem; }
.delivery-promise { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--success-soft); border-radius: var(--r-md); padding: 14px 18px; margin: 1.4rem 0; color: var(--success); font-weight: 500; }
.delivery-promise svg { width: 26px; height: 26px; flex: none; }

/* ---------- tracking ---------- */

.track-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
@media (max-width: 920px) { .track-grid { grid-template-columns: 1fr; } }
.track-hero { background: var(--surface); border-radius: var(--r-xl); padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-1); }
.track-route { position: relative; height: 120px; margin: 1rem 0 .4rem; }
.track-route .tr-path { position: absolute; left: 4%; right: 4%; top: 58px; height: 3.5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track-route .tr-progress { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--accent), #34a5ff); border-radius: 3px; transition: width 1.2s var(--ease-out); }
.track-route .tr-van { position: absolute; top: 30px; left: 4%; transform: translateX(-50%); transition: left 1.2s var(--ease-out); width: 56px; }
.track-route .tr-endpoints { position: absolute; left: 4%; right: 4%; top: 84px; display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }

.stepper { display: flex; flex-direction: column; margin-top: 1.2rem; }
.stepper .st-step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; position: relative; padding-bottom: 26px; }
.stepper .st-step:last-child { padding-bottom: 0; }
.stepper .st-step::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 2px; background: var(--line); }
.stepper .st-step:last-child::before { display: none; }
.stepper .st-step.done::before { background: var(--success); }
.stepper .st-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); z-index: 1; display: flex; align-items: center; justify-content: center; color: var(--faint); transition: all .3s; }
.stepper .st-step.done .st-dot { border-color: var(--success); background: var(--success); color: #fff; }
.stepper .st-step.current .st-dot { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(0,113,227,.14); }
.stepper .st-step.current .st-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.stepper .st-step.done .st-dot svg { width: 13px; height: 13px; }
.stepper .st-title { font-weight: 600; font-size: .98rem; }
.stepper .st-step.future .st-title { color: var(--muted); font-weight: 400; }
.stepper .st-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.track-events { display: flex; flex-direction: column; gap: 0; }
.track-event { display: grid; grid-template-columns: 86px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem; }
.track-event:last-child { border-bottom: 0; }
.track-event .te-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.track-event .te-title { font-weight: 500; }
.track-event .te-sub { color: var(--muted); font-size: .8rem; margin-top: 1px; }

/* ---------- orders ---------- */

.order-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-1); margin-bottom: 14px; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
@media (max-width: 620px) { .order-card { grid-template-columns: 1fr; } }
.order-card .oc-head { display: flex; flex-wrap: wrap; gap: .6em 1.4em; align-items: baseline; }
.order-card .oc-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.order-card .oc-date { color: var(--muted); font-size: .86rem; }
.order-card .oc-items { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.order-status-chip { display: inline-flex; align-items: center; gap: .45em; font-size: .82rem; font-weight: 600; border-radius: 999px; padding: 5px 13px; }
.osc-processing { background: #eef4ff; color: #2758c4; }
.osc-shipping { background: var(--warn-soft); color: var(--warn); }
.osc-delivered { background: var(--success-soft); color: var(--success); }
.osc-preparing { background: #f1effe; color: #5b4bc4; }

/* location modal art */
.loc-map { width: 100%; height: 130px; border-radius: var(--r-md); background: linear-gradient(160deg, #eaf3ff, #ddecfb); position: relative; overflow: hidden; margin-bottom: 1.1rem; }
.loc-map .lm-islands { position: absolute; inset: 0; }
