/* ============================================================
   Shop — storefront, product page, cart page, checkout.
   Built on the Midnight Bazaar tokens; nothing here affects the
   payment result or admin pages except the shared top nav.
   ============================================================ */

/* --- Top nav (inside the site header) --- */
.topnav { display: flex; align-items: center; gap: 14px; }
.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.nav-link:hover { color: var(--color-text); }
.nav-link.active { color: var(--color-brand); }
.cart-link { position: relative; }
.cart-count {
    display: inline-block;
    min-width: 20px;
    padding: 2px 6px;
    margin-left: 2px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--color-text-inverse);
    background: var(--color-brand);
    border-radius: var(--radius-pill);
}
@media (max-width: 480px) {
    .topnav { gap: 10px; }
    .secure-badge { display: none; }
}

/* --- Compact shop top: products first. The brand statement now
       lives in the closing section below the grid, not at the top. --- */
.shop-top { margin-bottom: 18px; }
.shop-top h1, .shop-top .shop-title { font-size: 26px; text-align: left; margin-bottom: 4px; }
.shop-sub { color: var(--color-text-muted); margin: 0 0 16px; line-height: 1.5; }
.shop-count { color: var(--color-text-faint); font-size: 13px; margin: 12px 0 0; }

/* --- Brand closing section: the old hero, relocated below the products. --- */
.brand-close { text-align: center; margin: 44px 0 0; padding: 32px 16px 0; border-top: 1px solid var(--color-border); }
.brand-close h2, .brand-close h1 { font-size: 28px; margin: 0 0 10px; line-height: 1.2; }
.brand-close .hero-sub { margin: 0 auto 16px; }
.brand-close .hero-coins { justify-content: center; margin-bottom: 8px; }
@media (max-width: 640px) {
    .brand-close h2, .brand-close h1 { font-size: 24px; }
    .shop-top h1, .shop-top .shop-title { font-size: 22px; }
}

/* --- Search + category chips --- */
.shop-search { display: flex; gap: var(--space-2); margin: 0 0 14px; }
.shop-search input[type="search"] {
    flex: 1;
    padding: 11px 14px;
    font-size: var(--font-size-base);
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
}
.shop-search input[type="search"]:focus { border-color: var(--color-brand); box-shadow: 0 0 0 4px var(--color-brand-soft); }
.catchips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: 18px; }
.catchip {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    text-decoration: none;
}
.catchip:hover { color: var(--color-text); border-color: var(--color-text); }
.catchip.active { background: var(--color-brand); border-color: var(--color-brand); color: var(--color-text-inverse); }

/* --- Product grid + cards --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    text-align: left;
}
/* Two-up variant (checkout stablecoin choice). */
.coin-grid-two { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 921px) {
    /* Full desktop width: as many product columns as fit, so the
       grid fills the screen instead of leaving empty sides. */
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}
.product-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--color-border-strong); }
.product-card a.card-link { text-decoration: none; color: inherit; display: block; }
.product-art { position: relative; }
.product-art svg { width: 100%; height: auto; display: block; }
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-inverse);
    background: var(--color-brand);
    border-radius: var(--radius-pill);
}
.product-info { padding: 12px 14px 14px; }
.product-foot { padding-top: 0; }
.product-info h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.product-tagline { margin: 0 0 10px; font-size: 13px; color: var(--color-text-muted); line-height: 1.45; }
.product-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.product-price { font-size: 18px; font-weight: 800; }
.product-old { font-size: 13px; color: var(--color-text-faint); text-decoration: line-through; }
.product-stock { font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.product-stock.low { color: var(--color-warning); }
.product-stock.out { color: var(--color-danger); }
.add-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--color-text-inverse);
    background: var(--color-brand);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}
.add-btn:hover { filter: brightness(1.05); }
.add-btn:disabled { opacity: 0.5; cursor: default; }
.empty-shop { text-align: center; padding: 30px 10px; }

