/* ==========================================================================
   GloryVolt — shop flow (shop, product, cart, checkout, wishlist, compare,
   order tracking). Builds on base.css tokens and components only.
   ========================================================================== */

/* ---------- shared bits ---------- */
.page-hero.is-slim { padding-block: 16px; }
.page-hero.is-slim .crumbs { margin: 0; }

.b-empty { max-width: 620px; margin: 0 auto; text-align: center; padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 44px); }
.b-empty-ico { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: var(--tint); color: var(--gold-ink); display: grid; place-items: center; }
.b-empty-ico svg { width: 32px; height: 32px; }
.b-empty h2, .b-empty-title { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.b-empty p { color: var(--muted); margin-inline: auto; max-width: 48ch; }
.b-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.b-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.b-links > span { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-right: 4px; }
.b-search { display: flex; gap: 8px; max-width: 460px; margin: 20px auto 0; }
.b-search .input { flex: 1; min-width: 0; }
.b-suggest { margin-top: clamp(40px, 6vw, 64px); }

.field-label { font-weight: 700; font-size: 0.85rem; color: var(--ink); }
.field-err { font-size: 0.8rem; font-weight: 700; color: var(--sale); }
.field-err:empty { display: none; }
.opt { font-weight: 500; color: var(--muted); }
.select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--sale); }

.qty svg { width: 16px; height: 16px; }
.qty button[disabled] { color: var(--line-2); cursor: not-allowed; }
.qty input[disabled] { color: var(--muted); }

.line-stock, .pd-stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.line-stock { font-size: 0.82rem; }
.line-stock svg { width: 15px; height: 15px; }
.line-stock.is-in, .pd-stock.is-in { color: var(--ok); }
.line-stock.is-out, .pd-stock.is-out { color: var(--sale); }

.f-check { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; font-weight: 600; font-size: 0.9rem; color: var(--ink-3); cursor: pointer; }
.f-check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold-ink); }
.f-check input[disabled] + span { color: var(--muted); }

.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.list-toolbar p { margin: 0; color: var(--ink-3); }
.list-toolbar strong { color: var(--ink); }
.list-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.list-foot { margin: 18px 0 0; }
.link-back svg { transform: rotate(180deg); }
.link-arrow.link-back:hover svg { transform: rotate(180deg) translateX(3px); }

/* ==========================================================================
   Shop page
   ========================================================================== */
.shop-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 28px; align-items: start; }
.shop-main { min-width: 0; scroll-margin-top: calc(var(--header-h) + 12px); }

/* filters sidebar (desktop) */
.shop-filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.f-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.f-head h2 { margin: 0; font-size: 1.05rem; }
.f-close { display: none; }
.f-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 18px; }
.f-foot { display: none; }
.f-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.f-title { margin: 0 0 10px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.f-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.f-cat { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 8px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; line-height: 1.3; color: var(--ink-3); transition: background 0.2s, color 0.2s; }
.f-cat:hover { background: var(--tint); color: var(--gold-ink); }
.f-cat.is-active { background: var(--ink); color: #fff; }
.f-cat-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--bg); color: var(--gold-ink); display: grid; place-items: center; }
.f-cat-ico svg { width: 16px; height: 16px; }
.f-cat.is-active .f-cat-ico { background: var(--ink-3); color: var(--gold-on-dark); }
.f-cat-name { flex: 1; min-width: 0; }
.f-count { margin-left: auto; min-width: 28px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--muted); font-size: 0.74rem; font-weight: 700; text-align: center; }
.f-cat.is-active .f-count { background: var(--ink-3); color: var(--gold-on-dark); }

