/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Structural tokens and neutral fallbacks. Brand colors live in ~/themes/{ActiveTheme}/theme.css */
:root {
    --color-primary:   #333333;
    --color-primary-d: #1a1a1a;
    --color-accent:    #e8e8e8;
    --color-text:      #1f1f1f;
    --color-muted:     #6c757d;
    --color-bg:        #f5f5f5;
    --color-white:     #ffffff;
    --color-border:    #e0e0e0;
    --color-danger:    #dc3545;
    --radius:          6px;
    --shadow:          0 2px 8px rgba(0,0,0,.08);
    --max-width:       1200px;
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .45rem 1.1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-d); border-color: var(--color-primary-d); color: #fff; text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: #fff; text-decoration: none; }
.btn-sm { padding: .25rem .65rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.6rem; font-size: 1rem; }
.btn-block { display: block; width: 100%; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.form-control {
    width: 100%;
    padding: .45rem .75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .95rem;
    background: var(--color-white);
    transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--color-primary); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand--logo { display: flex; align-items: center; }
.site-logo-svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-header-products { align-items: flex-end; }
.product-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 100%;
    justify-content: flex-end;
}
.product-sort-select {
    width: auto;
    min-width: 11rem;
}
@media (max-width: 640px) {
    .product-toolbar { justify-content: stretch; }
    .product-toolbar .search-input-wrap { flex: 1 1 100%; }
}

/* ── Product catalog (filters + grid) ─────────────────────────────────────── */
.product-catalog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.product-catalog-layout--with-filters {
    grid-template-columns: minmax(220px, 280px) 1fr;
}

/* The panel itself is the scroll container (simple + robust — no nested flex
   height chains). The head is sticky to the top of that scroll, so Apply/Clear
   stay visible no matter how far the filter list is scrolled.
   --catalog-header-h is measured by JS from the sticky, variable-height theme
   header (logo row + nav row + optional alert/admin bars) so the panel pins just
   below it and its height never overflows the viewport. The mobile overrides
   live AFTER this rule (source order) so they reliably win at <= 960px. */
.catalog-filters {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0 1rem 1.25rem;   /* no top padding — the sticky head owns the top */
    position: sticky;
    top: calc(var(--catalog-header-h, 5.5rem) + 1rem);
    align-self: start;
    max-height: calc(100vh - var(--catalog-header-h, 5.5rem) - 2rem);
    overflow-y: auto;
}

.catalog-filters--collapsed .catalog-filters-form,
.catalog-filters--collapsed .catalog-filters-actions {
    display: none;
}

.catalog-filters-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-white);
    /* full-bleed over the panel's horizontal padding so rows scroll cleanly
       behind it; provides the top padding the panel itself drops */
    margin: 0 -1rem 0.75rem;
    padding: 1rem 1rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
}

.catalog-filters-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Collapsed (mobile, closed): just the title + toggle, no sticky, no border. */
.catalog-filters--collapsed .catalog-filters-head {
    position: static;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.catalog-filters-title {
    font-weight: 800;
    font-size: 1rem;
}

.catalog-filters-toggle {
    border: 1px solid var(--color-border);
    background: #fafafa;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.catalog-filter-block {
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0 0.75rem;
}

.catalog-filter-block:last-of-type {
    border-bottom: none;
}

.catalog-filter-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0;
}

.catalog-filter-summary::-webkit-details-marker {
    display: none;
}

.catalog-filter-summary::after {
    content: " −";
    float: right;
    font-weight: 400;
    opacity: 0.5;
}

.catalog-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    padding: 0.25rem 0;
    cursor: pointer;
}

.catalog-filter-label {
    flex: 1;
}

.catalog-filter-count {
    min-width: 1.75rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-muted);
    background: #f0f0f0;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}

.catalog-filter-price-range {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0.35rem 0 0.5rem;
}