/* --- Product detail --- */
.product-detail {
    display: grid;
    gap: 20px;
    text-align: left;
}
@media (min-width: 720px) {
    .product-detail { grid-template-columns: 1fr 1fr; align-items: start; max-width: 1440px; margin-left: auto; margin-right: auto; }
}
.product-detail .product-art { border-radius: 18px; overflow: hidden; border: 1px solid var(--color-border); }
.product-detail .product-art svg { height: 100%; }
.product-detail h1 { font-size: 26px; }
.product-detail .product-price { font-size: 26px; }
.product-meta { color: var(--color-text-muted); font-size: 14px; margin: 0 0 6px; }
.product-desc { color: var(--color-text-muted); line-height: 1.6; margin: 12px 0 16px; }
.qty-row { display: flex; gap: var(--space-2); margin: 14px 0; }
.qty-row input[type="number"] { width: 76px; text-align: center; }
.qty-row .add-btn, .qty-row .paybtn { flex: 1; margin: 0; }
.related-title { margin: 26px 0 12px; font-size: 18px; text-align: left; }

/* --- Cart page --- */
.cart-line {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.cart-thumb { width: 64px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; }
.cart-thumb svg { width: 100%; height: 100%; display: block; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-info strong { display: block; font-size: 14px; line-height: 1.35; }
.cart-line-info span { font-size: 13px; color: var(--color-text-muted); }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.cart-qty button {
    width: 28px;
    height: 28px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
}
.cart-qty input { width: 44px; text-align: center; padding: 6px 4px; }
.cart-line-total { font-weight: 800; white-space: nowrap; }
.cart-remove {
    background: none;
    border: none;
    color: var(--color-text-faint);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
}
.cart-remove:hover { color: var(--color-danger); }
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 800;
    padding: 14px 0 4px;
}

/* --- Checkout order lines --- */
.order-lines { text-align: left; margin: 12px 0; }
.order-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.order-line span:first-child { color: var(--color-text-muted); }
.order-line strong { white-space: nowrap; }
.order-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 0;
    font-size: 18px;
    font-weight: 800;
}
.stable-note { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }

/* --- Footer links + policy pages --- */
.footer-links {
    display: flex;
    gap: 6px 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}
.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 13px;
}
.footer-links a:hover { color: var(--color-brand); }
.policy h2 { margin: 22px 0 6px; font-size: 17px; text-align: left; }
.policy p, .policy li { color: var(--color-text-muted); line-height: 1.65; text-align: left; }
.policy ul { margin: 6px 0 0; padding-left: 20px; }

/* --- Toast --- */
#toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    z-index: 50;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    background: #1c2333;
    border: 1px solid var(--color-brand);
    border-radius: var(--radius-pill);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    .product-card, .add-btn { transition: none; }
}

/* ============================================================
   Midnight Bazaar 2.0 — shop layer (2026-11-01): cards with
   real depth and a gold edge on hover, a sheen sweep across
   covers, gold prices, gradient buttons and chips, and a
   sticky action dock on the cart page (phones).
   ============================================================ */

.product-grid { gap: 16px; }

/* Card: layered glass tint + soft resting shadow. */
.product-card {
    border-radius: 20px;
    background: var(--glass-tint), var(--color-surface);
    box-shadow: var(--shadow-card-soft);
    transition: transform var(--dur) var(--ease-out), border-color var(--dur) ease, box-shadow var(--dur) ease;
}
/* Cover sheen: a light sweep that crosses on hover. */
.product-art { overflow: hidden; }
.product-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.13) 48%, transparent 64%);
    background-size: 260% 100%;
    background-position: 130% 0;
    transition: background-position 0.7s ease;
    pointer-events: none;
}
.product-art svg { transition: transform 0.5s var(--ease-out); }
@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-5px);
        border-color: var(--color-gold-line);
        box-shadow: var(--shadow-card-hover);
    }
    .product-card:hover .product-art::after { background-position: -30% 0; }
    .product-card:hover .product-art svg { transform: scale(1.04); }
}

/* Price wears gold — the number a buyer looks for first. */
.product-price { font-size: 19px; color: var(--color-brand); letter-spacing: -0.01em; }
.product-info h3 { letter-spacing: -0.01em; }

/* Badge + add button: the diagonal gold melt, with lift. */
.product-badge { background: var(--color-brand-grad-135); box-shadow: 0 4px 12px rgba(240, 185, 11, 0.35); }
.add-btn {
    background: var(--color-brand-grad-135);
    box-shadow: 0 6px 16px rgba(240, 185, 11, 0.22);
    transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, filter 0.15s ease;
}
@media (hover: hover) {
    .add-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(240, 185, 11, 0.32); filter: none; }
}
.add-btn:active { transform: scale(0.98); }