.f-price { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; }
.f-price .field { gap: 4px; }
.f-price .field label { font-size: 0.75rem; color: var(--muted); }
.f-price .input { min-height: 40px; padding: 8px 10px; }
.f-dash { padding-bottom: 9px; color: var(--muted); }
.f-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.f-preset { min-height: 32px; padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface); font-size: 0.78rem; font-weight: 700; color: var(--ink-3); transition: border-color 0.2s, color 0.2s, background 0.2s; }
.f-preset:hover { border-color: var(--gold); color: var(--gold-ink); }
.f-preset[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold-on-dark); }
.f-hint { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
.f-hint:empty { display: none; }
#fReset { margin-top: 16px; }

.shop-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(23, 23, 26, 0.5); opacity: 0; transition: opacity 0.25s; }
.shop-backdrop.is-open { opacity: 1; }

/* toolbar */
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; padding: 10px 12px 10px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-filter-btn { display: none; }
.f-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-size: 0.7rem; font-weight: 800; line-height: 1; }
.shop-count { margin: 0; font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.shop-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.shop-sort { display: flex; align-items: center; gap: 8px; min-width: 0; }
.shop-sort label { font-size: 0.85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.shop-sort .select { width: auto; min-height: 40px; padding-block: 6px; font-size: 0.9rem; font-weight: 600; }
.view-toggle { display: inline-flex; flex: none; border: 1.5px solid var(--line-2); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); }
.view-toggle button { width: 42px; height: 38px; display: grid; place-items: center; color: var(--muted); transition: background 0.2s, color 0.2s; }
.view-toggle button:hover { color: var(--gold-ink); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--gold-on-dark); }
.view-toggle svg { width: 18px; height: 18px; }

/* active filter chips */
.shop-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.shop-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--gold-light); background: var(--surface); font-size: 0.82rem; font-weight: 700; color: var(--ink); max-width: 100%; }
.chip svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.chip:hover { border-color: var(--gold); }
.chip:hover svg { color: var(--sale); }
.chip-clear { border-color: transparent; background: transparent; color: var(--gold-ink); text-decoration: underline; padding-inline: 8px; }

/* results */
.p-short { display: none; }
.shop-grid.is-list { grid-template-columns: minmax(0, 1fr); }
.shop-grid.is-list .p-card { display: grid; grid-template-columns: 200px minmax(0, 1fr) 200px; align-items: center; padding: 14px; }
.shop-grid.is-list .p-card:hover { transform: none; }
.shop-grid.is-list .p-media { border-radius: var(--radius-sm); isolation: isolate; }
.shop-grid.is-list .p-body { padding: 8px 22px; }
.shop-grid.is-list .p-title { font-size: 1.05rem; }
.shop-grid.is-list .p-short { display: block; margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.shop-grid.is-list .p-price { margin-top: 8px; }
.shop-grid.is-list .p-foot { padding: 8px 8px 8px 0; }

/* ==========================================================================
   Product page
   ========================================================================== */
.pd-section { padding-top: clamp(24px, 3.5vw, 44px); }
.pd-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pd-gallery { position: sticky; top: calc(var(--header-h) + 20px); }
.pd-media { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(circle at 50% 42%, var(--surface) 0%, var(--surface) 30%, var(--surface-2) 100%); }
.pd-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-media .p-badges { top: 18px; left: 18px; }
.pd-art-note { margin: 10px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); }

.pd-cat { margin-bottom: 10px; }
.pd-cat:hover { color: var(--ink); }
.pd-title { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 14px; }
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 12px; }
.pd-price .now { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--ink); }
.pd-price .now.is-sale { color: var(--sale); }
.pd-price s { font-size: 1.1rem; color: var(--muted); }
.pd-save { font-size: 0.9rem; font-weight: 700; color: var(--sale); }
.pd-stock { margin: 0 0 14px; font-size: 0.92rem; }
.pd-stock svg { width: 18px; height: 18px; }
.pd-short { font-size: 1.02rem; color: var(--ink-3); }
.pd-highlights, .pd-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pd-highlights { margin-bottom: 12px; }
.pd-highlights li, .pd-features li { display: flex; align-items: flex-start; gap: 10px; }
.pd-highlights svg, .pd-features svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--gold-ink); }
.pd-spec-link { margin-bottom: 20px; font-size: 0.9rem; }
.pd-out { margin-bottom: 16px; }
.pd-out a { color: var(--gold-ink); font-weight: 700; text-decoration: underline; }