.catalog-filter-price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.catalog-filter-price-inputs label {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.catalog-filter-hint {
    font-size: 0.72rem;
    color: var(--color-muted);
    margin: 0.35rem 0 0;
}

/* Lives in the sticky head, so Apply/Clear are always on screen. */
.catalog-filters-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

/* Mobile overrides — placed AFTER the desktop rules above so they win on equal
   specificity at <= 960px (media queries don't add specificity; source order
   decides). */
@media (max-width: 960px) {
    .product-catalog-layout--with-filters {
        grid-template-columns: 1fr;
    }
    /* Mobile = plain inline panel in normal document flow. NO fixed overlay and
       NO body scroll-lock — that machinery is what trapped scrolling. Closed
       shows just the toggle; open reveals the filters inline and the page scrolls
       normally with products below. Nothing is positioned, so nothing can overlap
       or block touch scroll. */
    .catalog-filters {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        padding: 0 1rem 1rem;
    }
    /* Head not sticky on mobile: a sticky child in normal flow would slide behind
       the taller, higher-z-index theme header. Keep it inline. */
    .catalog-filters-head {
        position: static;
    }
    .catalog-filters-toggle {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }
}

/* Desktop: filters are always open and there's no space to save, so the
   show/hide toggle is pointless — hide it. It exists only for mobile. */
@media (min-width: 961px) {
    .catalog-filters-toggle {
        display: none;
    }
}

.catalog-main {
    min-width: 0;
}

.catalog-main .page-header-products {
    margin-bottom: 1rem;
}

.catalog-result-count {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0 0 1rem;
}

.catalog-product-grid {
    margin-top: 0;
}

.site-nav { display: flex; gap: 1.25rem; flex: 1; }
.nav-link { font-weight: 500; color: var(--color-text); font-size: .95rem; }
.nav-link:hover { color: var(--color-primary); text-decoration: none; }
.nav-cart { position: relative; }
.site-cart-summary.nav-cart {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}
.nav-cart-ico { font-size: 1.05rem; line-height: 1; }
.nav-cart-label { font-weight: 600; }
.nav-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0 .35rem;
    height: 1.35rem;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    transform-origin: center center;
}
.nav-cart-sub {
    font-size: .78rem;
    color: var(--color-muted);
    font-weight: 500;
    margin-left: .15rem;
}
.site-nav-user { display: flex; align-items: center; gap: 1rem; white-space: nowrap; }
.user-greeting { font-size: .9rem; color: var(--color-muted); }

/* ── Main / layout ────────────────────────────────────────────────────────── */
.site-main { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem; min-height: 70vh; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--color-border); background: var(--color-white); margin-top: 3rem; }
.site-footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 1rem 1.5rem; color: var(--color-muted); font-size: .85rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #9b6e8a 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
}
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: .75rem; }
.hero p  { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: .9; }

/* ── Section titles ───────────────────────────────────────────────────────── */
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.page-header {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.75rem; font-weight: 700; flex: 1; }