/* Category chips: active chip glows; hover warms toward gold. */
.catchip { transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
.catchip:hover { border-color: var(--color-gold-line); }
.catchip.active { background: var(--color-brand-grad-135); border-color: transparent; box-shadow: 0 6px 16px rgba(240, 185, 11, 0.28); }

/* Search: faint glass over the surface. */
.shop-search input[type="search"] { background: var(--glass-tint), var(--color-surface); }

/* Closing brand section: a short gold rule under the headline. */
.brand-close h2::after, .brand-close h1::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: var(--radius-pill);
    background: var(--color-brand-grad-135);
}

/* Cart page: on phones the actions dock to the bottom of the
   screen (frosted glass) so Checkout is always in thumb reach
   while the items scroll above it. */
@media (max-width: 640px) {
    #cartActions {
        position: sticky;
        bottom: 10px;
        z-index: 30;
        padding: 12px 12px 4px;
        background: rgba(10, 13, 20, 0.88);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border: 1px solid var(--color-border);
        border-radius: 18px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    }
}

/* Motion off means off — including every 2.0 transition. */
@media (prefers-reduced-motion: reduce) {
    .product-card, .add-btn, .catchip, .product-art svg, .product-art::after { transition: none; }
}

/* --- Quick-fix batch (2026-11-01, from the live-store review) --- */
/* Struck-through "was" prices: bigger and brighter so the saving reads. */
.product-old { font-size: 15px; font-weight: 600; color: #ccd5e3; }

/* Product page: Buy Now (gold .paybtn) leads; Add to Cart steps
   back to a quiet secondary so the two actions aren't twins.
   Grid cards keep their gold Add button — this scopes to the
   detail page's quantity row only. */
.product-detail .qty-row .add-btn {
    background: var(--glass-tint), var(--color-surface-muted);
    color: var(--color-text);
    border: 1.5px solid var(--color-border-strong);
    box-shadow: none;
}
@media (hover: hover) {
    .product-detail .qty-row .add-btn:hover { border-color: var(--color-gold-line); box-shadow: none; }
}

/* --- Round 3 (2026-11-01, digital-store review): save pills,
   what-you-receive box, agreement row, bigger cart steppers,
   savings line, calmer policy text. --- */
.save-pill {
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--color-success);
    background: var(--color-success-bg);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.receive-box {
    margin: 14px 0;
    padding: 14px 16px;
    text-align: left;
    background: var(--glass-tint), var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.receive-box strong { display: block; margin-bottom: 6px; }
.receive-box ul { margin: 0; padding-left: 18px; color: var(--color-text-muted); line-height: 1.6; font-size: 14px; }
.agree-row { text-align: left; font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }
.agree-row input { accent-color: var(--color-brand); width: 16px; height: 16px; vertical-align: -2px; }
.cart-qty button { width: 36px; height: 36px; font-size: 18px; }
.cart-save-row { text-align: right; font-weight: 700; color: var(--color-success); padding: 2px 0 0; }
.line-old, .cart-line-info s { color: var(--color-text-faint); font-weight: 500; }
.note-error { color: var(--color-danger); font-weight: 600; }
.policy p, .policy li { font-size: 15px; color: #c3ccd9; }

/* ============================================================
   IVORY LIGHT — shop layer: white cards on ivory, gold-dark
   prices, a white toast and a white mobile cart dock.
   ============================================================ */
.nav-link.active { color: var(--color-brand-text); }
.product-price { color: var(--color-brand-text); }
.product-old { color: #76705f; }
.policy p, .policy li { color: #44403c; }

#toast {
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(87, 70, 28, 0.22);
}

@media (max-width: 640px) {
    #cartActions {
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 14px 34px rgba(87, 70, 28, 0.20);
    }
}

/* ============================================================
   CART & CHECKOUT UX (2026-11-01): the pattern modern stores
   use — adding a product opens a slide-out mini cart with a
   Checkout button, a persistent cart bar keeps the total and
   Checkout within thumb reach while browsing, and both the
   cart and checkout pages carry a 3-step progress indicator.
   ============================================================ */

/* Header badge: a small pop when the count changes. */
@keyframes cartBadgePop {
    0% { transform: scale(1); }
    45% { transform: scale(1.45); }
    100% { transform: scale(1); }
}
.cart-count.pop { animation: cartBadgePop 0.35s ease; }

/* --- 3-step progress (cart + checkout pages) --- */
.checkout-steps {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 14px 0 20px;
    padding: 0;
    text-align: left;
}
.checkout-steps li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.checkout-steps li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: none;
    font-size: 11px;
    font-weight: 800;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
}
.checkout-steps li.is-current {
    color: var(--color-text-inverse);
    background: var(--color-brand-grad-135);
}
.checkout-steps li.is-current span { border-color: transparent; }
.checkout-steps li.is-done { color: var(--color-success); }
.checkout-steps li.is-done span { color: var(--color-success); border-color: var(--color-success); }
@media (max-width: 480px) {
    .checkout-steps li { font-size: 11.5px; gap: 5px; }
}

/* --- Persistent cart bar (browsing pages, cart not empty) --- */
.cart-bar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(87, 70, 28, 0.28);
}
.cart-bar[hidden] { display: none !important; }
.cart-bar-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    padding: 4px 10px;
    font-family: inherit;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}