.pd-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pd-buy .qty { height: 50px; flex: none; }
.pd-buy .btn { flex: 1 1 150px; min-height: 50px; }
.pd-incart { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--ok); }
.pd-incart:empty { display: none; }
.pd-incart svg { width: 16px; height: 16px; flex: none; }
.pd-incart a { color: var(--gold-ink); text-decoration: underline; }

.pd-secondary { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 12px 0 4px; }
.pd-link { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 700; font-size: 0.9rem; color: var(--ink-3); transition: color 0.2s; }
.pd-link svg { width: 19px; height: 19px; }
.pd-link:hover, .pd-link[aria-pressed="true"] { color: var(--gold-ink); }
.pd-link[aria-pressed="true"] [data-wish-label], .pd-link[aria-pressed="true"] [data-compare-label] { text-decoration: underline; text-underline-offset: 3px; }
.pd-link[data-wish][aria-pressed="true"] svg { fill: currentColor; }

.pd-perks { list-style: none; margin: 16px 0 0; padding: 16px 18px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pd-perks li { display: flex; align-items: flex-start; gap: 12px; }
.pd-perks .ico { width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--tint); color: var(--gold-ink); display: grid; place-items: center; }
.pd-perks .ico svg { width: 19px; height: 19px; }
.pd-perks strong { display: block; font-size: 0.9rem; color: var(--ink); }
.pd-perks li > span:last-child > span { display: block; font-size: 0.84rem; line-height: 1.45; color: var(--muted); }
.pd-perks a { color: var(--gold-ink); font-weight: 700; }

/* tabs */
.pd-tabs { scroll-margin-top: calc(var(--header-h) + 16px); padding-top: 8px; }
.tablist { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; padding: 14px 16px; font-weight: 700; font-size: 0.95rem; color: var(--muted); white-space: nowrap; transition: color 0.2s; }
.tab:hover, .tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.tab:focus-visible { outline-offset: -3px; border-radius: var(--radius-xs); }
.tab-panel:focus-visible { outline-offset: 6px; border-radius: var(--radius-xs); }
.pd-desc { max-width: 80ch; }
.pd-lead { font-size: 1.05rem; color: var(--ink-3); }
.pd-desc h3 { margin-top: 18px; }
.pd-features { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px 28px; }

.spec-table { width: 100%; max-width: 840px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.92rem; }
.spec-table th, .spec-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.spec-table tr:last-child > * { border-bottom: 0; }
.spec-table th { width: 38%; background: var(--bg); color: var(--ink); font-weight: 700; }
.spec-table td { color: var(--ink-3); }

.pd-ship-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.pd-ship-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.pd-ship-card .ico { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--gold-ink); display: grid; place-items: center; }
.pd-ship-card .ico svg { width: 20px; height: 20px; }
.pd-ship-card h3 { font-size: 1rem; margin-bottom: 8px; }
.pd-ship-card p { font-size: 0.9rem; margin-bottom: 10px; }
.pd-ship-card p a { color: var(--gold-ink); font-weight: 700; }
.pd-rate-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; font-size: 0.9rem; }
.pd-rate-list li { display: flex; justify-content: space-between; gap: 12px; }
.pd-rate-list strong { color: var(--ink); text-align: right; white-space: nowrap; }
.pd-rate-list small { display: block; font-size: 0.76rem; font-weight: 500; color: var(--muted); white-space: normal; }

/* ==========================================================================
   Line lists (cart + wishlist)
   ========================================================================== */