/* ── Product grid ─────────────────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column;
    position: relative;
    isolation: isolate;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.product-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.product-card-img-wrap {
    display: block;
    position: relative;
    z-index: 0;
    overflow: hidden;
    height: 200px;
    background: var(--color-bg);
}
.product-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}
/* OOS: dim imagery + title area; footer (price + status) stays full strength */
.product-card--oos .product-card-img-wrap,
.product-card--oos .product-info {
    opacity: 0.5;
}
.product-card-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.product-info {
    padding: .9rem 1rem .4rem;
    display: flex; flex-direction: column; gap: .35rem; flex: 1;
    position: relative;
    z-index: 0;
}
.product-name { font-weight: 600; color: var(--color-text); font-size: .95rem; }
.product-category { font-size: .8rem; color: var(--color-muted); }
.product-price { font-weight: 700; color: var(--color-primary); font-size: 1rem; }
.product-card-footer {
    position: relative;
    padding: .4rem 1rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.product-card-atc {
    display: inline-flex;
    justify-content: center;
    align-self: center;
    position: relative;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.product-card-atc .btn {
    position: relative;
    z-index: 1;
}
/* Invisible hit slop — same visual size as .btn-sm; ::after receives clicks as part of the button. */
.product-card-atc .btn::after {
    content: "";
    position: absolute;
    inset: -.42rem -.55rem;
    border-radius: inherit;
}
.product-card:hover .product-card-atc {
    opacity: 1;
    pointer-events: auto;
}
.product-card-oos-msg {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-muted);
    text-align: center;
    margin: 0.15rem 0 0;
    padding: 0.2rem 0 0.15rem;
}

/* ── Product detail ───────────────────────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 640px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail-image {
    position: relative;
}
.product-detail-image img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.product-detail-media { display: flex; flex-direction: column; gap: .9rem; }
.product-detail-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.product-detail-thumb {
    padding: 0;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
    cursor: pointer;
    line-height: 0;
    overflow: hidden;
    transition: border-color .15s ease;
}
.product-detail-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}
.product-detail-thumb:hover { border-color: var(--color-muted); }
.product-detail-thumb--active { border-color: var(--color-primary); }
.product-detail--oos .product-detail-image {
    opacity: 0.5;
}
.product-unavailable-msg {
    margin: 0.25rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    background: #f5f0f0;
    border: 1px solid #e8d4d4;
    color: #6b2a2a;
    font-size: 0.92rem;
    font-weight: 600;
}
.product-detail-body { display: flex; flex-direction: column; gap: .75rem; }
.breadcrumb-nav { font-size: .85rem; color: var(--color-muted); }
.product-price-large { font-size: 1.75rem; font-weight: 700; color: var(--color-primary); }
.product-desc { color: var(--color-muted); line-height: 1.7; }
.add-to-cart-form { margin-top: .5rem; }
.qty-row { display: flex; align-items: center; gap: .75rem; }
.qty-input { width: 80px; }

/* ── Related product bubbles ──────────────────────────────────────────────── */
.related-products { margin-top: .5rem; }
.related-products-label { font-size: .85rem; color: var(--color-muted); margin-bottom: .6rem; }
.related-products-label strong { color: var(--color-text); }
.related-bubbles { display: flex; flex-wrap: wrap; gap: .45rem; }
.related-bubble {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: block;
    flex-shrink: 0;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.related-bubble:hover,
.related-bubble:focus-visible {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    text-decoration: none;
}
.related-bubble--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}
/* Circle crop lives on the img (not overflow:hidden on the anchor) so the
   tooltip pseudo-elements below aren't clipped. */
.related-bubble img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* Instant CSS tooltip — replaces the native title attribute, which shows
   only after the OS hover delay and can't be styled. */
.related-bubble::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translate(-50%, 4px);
    background: rgba(28, 28, 32, .94);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    padding: .4rem .65rem;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 20;
}
.related-bubble::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translate(-50%, 4px);
    border: 6px solid transparent;
    border-top-color: rgba(28, 28, 32, .94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 20;
}
.related-bubble:hover::after,
.related-bubble:hover::before,
.related-bubble:focus-visible::after,
.related-bubble:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-form { display: flex; gap: .5rem; flex: 1; max-width: 400px; }
.search-input { flex: 1; }

/* Search field with an inline clear (×). Wrapper owns the flex sizing so the
   button can be absolutely positioned over the input's trailing edge. */
.search-input-wrap { position: relative; flex: 1; display: flex; }
.search-input-wrap .search-input { width: 100%; padding-right: 2rem; }
.search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}
.search-clear:hover { color: var(--color-primary); }
.search-clear[hidden] { display: none; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text);
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.pagination-btn:hover { background: #f5f5f5; border-color: var(--modern-teal); }
.pagination-btn--active {
    background: var(--modern-teal);
    border-color: var(--modern-teal);
    color: #fff;
    cursor: default;
}
.pagination-btn--disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem;
    color: var(--color-muted);
    font-size: 0.875rem;
}