.cart-bar-label { font-size: 14px; font-weight: 800; color: var(--color-text); }
.cart-bar-meta { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.cart-bar-checkout {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--color-text-inverse);
    background: var(--color-brand-grad-135);
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .cart-bar { left: 12px; right: 12px; bottom: 12px; }
    .cart-bar-main { flex: 1; }
}
body.has-cart-bar { padding-bottom: 84px; }
body.cart-drawer-open { overflow: hidden; }

/* --- Slide-out mini cart --- */
.cart-scrim {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(28, 25, 23, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cart-scrim.open { opacity: 1; }
.cart-scrim[hidden] { display: none !important; }
.mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: min(430px, 94vw);
    height: 100dvh;
    background: var(--color-surface);
    box-shadow: -18px 0 44px rgba(87, 70, 28, 0.30);
    transform: translateX(105%);
    transition: transform 0.28s var(--ease-out);
    text-align: left;
}
.mini-cart.open { transform: translateX(0); }
.mini-cart[hidden] { display: none !important; }
.mini-cart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 8px;
}
.mini-cart-head h2 { margin: 0; font-size: 20px; }
.mini-cart-eyebrow {
    margin: 0 0 2px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-success);
}
.mini-cart-close {
    width: 38px;
    height: 38px;
    flex: none;
    font-size: 22px;
    line-height: 1;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
}
.mini-steps {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 6px 18px 10px;
    padding: 0;
}
.mini-steps li {
    flex: 1;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: var(--color-text-faint);
    background: var(--color-surface-muted);
    border-radius: var(--radius-pill);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-steps li.is-current { color: var(--color-text-inverse); background: var(--color-brand-grad-135); }
.mini-cart-items { flex: 1; overflow-y: auto; padding: 4px 18px 10px; }
.mini-cart-loading, .mini-cart-empty { color: var(--color-text-muted); text-align: center; padding: 28px 0; }
.mini-line {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
.mini-thumb { width: 58px; height: 46px; flex: none; border-radius: 10px; overflow: hidden; }
.mini-thumb svg { width: 100%; height: 100%; display: block; }
.mini-line-info { flex: 1; min-width: 0; }
.mini-line-info strong { display: block; font-size: 14px; line-height: 1.35; }
.mini-line-info strong a { color: var(--color-text); text-decoration: none; }
.mini-line-info span { font-size: 13px; color: var(--color-text-muted); }
.mini-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mini-line-side strong { font-size: 14px; white-space: nowrap; }
.mini-qty button { width: 30px; height: 30px; font-size: 15px; }
.mini-qty input { width: 40px; }
.mini-cart-foot {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}
.mini-cart-foot[hidden] { display: none !important; }
.mini-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 14px;
    color: var(--color-text-muted);
}
.mini-row strong { color: var(--color-text); }
.mini-save, .mini-save strong { color: var(--color-success); }
.mini-checkout { margin-top: 10px; }
.mini-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}
.mini-cart-actions a { font-weight: 700; text-decoration: none; }
.mini-cart-actions button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.mini-cart-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--color-text-faint); }