.line-head { display: grid; grid-template-columns: minmax(0, 1fr) 140px 110px 40px; gap: 20px; padding: 0 20px 10px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.line-head span:nth-child(3) { text-align: right; }
.line-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.line { display: grid; grid-template-columns: 96px minmax(0, 1fr) 140px 110px 40px; grid-template-areas: "media info qty total remove"; align-items: center; gap: 12px 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line-media { grid-area: media; width: 96px; height: 96px; border-radius: var(--radius-sm); background: linear-gradient(160deg, var(--bg) 0%, var(--surface-2) 100%); display: grid; place-items: center; }
.line-media { overflow: hidden; }
.line-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-info { grid-area: info; display: grid; gap: 3px; min-width: 0; }
.line-name { font-weight: 700; line-height: 1.35; color: var(--ink); }
.line-name:hover { color: var(--gold-ink); }
.line-unit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.88rem; font-weight: 700; color: var(--ink-3); }
.line-unit .is-sale { color: var(--sale); }
.line-unit s, .line-unit .muted { font-weight: 500; color: var(--muted); }
.line-unit .badge { height: 20px; padding: 0 8px; font-size: 0.66rem; }
.line-qty { grid-area: qty; }
.line-total { grid-area: total; text-align: right; font-weight: 800; color: var(--ink); white-space: nowrap; }
.line-remove { grid-area: remove; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background 0.2s, color 0.2s; }
.line-remove:hover { background: var(--tint); color: var(--sale); }
.line-remove svg { width: 18px; height: 18px; }

.wl-line { grid-template-columns: 96px minmax(0, 1fr) 190px 40px; grid-template-areas: "media info add remove"; }
.wl-add { grid-area: add; }
.wl-add .p-add { min-height: 42px; }

/* ==========================================================================
   Cart page
   ========================================================================== */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.cart-main { min-width: 0; }
.cart-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

.summary { position: sticky; top: calc(var(--header-h) + 16px); }
.summary h2 { font-size: 1.2rem; margin-bottom: 16px; }
.sum-rows { margin: 0 0 16px; display: grid; gap: 12px; }
.sum-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-rows dt { font-size: 0.92rem; color: var(--text); }
.sum-rows dd { margin: 0; text-align: right; font-weight: 700; color: var(--ink); }
.sum-rows small { display: block; font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.sum-rows dd.sum-muted { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.sum-free { color: var(--ok); font-weight: 800; }
.sum-rows .sum-total { padding-top: 14px; border-top: 1px solid var(--line); }
.sum-total dt, .sum-total dd { font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.summary .gv-ship-meter { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); }
.summary .gv-ship-meter strong { color: var(--ink); }
.sum-actions { display: grid; gap: 10px; margin-top: 18px; }
.sum-note { margin: 14px 0 0; font-size: 0.8rem; color: var(--muted); }
.mini-perks { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 0.82rem; color: var(--muted); }
.mini-perks li { display: flex; align-items: flex-start; gap: 10px; }
.mini-perks svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--gold-ink); }
.mini-perks strong { color: var(--ink); }

/* ==========================================================================
   Checkout
   ========================================================================== */
.co-progress { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 0.88rem; font-weight: 700; color: var(--muted); }
.co-progress li { display: inline-flex; align-items: center; gap: 8px; }
.co-progress li + li::before { content: ""; width: 28px; height: 2px; margin-right: 2px; border-radius: 2px; background: var(--line-2); }
.co-progress a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }
.co-progress a:hover { color: var(--gold-ink); }
.co-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.co-dot svg { width: 14px; height: 14px; }
.co-progress .is-done .co-dot { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.co-progress [aria-current="step"] { color: var(--ink); }
.co-progress [aria-current="step"] .co-dot { background: var(--ink); border-color: var(--ink); color: var(--gold-on-dark); }

.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.co-form { display: grid; gap: 18px; min-width: 0; }
.co-step { margin: 0; min-width: 0; }
.co-step legend { float: left; width: 100%; margin: 0 0 18px; padding: 0; display: flex; align-items: center; gap: 12px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.co-step legend + * { clear: both; }
.co-num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: var(--gold-on-dark); display: grid; place-items: center; font-size: 0.88rem; font-weight: 800; }
.co-static { display: flex; align-items: center; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px dashed var(--line-2); background: var(--bg); font-weight: 600; color: var(--ink); }

.ship-opts { display: grid; gap: 10px; }
.ship-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.ship-opt:hover { border-color: var(--gold); }
.ship-opt.is-checked { border-color: var(--gold); background: var(--tint); }
.ship-opt:focus-within { box-shadow: var(--ring); }
.ship-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold-ink); }
.ship-opt-text strong { display: block; color: var(--ink); }
.ship-opt-text small { display: block; font-size: 0.82rem; color: var(--muted); }
.ship-opt-price { text-align: right; white-space: nowrap; }
.ship-opt-price b { font-weight: 800; color: var(--ink); }
.ship-opt-price b.sum-free { color: var(--ok); }
.ship-opt-price s { margin-left: 4px; font-size: 0.82rem; color: var(--muted); }
.co-remote { margin: 12px 0 0; }
.co-notes { margin-top: 18px; }
.co-notes .textarea { min-height: 96px; }