/* ── Auth card ────────────────────────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding: 3rem 1rem; }
.auth-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    width: 100%; max-width: 420px;
}
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; text-align: center; }
.alert-danger { background: #f8d7da; border: 1px solid #f5c2c7; color: #842029; padding: .65rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.site-main > .checkout-layout {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.checkout-layout {
    padding-bottom: 2rem;
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 900px) {
    .checkout-layout {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
        align-items: start;
    }
}
.checkout-summary-panel,
.checkout-main-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.checkout-section-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; }

/* Collapsible order-summary header: title + product-list toggle. */
.checkout-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.checkout-summary-head .checkout-section-title { margin-bottom: 0; }
.checkout-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    color: var(--color-primary);
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}
.checkout-summary-toggle:hover { background: var(--color-bg); }
.checkout-summary-chevron { transition: transform 0.15s ease; }
/* Expanded = chevron points up; collapsed (default) points down. */
.checkout-summary-toggle[aria-expanded="true"] .checkout-summary-chevron {
    transform: rotate(180deg);
}
/* Collapse only the products; totals (tfoot) and gift card stay visible. */
.checkout-order-table.is-collapsed thead,
.checkout-order-table.is-collapsed tbody { display: none; }

.checkout-order-table-wrap { margin-bottom: 1rem; overflow-x: auto; }
.checkout-order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.checkout-order-table th,
.checkout-order-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.checkout-order-table th { font-weight: 700; background: var(--color-bg); }
.checkout-order-table tfoot td { border-bottom: none; }
.checkout-order-table .checkout-num { text-align: right; white-space: nowrap; }
.checkout-total-label { font-weight: 600; text-align: right; }
.checkout-total-value { font-weight: 700; color: var(--color-primary); }
.checkout-order-table .checkout-total-row .checkout-total-label,
.checkout-order-table .checkout-total-row .checkout-total-value {
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-border);
}
.checkout-back-link { margin-top: 0.25rem; }
.checkout-form-grid {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: 1fr 1fr;
}
/* `display:grid` above would otherwise override the [hidden] attribute, so the
   billing manual-entry fields could never collapse when a saved address is picked. */