/* --- Cart page: summary meta rows + a real checkout panel --- */
.cart-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--color-text-muted);
}
#cartActions {
    margin-top: 16px;
    padding: 16px;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    box-shadow: var(--shadow-card-soft);
}
.cart-actions-title { margin: 0; font-size: 16px; font-weight: 800; }
.cart-secure-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); }

/* --- Checkout page: section heading, trust line, sticky bar --- */
.checkout-heading { margin: 16px 0 4px; font-size: 16px; text-align: left; }
.checkout-trust { margin: 10px 0 0; font-size: 12.5px; color: var(--color-text-faint); }
.checkout-bar { display: none; }
@media (max-width: 760px) {
    .checkout-bar {
        position: fixed;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        z-index: 55;
        width: min(640px, calc(100% - 24px));
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border-strong);
        border-radius: 18px;
        box-shadow: 0 18px 40px rgba(87, 70, 28, 0.28);
    }
    .checkout-bar[hidden] { display: none !important; }
    .checkout-bar-total { display: flex; flex-direction: column; align-items: flex-start; }
    .checkout-bar-total span {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--color-text-faint);
    }
    .checkout-bar-total strong { font-size: 17px; white-space: nowrap; }
    .checkout-bar-btn { flex: 1; width: auto; margin-top: 0; }
    body:has(#checkoutBar:not([hidden])) { padding-bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
    .cart-count.pop { animation: none; }
    .cart-scrim, .mini-cart { transition: none; }
}

/* ============================================================
   STOREFRONT ROUND 2 (2026-11-01): icon nav tabs, landing-style
   product cards with admin-selectable style/density, a USP
   strip, a non-blocking "Added" notice (the mini cart no longer
   hijacks every add), a product-page sticky buy bar, recently
   viewed, and cart cross-sell cards.
   ============================================================ */

/* --- Nav tabs with icons --- */
.topnav { gap: 8px; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover { background: var(--color-surface-muted); }
.nav-link.active {
    color: var(--color-brand-text);
    background: var(--color-brand-soft);
    border-color: var(--color-gold-line);
}
.nav-icon { width: 18px; height: 18px; flex: none; }
.secure-badge { display: inline-flex; align-items: center; gap: 5px; }
.badge-icon { width: 13px; height: 13px; }
@media (max-width: 480px) {
    .nav-link { padding: 7px 10px; font-size: 13px; }
    .nav-icon { width: 16px; height: 16px; }
}

/* --- USP strip (homepage) --- */
.usp-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    margin: 0 0 16px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
}
.usp-strip span { display: inline-flex; align-items: center; gap: 6px; }
.usp-strip svg { width: 15px; height: 15px; flex: none; color: var(--color-brand-text); }

/* --- Landing-style product cards --- */
.product-card { display: flex; flex-direction: column; }
.product-card a.card-link { display: flex; flex-direction: column; flex: 1; }
.product-cat-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(10, 8, 4, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-pill);
}
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.card-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.card-chip svg { width: 11px; height: 11px; }
.chip-delivery { color: var(--color-brand-text); background: var(--color-brand-soft); }
.chip-stock.ok { color: var(--color-success); background: var(--color-success-bg); }
.chip-stock.low { color: var(--color-warning); background: var(--color-warning-bg); }
.chip-stock.out { color: var(--color-danger); background: rgba(220, 38, 38, 0.09); }
.product-price small { font-size: 12px; font-weight: 700; color: var(--color-text-faint); }
.product-foot { display: flex; align-items: stretch; gap: 8px; margin-top: auto; }
.add-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1; }
.add-btn svg { width: 17px; height: 17px; flex: none; }
.card-qty { display: flex; align-items: center; gap: 4px; }
.card-qty button {
    width: 26px;
    align-self: stretch;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
}
.card-qty input { width: 36px; text-align: center; padding: 6px 2px; }
.details-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    flex: none;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.details-btn svg { width: 18px; height: 18px; }
.details-btn:hover { border-color: var(--color-gold-line); color: var(--color-brand-text); }
@media (max-width: 480px) {
    .card-qty { display: none; }
}