.co-final { display: grid; gap: 10px; }
.co-pay { min-height: 54px; font-size: 1.02rem; }
.co-fine { margin: 0; font-size: 0.8rem; color: var(--muted); text-align: center; }
.co-fine a { color: var(--gold-ink); font-weight: 700; }

/* step 4: payment */
.co-secure-note { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 0.84rem; font-weight: 700; color: var(--muted); }
.co-secure-note svg { width: 16px; height: 16px; flex: none; color: var(--gold-ink); }
.co-bill-toggle { margin-top: 4px; }
.co-bill-fields { margin-top: 14px; }
.co-pay-actions { display: flex; gap: 10px; }
.co-pay-actions .co-pay { flex: 1; }
.co-pay-actions #coBack { flex: none; min-height: 54px; }

.co-errors { background: var(--surface); border-color: var(--sale); border-left-width: 4px; scroll-margin-top: calc(var(--header-h) + 16px); }
.co-errors-title { margin: 0 0 6px; font-size: 1rem; }
.co-errors ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.co-errors a { color: var(--sale); font-weight: 700; text-decoration: underline; }

.co-result { scroll-margin-top: calc(var(--header-h) + 16px); }
.co-result:focus { outline: none; }
.co-notice { padding: clamp(20px, 3vw, 30px); border-radius: var(--radius); background: var(--tint); border: 1px solid var(--gold-light); color: var(--ink-3); }
.co-notice h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: clamp(1.15rem, 2vw, 1.4rem); }
.co-notice h2 svg { width: 24px; height: 24px; flex: none; color: var(--gold-ink); }
.co-notice strong { color: var(--ink); }
.co-notice-actions, .track-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.co-notice .co-fine { text-align: left; }
.co-details { margin-top: 14px; }
.co-details summary { cursor: pointer; font-weight: 700; color: var(--gold-ink); }
.co-preview { margin: 10px 0 0; max-height: 340px; overflow: auto; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.co-sum-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.co-sum-head h2 { margin: 0; }
.co-sum-head .link-arrow { font-size: 0.88rem; }
.co-lines { list-style: none; margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.co-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.co-thumb { position: relative; width: 56px; height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; }
.co-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.co-thumb .q { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; }
.co-line-name { min-width: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.co-line-name a:hover { color: var(--gold-ink); }
.co-line-name small { display: block; margin-top: 2px; font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.co-line-total { font-weight: 700; color: var(--ink); white-space: nowrap; }

/* order confirmation (after "Place order") */
.co-confirm { max-width: 880px; margin: 0 auto; padding: clamp(28px, 4vw, 44px); text-align: center; scroll-margin-top: calc(var(--header-h) + 16px); }
.co-confirm:focus { outline: none; }
.co-confirm-ico { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.co-confirm-ico svg { width: 28px; height: 28px; }
.co-confirm h2 { margin-bottom: 8px; }
.co-confirm-sub { color: var(--muted); margin-bottom: clamp(24px, 4vw, 36px); }
.co-confirm-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 40px); text-align: left; }
.co-confirm-grid h3 { font-size: 0.95rem; margin: 18px 0 8px; }
.co-confirm-grid > div > h3:first-child { margin-top: 0; }
.co-confirm-grid .co-lines { text-align: left; }
.co-confirm-block { margin: 0 0 4px; color: var(--ink-3); line-height: 1.55; }
.co-confirm-block svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; color: var(--gold-ink); }
.co-confirm .co-notice-actions { justify-content: center; margin-top: clamp(28px, 4vw, 40px); }
.co-confirm .co-fine { margin-top: 14px; }

/* ==========================================================================
   Compare
   ========================================================================== */
.cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cmp-table { --label-w: 180px; --col-w: 230px; width: 100%; min-width: calc(var(--label-w) + var(--cols, 2) * var(--col-w)); border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 0.9rem; }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp-table tbody tr:last-child > * { border-bottom: 0; }
.cmp-table thead th { font-weight: 400; }
.cmp-table tbody th, .cmp-corner { position: sticky; left: 0; z-index: 1; width: var(--label-w); background: var(--bg); color: var(--ink); font-weight: 700; border-right: 1px solid var(--line); }
.cmp-table td { color: var(--ink-3); }
.cmp-table td a { color: var(--gold-ink); font-weight: 700; }
.cmp-prod { position: relative; display: grid; gap: 10px; }
.cmp-media { aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: var(--radius-sm); background: linear-gradient(160deg, var(--bg) 0%, var(--surface-2) 100%); }
.cmp-media { overflow: hidden; }
.cmp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-table .cmp-name { font-weight: 700; line-height: 1.35; color: var(--ink); }
.cmp-table .cmp-name:hover { color: var(--gold-ink); }
.cmp-remove { position: absolute; top: 8px; right: 8px; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.cmp-remove:hover { color: var(--sale); border-color: var(--sale); }
.cmp-remove svg { width: 15px; height: 15px; }
.cmp-price { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.cmp-price.is-sale { color: var(--sale); }
.cmp-table s { color: var(--muted); }
.cmp-na { color: var(--muted); }
.cmp-actions td { vertical-align: middle; }
.cmp-table .cmp-details { display: inline-block; margin-top: 8px; font-size: 0.85rem; }
.cmp-slot { vertical-align: top; }
.cmp-slot a { aspect-ratio: 1 / 1; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); text-align: center; font-weight: 700; color: var(--muted); transition: border-color 0.2s, color 0.2s; }
.cmp-slot a:hover { border-color: var(--gold); color: var(--gold-ink); }
.cmp-slot svg { width: 26px; height: 26px; }
.cmp-hint { display: none; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.cmp-diff { min-height: 36px; }

/* ==========================================================================
   Order tracking
   ========================================================================== */
.track-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1080px; }
.track-card h2, .track-help h2 { font-size: 1.35rem; }
.track-form { display: grid; gap: 16px; margin-top: 18px; }
.track-result { margin-top: 18px; }
.track-notice h3 { margin-bottom: 8px; }
.track-notice h3:focus { outline: none; }
.track-notice .co-fine { text-align: left; }
.help-list { list-style: none; margin: 16px 0 20px; padding: 0; display: grid; gap: 14px; }
.help-list li { display: flex; align-items: center; gap: 12px; }
.help-list .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--tint); color: var(--gold-ink); display: grid; place-items: center; }
.help-list .ico svg { width: 20px; height: 20px; }
.help-list li > span:last-child { min-width: 0; }
.help-list strong { display: block; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.help-list a, .help-list li > span:last-child > span { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.help-list a:hover { color: var(--gold-ink); }
.help-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .shop-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 22px; }
  .shop-grid.is-list .p-card { grid-template-columns: 170px minmax(0, 1fr) 180px; }
  .cart-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .cart-main .line-head { grid-template-columns: minmax(0, 1fr) 130px 92px 40px; gap: 14px; padding-inline: 16px; }
  .cart-line { grid-template-columns: 80px minmax(0, 1fr) 130px 92px 40px; gap: 12px 14px; padding: 16px; }
  .cart-line .line-media { width: 80px; height: 80px; }
  .co-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1024px) {
  /* filters become a slide-over panel */
  .shop-layout { grid-template-columns: minmax(0, 1fr); }
  .shop-filters { position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; width: min(380px, 90vw); max-height: none; border: 0; border-radius: 0; box-shadow: var(--shadow-lg); transform: translateX(-100%); visibility: hidden; transition: transform 0.3s var(--ease), visibility 0s linear 0.3s; }
  .shop-filters.is-open { transform: none; visibility: visible; transition: transform 0.3s var(--ease); }
  .f-head { padding: 12px 12px 12px 20px; }
  .f-close { display: grid; }
  .f-body { padding-inline: 20px; }
  .f-foot { display: block; padding: 14px 20px; border-top: 1px solid var(--line); }
  .shop-filter-btn { display: inline-flex; }

  .pd-layout { grid-template-columns: minmax(0, 1fr); }
  .pd-gallery { position: static; width: 100%; max-width: 560px; margin-inline: auto; }

  .cart-layout, .co-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .co-summary { order: -1; }
}

@media (max-width: 760px) {
  .shop-toolbar { padding: 10px; }
  .shop-count { flex: 1; text-align: right; font-size: 0.85rem; }
  .shop-tools { width: 100%; margin-left: 0; }
  .shop-sort { flex: 1; }
  .shop-sort label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shop-sort .select { width: 100%; }

  .shop-grid.is-list .p-card { grid-template-columns: 112px minmax(0, 1fr); align-items: start; padding: 10px; }
  .shop-grid.is-list .p-media { align-self: start; }
  .shop-grid.is-list .p-badges { display: none; }
  .shop-grid.is-list .p-tools { top: 6px; right: 6px; }
  .shop-grid.is-list .p-body { padding: 2px 2px 6px 12px; }
  .shop-grid.is-list .p-title { font-size: 0.92rem; }
  .shop-grid.is-list .p-short { font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .shop-grid.is-list .p-foot { grid-column: 2; padding: 0 2px 2px 12px; }

  .pd-price .now { font-size: 1.7rem; }
  .pd-buy .btn { flex-basis: 140px; }
  .pd-tabs.card { padding-inline: 14px; }
  .tab { flex: 1 1 auto; padding: 12px 8px; font-size: 0.86rem; line-height: 1.25; white-space: normal; text-align: center; }
  .tab[aria-selected="true"]::after { left: 6px; right: 6px; }
  .spec-table th, .spec-table td { padding: 10px 12px; }

  .line-head { display: none; }
  .line { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "media info remove" "media qty total"; gap: 10px 14px; padding: 16px; }
  .line .line-media { width: 76px; height: 76px; align-self: start; }
  .line-remove { align-self: start; justify-self: end; margin: -6px -6px 0 0; }
  .wl-line { grid-template-areas: "media info remove" "media add add"; }
  .cart-actions { justify-content: center; flex-direction: column-reverse; }

  .co-progress { font-size: 0.82rem; }
  .co-progress li + li::before { width: 16px; }
  .co-notice-actions .btn, .track-actions .btn { flex: 1 1 100%; }
  .ship-opt { padding: 12px 14px; }
  .co-pay-actions { flex-direction: column-reverse; }
  .co-pay-actions .btn { flex: 1 1 auto; }
  .co-confirm { padding: 24px 18px; }
  .co-confirm-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .list-toolbar-actions { width: 100%; }
  .cmp-table { --label-w: 112px; --col-w: 172px; font-size: 0.85rem; }
  .cmp-table th, .cmp-table td { padding: 12px; }
  .cmp-hint { display: block; }

  .track-layout { grid-template-columns: minmax(0, 1fr); }
  .b-search { flex-direction: column; }
}