.checkout-form-grid[hidden] { display: none; }
.checkout-span-2 { grid-column: 1 / -1; }
.checkout-optional { font-weight: 400; color: var(--color-muted); font-size: 0.85rem; }
.checkout-auth-alt { margin-top: 1rem; font-size: 0.9rem; color: var(--color-muted); text-align: center; }
.checkout-signed-in-lead { margin-bottom: 1rem; color: var(--color-muted); }
.checkout-complete p { color: var(--color-muted); margin: 0; }
.checkout-payment-step { max-width: 32rem; }
.checkout-payment-lead { margin: 0 0 1rem; color: var(--color-muted); }
.checkout-payment-form { margin-top: 0.5rem; }
.checkout-payment-options {
    border: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.checkout-payment-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--color-surface);
}
.checkout-payment-option:has(input:checked) {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.checkout-payment-option input { margin: 0; }
.checkout-payment-option-label { font-weight: 600; }

/* Checkout left column: order summary with the shipping card stacked beneath it */
.checkout-side { display: flex; flex-direction: column; gap: 1.5rem; }
.checkout-side .checkout-summary-panel,
.checkout-side .checkout-main-panel { margin: 0; }

/* Shipping method selection */
.checkout-subsection-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.6rem; }
.checkout-shipping-form { margin: 0; }
.checkout-shipping-options {
    border: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.checkout-shipping-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--color-surface);
}
.checkout-shipping-option:has(input:checked) {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.checkout-shipping-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.55;
}
.checkout-shipping-option input { margin: 0; }
.checkout-shipping-option-name { font-weight: 600; }
.checkout-shipping-option-price { margin-left: auto; font-weight: 600; }
.checkout-shipping-option-note {
    flex-basis: 100%;
    margin-left: 1.8rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Payment iframe embed — no box of its own so it blends into the payment card */
.checkout-payment-iframe-wrap {
    position: relative;           /* anchor for the absolute loading overlay */
}
/* Overlay sits on top of the iframe; hidden via JS once iframe loads */
.checkout-payment-iframe-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.9rem;
}
.checkout-payment-iframe-loading p { margin: 0; }
/* iframe starts invisible; fades in after load event */
.checkout-payment-iframe {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 400px;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.checkout-payment-iframe.is-loaded { opacity: 1; }
.checkout-payment-security-note {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}
.checkout-payment-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
}
.checkout-payment-result[hidden] { display: none; }
.checkout-payment-result--error {
    background: #fdecec;
    border: 1px solid #f3c0c0;
    color: #b42318;
}
.checkout-payment-result--success {
    background: #eafaf1;
    border: 1px solid #b7e4c7;
    color: #1b7f4b;
}
.checkout-payment-result-msg { margin: 0; font-size: 0.95rem; }
.checkout-stripe-element {
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: var(--color-surface);
}
.checkout-stripe-error { color: #b42318; margin: 0 0 1rem; font-size: 0.9rem; }
/* Confirmation page */
.checkout-confirmation-wrap {
    max-width: 38rem;
    margin: 0 auto;
}
.checkout-confirmation-card {
    text-align: center;
}
.checkout-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    margin-bottom: 1.25rem;
}
.checkout-confirmation-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}
.checkout-confirmation-lead {
    font-size: 1rem;
    color: var(--color-muted);
    margin: 0 0 1.75rem;
}
.checkout-confirmation-details {
    display: grid;
    gap: 0;
    margin: 0 0 1.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-align: left;
}
.checkout-confirmation-row {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.checkout-confirmation-row:last-child { border-bottom: none; }
.checkout-confirmation-row:nth-child(even) { background: var(--color-bg, #f9fafb); }
.checkout-confirmation-details dt {
    margin: 0;
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.88rem;
    align-self: center;
}
.checkout-confirmation-details dd {
    margin: 0;
    font-weight: 500;
    align-self: center;
}
.checkout-confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
@media (max-width: 480px) {
    .checkout-confirmation-actions { flex-direction: column; }
    .checkout-confirmation-actions .btn { width: 100%; text-align: center; }
}
@media (max-width: 540px) {
    .checkout-form-grid { grid-template-columns: 1fr; }
    .checkout-span-2 { grid-column: auto; }
}
.checkout-promo {
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.checkout-promo-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.checkout-promo-alert {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.checkout-promo-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: var(--radius-sm);
}
.checkout-promo-success strong {
    font-weight: 700;
}
.checkout-loyalty-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-sm);
    color: #6b5300;
    font-size: 0.875rem;
}
/* display:flex above would otherwise override the [hidden] attribute the JS
   toggles when a reward is applied/removed — make the attribute win. */
.checkout-loyalty-note[hidden] {
    display: none;
}
.checkout-loyalty-icon {
    color: #f0ad00;
    font-size: 1rem;
    line-height: 1;
}
.checkout-loyalty-rewards {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.checkout-loyalty-reward {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.checkout-loyalty-reward-desc {
    font-size: 0.875rem;
}
.checkout-loyalty-reward-cost {
    margin-left: 0.4rem;
    font-weight: 600;
    color: #6b5300;
    white-space: nowrap;
}
.checkout-loyalty-applied {
    margin-left: 0.4rem;
    font-weight: 600;
    color: #155724;
    white-space: nowrap;
}
.checkout-loyalty.is-busy,
.checkout-promo.is-busy,
.checkout-shipping-form.is-busy {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
}
.checkout-loyalty.is-busy::after,
.checkout-promo.is-busy::after,
.checkout-shipping-form.is-busy::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5rem;
    height: 1.5rem;
    margin: -0.75rem 0 0 -0.75rem;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: #6b5300;
    border-radius: 50%;
    animation: checkout-loyalty-spin 0.7s linear infinite;
}
@keyframes checkout-loyalty-spin {
    to { transform: rotate(360deg); }
}
.checkout-address-picker {
    margin-bottom: 1rem;
}
.checkout-address-picker-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.checkout-free-order {
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--radius-sm);
}
.checkout-free-order-msg {
    margin: 0 0 0.75rem;
    color: #155724;
}
.checkout-promo-row {
    display: flex;
    gap: 0.5rem;
}
.checkout-promo-row .form-control {
    flex: 1;
    min-width: 0;
}
.checkout-promo-applied {
    list-style: none;
    padding: 0;
    margin: 0.65rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.checkout-promo-chip-form {
    display: inline-flex;
    align-items: stretch;
    margin: 0;
    border-radius: 999px;
    background: #eef6f6;
    overflow: hidden;
}
.checkout-promo-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.checkout-promo-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.checkout-promo-chip-remove:hover {
    color: var(--color-text);
    background: #e2ecec;
}
.checkout-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.25rem;
}
.checkout-auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--color-muted);
    text-decoration: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    cursor: pointer;
    font: inherit;
}
.checkout-auth-tab:hover { color: var(--color-text); }
.checkout-auth-tab.is-active {
    color: var(--color-text);
    border-bottom-color: var(--color-primary, #0d6efd);
}
.checkout-auth-lead { margin: 0 0 1rem; color: var(--color-muted); font-size: 0.95rem; }
.checkout-auth-form .form-group { margin-bottom: 1rem; }
.checkout-signed-in .checkout-next-step {
    margin-top: 0.75rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ── Cart ─────────────────────────────────────────────────────────────────── */
.site-main > .cart-page-stack {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.cart-layout {
    display: grid;
    gap: 1.5rem;
    padding-bottom: 2rem;
}
@media (min-width: 900px) {
    .cart-layout {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
        align-items: start;
    }
    .cart-summary-panel {
        position: sticky;
        top: 1rem;
    }
}

.cart-items-panel,
.cart-summary-panel,
.cart-empty-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.cart-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.cart-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}
.cart-item:first-child { padding-top: 0; }
.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item-info {
    flex: 1 1 12rem;
    min-width: 0;
}
.cart-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}
a.cart-item-name-link {
    color: inherit;
    text-decoration: none;
}
a.cart-item-name-link:hover,
a.cart-item-name-link:focus-visible {
    text-decoration: underline;
}
.cart-item-unit {
    display: block;
    font-size: 0.82rem;
    color: var(--color-muted);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    flex: 0 0 auto;
}

.cart-item-line-total {
    flex: 0 0 auto;
    min-width: 5rem;
    text-align: right;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
    white-space: nowrap;
}

.cart-item-remove-form { margin: 0; flex: 0 0 auto; }
.cart-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface, #fff);
    color: var(--color-danger, #c62828);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.cart-item-remove:hover {
    background: #fdecec;
    border-color: var(--color-danger, #c62828);
}
.cart-item-remove svg { display: block; }

.cart-summary-rows { margin-bottom: 1.25rem; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
}
/* `display:flex` above would override the [hidden] attribute, so discount / gift
   card / tax rows could never collapse when not applicable. */
.cart-summary-row[hidden] { display: none; }
.cart-summary-label { font-weight: 500; color: var(--color-text); }
.cart-summary-value { font-weight: 600; text-align: right; }
.cart-summary-row--total {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}
.cart-summary-row--total .cart-summary-label,
.cart-summary-row--total .cart-summary-value {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-primary);
}

.cart-checkout-btn {
    margin-bottom: 0.75rem;
    text-align: center;
}
.cart-continue-link {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-muted);
    text-decoration: none;
}
.cart-continue-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
/* Locked while a promo/loyalty AJAX request is in flight (set via JS). */
.cart-checkout-btn.is-disabled,
.cart-continue-link.is-disabled {
    pointer-events: none;
    opacity: 0.55;
    cursor: default;
}