/* Card style + grid density variants (Admin → Settings). */
.product-grid.grid-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) {
    .product-grid.grid-compact { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
}
.cards-compact .product-info { padding: 10px 12px 12px; }
.cards-compact .product-info h3 { font-size: 14px; }
.cards-compact .product-price { font-size: 17px; }
.cards-compact .product-tagline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cards-compact .card-qty { display: none; }
.cards-showcase .product-card { border-radius: 24px; box-shadow: var(--shadow-card); }
.cards-showcase .product-info { padding: 16px 18px 18px; }
.cards-showcase .product-info h3 { font-size: 17px; }
.cards-showcase .product-price { font-size: 22px; }
.cards-showcase .add-btn { padding: 13px; font-size: 15px; }

/* --- "Added" notice: confirmation without blocking the shop --- */
.added-notice {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translate(-50%, 16px);
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(540px, calc(100% - 24px));
    padding: 10px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(87, 70, 28, 0.30);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    text-align: left;
}
.added-notice.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.added-notice[hidden] { display: none !important; }
.added-thumb { width: 46px; height: 36px; flex: none; border-radius: 8px; overflow: hidden; }
.added-thumb svg { width: 100%; height: 100%; display: block; }
.added-info { flex: 1; min-width: 0; }
.added-info strong { display: block; font-size: 13.5px; }
.added-info span {
    display: block;
    font-size: 12.5px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.added-view {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    cursor: pointer;
    white-space: nowrap;
}
.added-checkout {
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 800;
    color: var(--color-text-inverse);
    background: var(--color-brand-grad-135);
    border-radius: var(--radius-pill);
    text-decoration: none;
    white-space: nowrap;
}
.added-close {
    padding: 2px 4px;
    font-size: 18px;
    line-height: 1;
    color: var(--color-text-faint);
    background: none;
    border: none;
    cursor: pointer;
}
@media (max-width: 640px) {
    .added-notice { bottom: 88px; }
}

/* Cart bar label icon. */
.cart-bar-label { display: inline-flex; align-items: center; gap: 6px; }
.cart-bar-label svg { width: 17px; height: 17px; }

/* --- Product page sticky buy bar (phones) --- */
.product-sticky-bar { display: none; }
@media (max-width: 760px) {
    .product-sticky-bar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 40;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px;
        background: var(--color-surface);
        border: 1px solid var(--color-border-strong);
        border-radius: 16px;
        box-shadow: 0 18px 40px rgba(87, 70, 28, 0.28);
    }
    .psb-price { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
    .psb-price strong { font-size: 15px; }
    .psb-price s { font-size: 12px; color: var(--color-text-faint); }
    .product-sticky-bar .add-btn { flex: 1; width: auto; }
    .product-sticky-bar .paybtn { flex: 1; width: auto; margin-top: 0; padding: 11px; }
    body.has-cart-bar .product-sticky-bar { display: none; }
    body:has(.product-sticky-bar) .page { padding-bottom: 96px; }
    body.has-cart-bar:has(.product-sticky-bar) .page { padding-bottom: 28px; }
}

/* --- Recently viewed strip --- */
.recent-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    text-align: left;
}
.recent-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 232px;
    padding: 8px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    text-decoration: none;
}
.recent-thumb { width: 54px; height: 42px; flex: none; border-radius: 8px; overflow: hidden; }
.recent-thumb svg { width: 100%; height: 100%; display: block; }
.recent-info strong { display: block; font-size: 13px; line-height: 1.3; }
.recent-info span { font-size: 12.5px; color: var(--color-text-muted); }

/* --- Cart page cross-sell --- */
.cross-sell { margin-top: 30px; text-align: left; }

@media (prefers-reduced-motion: reduce) {
    .added-notice, .nav-link { transition: none; }
}

/* ============================================================
   CARD LAYOUT FIXES (appended layer)
   Bugs found in review: custom-SVG covers rendered at their own
   aspect ratio and broke row alignment; price rows sat at
   different heights per card; the price row could overflow and
   clip the Save pill on narrow cards; badge and category chip
   could collide on small covers; long names/taglines stretched
   cards; the Add label wrapped on standard desktop cards
   (stepper + details left it ~88px); tablets got phone-width
   160px cards; sold-out cards looked identical to live ones.
   ============================================================ */