.cart-empty-panel {
    text-align: center;
    padding: 3rem 1.5rem;
    box-shadow: var(--shadow);
}
.cart-empty-panel p {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--color-muted);
}

.cart-merge-notice {
    position: relative;
    margin: 0 0 1rem;
    padding: .75rem 2rem .75rem 1rem;
    background: #fff8e6;
    border: 1px solid #e8c547;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: .875rem;
    line-height: 1.45;
    cursor: pointer;
}

.cart-merge-notice-title {
    margin: 0 0 .35rem;
    font-weight: 700;
    font-size: .9rem;
}

.cart-merge-notice-lead {
    margin: 0 0 .4rem;
    font-size: .85rem;
    color: var(--color-muted);
}

.cart-merge-notice-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .85rem;
}

.cart-merge-notice-list li {
    margin-bottom: .2rem;
}

.cart-merge-notice-list li:last-child {
    margin-bottom: 0;
}

.cart-merge-notice-close {
    position: absolute;
    top: .4rem;
    right: .45rem;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    opacity: .65;
}

.cart-merge-notice-close:hover,
.cart-merge-notice-close:focus {
    opacity: 1;
    background: rgba(0, 0, 0, .06);
    outline: none;
}

.cart-tax-placeholder {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--color-muted, #6b7280);
    font-style: italic;
}
.inline-form { display: flex; align-items: center; gap: .4rem; }
.qty-input-sm { width: 4rem; min-width: 0; }

@media (max-width: 540px) {
    /* Name on its own line; qty / total / remove wrap beneath it. */
    .cart-item-info { flex-basis: 100%; }
    .cart-item-line-total { margin-left: auto; }
}

/* ── Add-to-Cart modal ────────────────────────────────────────────────────── */
.atc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: atc-fade-in .15s ease;
}
.atc-modal-overlay[hidden] {
    display: none !important;
}
@keyframes atc-fade-in { from { opacity: 0; } to { opacity: 1; } }
.atc-modal-box {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 2rem 2.25rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    animation: atc-slide-up .18s ease;
}
@keyframes atc-slide-up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.atc-modal-title {
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-muted);
    margin-bottom: .35rem;
}
.atc-modal-product {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}
.atc-modal-product--muted {
    color: var(--color-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}
.atc-modal-box--loading .atc-modal-product--muted {
    margin-bottom: 1.25rem;
}
.atc-modal-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: atc-spin .7s linear infinite;
}
@keyframes atc-spin { to { transform: rotate(360deg); } }
.atc-fly-thumb {
    position: fixed;
    z-index: 1100;
    transform-origin: center center;
    pointer-events: none;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    will-change: transform, opacity;
}
.atc-cart-badge-pop {
    animation: atc-badge-pop 0.45s ease;
}
@keyframes atc-badge-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.atc-modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Add-to-Cart configurator (optional products) ─────────────────────────── */
.atc-config-box {
    max-width: 560px;
    text-align: left;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}
.atc-config-close {
    position: absolute;
    top: .6rem;
    right: .75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
}
.atc-config-close:hover { color: var(--color-text); }
.atc-config-staged {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.atc-config-staged-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
}
.atc-config-staged-item + .atc-config-staged-item {
    border-top: 1px solid var(--color-border);
}
.atc-config-staged-item img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.atc-config-staged-name {
    flex: 1;
    font-weight: 600;
    font-size: .92rem;
}
.atc-config-staged-qty {
    color: var(--color-muted);
    font-weight: 500;
}
.atc-config-staged-price {
    font-size: .9rem;
    color: var(--color-muted);
    white-space: nowrap;
}
.atc-config-unstage {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: .1rem .3rem;
}
.atc-config-unstage:hover { color: var(--color-danger, #dc2626); }
.atc-config-section { margin-bottom: 1rem; }
.atc-config-section-spinner { margin: .75rem auto; }
.atc-config-section-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    margin-bottom: .5rem;
}
.atc-config-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .6rem;
}
.atc-config-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
}
.atc-config-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}
.atc-config-card-name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.25;
}
.atc-config-card-price {
    font-size: .82rem;
    color: var(--color-muted);
}
.atc-config-card--added {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}
.atc-config-error {
    color: var(--color-danger, #dc2626);
    font-size: .9rem;
    margin: 0 0 .75rem;
}

/* ── Cart "You may also need" accessory strip ─────────────────────────────── */
.cart-accessories { margin-top: 1.5rem; }
.cart-accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .75rem;
    margin-top: .75rem;
}
.cart-accessory-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
}
.cart-accessory-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
}
.cart-accessory-link img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}
.cart-accessory-name {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.25;
}
.cart-accessory-price {
    font-size: .85rem;
    color: var(--color-muted);
}
.cart-accessory-form { display: flex; justify-content: center; }