/* One cover box for every card: built-in art is 4:3, and a custom
   SVG with any other shape letterboxes neatly inside instead of
   changing the card's height. */
.product-art {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-surface-muted);
}
.product-art svg { width: 100%; height: 100%; }

/* Info is a flex column so the price row pins to the bottom of
   the info block — prices line up across a row no matter how
   long the name or tagline above them is. The row may wrap, so
   the Save pill drops below instead of being clipped. */
.card-link .product-info { display: flex; flex-direction: column; flex: 1; }
.product-price-row { margin-top: auto; flex-wrap: wrap; row-gap: 2px; }

/* Names and taglines clamp to two lines — one long admin-entered
   name can no longer stretch its card past its neighbours. */
.product-info h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-tagline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badge and category chip share the cover's top edge: neither
   may grow into the other on a narrow cover. */
.product-badge {
    max-width: 52%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-cat-chip {
    max-width: 44%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer sizing: a slightly slimmer stepper and a nowrap Add
   label give the button its full text back on standard cards;
   the ellipsis is a safety net, never a wrap. */
.card-qty button { width: 24px; }
.card-qty input { width: 30px; }
.product-foot .add-btn { font-size: 13.5px; padding-left: 6px; padding-right: 6px; }
.add-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compact density is for dense catalogs: quantity is chosen on
   the product page or in the cart, so the stepper leaves the
   card at every width (the Compact card STYLE already did). */
.product-grid.grid-compact .card-qty { display: none; }

/* Tablets get tablet-sized cards, not stretched phone cards. */
@media (min-width: 641px) and (max-width: 920px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }
}

/* Small phones: tighter card padding, and the details arrow
   leaves the footer (the whole card is already a link to the
   same page) so Add to cart gets the full row. */
@media (max-width: 640px) {
    .product-info { padding: 10px 10px 12px; }
    .product-foot { padding-top: 0; }
    .product-foot .details-btn { display: none; }
}

/* Sold-out cards read as unavailable at a glance. */
.product-card.is-sold-out .product-art svg { filter: grayscale(0.45); opacity: 0.72; }
.product-card.is-sold-out:hover { transform: none; }

/* Keyboard focus stays visible inside the card's clipped edge. */
.product-card a.card-link:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.card-qty button:focus-visible,
.details-btn:focus-visible,
.add-btn:focus-visible { outline: 2px solid var(--color-brand-text); outline-offset: 1px; }

/* ============================================================
   PHASE 2 EXTRAS (appended layer)
   Uploaded cover photos fill the same 4:3 cover box as the SVG
   art; FAQ accordions; the track-order form and result.
   ============================================================ */
.product-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card.is-sold-out .product-art img { filter: grayscale(0.45); opacity: 0.72; }

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 12px 16px;
    margin: 0 0 10px;
    text-align: left;
}
.faq-item summary { font-weight: 700; cursor: pointer; padding: 2px 0; }
.faq-item p { margin: 8px 0 4px; color: var(--color-text-muted); line-height: 1.6; }

.track-form {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 16px;
    margin: 14px 0;
    text-align: left;
}
.track-result {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 16px;
    margin: 14px 0;
    text-align: left;
}
.track-meta { list-style: none; margin: 10px 0; padding: 0; }
.track-meta li { margin: 4px 0; }

/* ============================================================
   PLATFORM HUB (appended layer)
   The /join checker row, /stores directory cards, and the admin
   provisioning pack steps.
   ============================================================ */
.check-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-row input { flex: 1 1 180px; }
.check-domain { color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; text-align: left; }
.store-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 16px;
}
.store-name { font-weight: 800; font-size: 17px; margin: 0 0 2px; }
.store-url { color: var(--color-gold-text); font-weight: 600; margin: 0 0 8px; font-size: 13.5px; }
.store-sells { color: var(--color-text-muted); line-height: 1.55; margin: 0 0 10px; font-size: 14.5px; }
.pack-steps { text-align: left; line-height: 1.65; padding-left: 22px; }
.pack-steps li { margin: 8px 0; }