/* ── Product detail "Alternative products" ────────────────────────────────── */
.alternative-products { margin-top: 1.75rem; }
.alternative-products-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    margin-bottom: .5rem;
}
.alternative-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .6rem;
}
.alternative-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.alternative-product-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.alternative-product-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}
.alternative-product-name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.25;
}
.alternative-product-price {
    font-size: .82rem;
    color: var(--color-muted);
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.no-products { color: var(--color-muted); padding: 2rem 0; }
.cta-login { text-align: center; padding: 3rem 1rem; font-size: 1.05rem; }
.featured { margin-top: 2rem; }

/* ── Offline page ─────────────────────────────────────────────────────────── */
.offline-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}
.offline-card {
    text-align: center;
    max-width: 480px;
}
.offline-emoji {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}
.offline-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-primary);
}
.offline-sub {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.7;
}
.offline-detail {
    font-size: .95rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

/* Odoo CMS pages rendered via /Site/Content */
.odoo-cms-page {
    max-width: var(--content-max-width, 1100px);
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
.odoo-cms-page-header h1 {
    margin-bottom: 1.25rem;
}
.odoo-cms-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.odoo-cms-subnav-link {
    color: var(--link-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}
.odoo-cms-subnav-link:hover {
    text-decoration: underline;
}
.odoo-cms-subnav-link.is-active {
    color: var(--text-color, #111827);
    font-weight: 600;
    text-decoration: underline;
}
.odoo-cms-page-body {
    line-height: 1.6;
}
.odoo-cms-page-body img {
    max-width: 100%;
    height: auto;
}
.odoo-cms-page-body a {
    color: var(--link-color, #2563eb);
    text-decoration: underline;
}
.odoo-cms-page-body .container,
.odoo-cms-page-body .container-fluid {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}
.odoo-cms-page-body .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}
.odoo-cms-page-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.odoo-cms-page-body table th,
.odoo-cms-page-body table td {
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}
.odoo-cms-page-body .s_table_of_content,
.odoo-cms-page-body .o_grid_item,
.odoo-cms-page-body section {
    margin-bottom: 1.5rem;
}

/* ── Cookie consent banner ────────────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.10);
    transform: translateY(0);
    transition: transform .3s ease, opacity .3s ease;
    opacity: 1;
}
.cookie-banner--hide {
    transform: translateY(100%);
    opacity: 0;
}
.cookie-banner__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-banner__text {
    flex: 1;
    font-size: .875rem;
    color: var(--color-muted);
    margin: 0;
}
.cookie-banner__link {
    color: var(--color-primary);
    text-decoration: underline;
    white-space: nowrap;
}
.cookie-banner__actions {
    display: flex;
    gap: .75rem;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .cookie-banner__inner { flex-direction: column; align-items: stretch; }
    .cookie-banner__actions { justify-content: flex-end; }
}

/* ── Newsletter signup modal ─────────────────────────────────────────────── */
body.nl-modal-open { overflow: hidden; }
.nl-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.nl-modal[hidden] { display: none; }
.nl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}
.nl-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    padding: 2rem 1.75rem 1.75rem;
    animation: nl-modal-in .25s ease;
}
@keyframes nl-modal-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nl-modal__close {
    position: absolute;
    top: .6rem;
    right: .75rem;
    border: none;
    background: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
}
.nl-modal__close:hover { color: var(--color-text); }
.nl-modal__title {
    margin: 0 0 .5rem;
    font-size: 1.4rem;
    color: var(--color-text);
}
.nl-modal__body {
    margin: 0 0 1.25rem;
    color: var(--color-muted);
    font-size: .95rem;
}
.nl-modal__label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--color-text);
}
.nl-modal__row {
    display: flex;
    gap: .5rem;
}
.nl-modal__row .form-control { flex: 1; }
.nl-modal__submit { flex-shrink: 0; }
.nl-modal__msg {
    margin: .75rem 0 0;
    font-size: .85rem;
}
.nl-modal__msg--ok  { color: var(--color-primary); }
.nl-modal__msg--err { color: var(--color-danger); }
@media (max-width: 480px) {
    .nl-modal__row { flex-direction: column; }
    .nl-modal__submit { width: 100%; }
}

/* Staff-only "Access Odoo Backend" bar (internal users only). */
.odoo-admin-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 6px 16px;
    background: #111;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.4;
}
.odoo-admin-bar__label { opacity: 0.7; }
.odoo-admin-bar__link {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    padding: 2px 10px;
}
.odoo-admin-bar__link:hover { background: rgba(255, 255, 255, 0.12); }
