/* ==========================================================================
   Storefront theme on top of Bootstrap 5.3 (CSS variables only, no build step)
   ========================================================================== */
:root {
    --brand: #1f3a5f;
    --brand-rgb: 31, 58, 95;
    --brand-dark: #152a46;
    --accent: #d9622b;
    --accent-rgb: 217, 98, 43;
    --ink: #1b1f24;
    --muted: #6b7280;
    --surface: #ffffff;
    --surface-alt: #f6f5f2;
    --line: #e7e5e0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05), 0 1px 3px rgba(17, 24, 39, .06);
    --shadow: 0 10px 30px -12px rgba(17, 24, 39, .18);

    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--brand-dark);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--surface);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius);
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}

body { -webkit-font-smoothing: antialiased; background: var(--surface); }
main { min-height: 60vh; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 700; letter-spacing: -.01em; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.bg-alt { background: var(--surface-alt); }
.section { padding: 3.5rem 0; }
.section-sm { padding: 2rem 0; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-title h2 { font-size: 1.5rem; margin: 0; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent); }

/* Buttons */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: .6rem 1.1rem; }
.btn-sm { padding: .35rem .75rem; }
.btn-lg { padding: .85rem 1.4rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #c0531f; --bs-btn-hover-border-color: #c0531f; --bs-btn-active-bg: #a94818; --bs-btn-active-color: #fff; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }

/* Forms */
.form-control, .form-select { border-radius: var(--radius-sm); padding: .6rem .85rem; border-color: var(--line); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--brand-rgb), .5); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.required::after { content: " *"; color: var(--bs-danger); }

/* Header */
.topbar { background: var(--brand); color: rgba(255, 255, 255, .85); font-size: .8rem; }
.topbar a { color: #fff; text-decoration: none; }
.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .navbar-brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.site-header .navbar-brand img { max-height: 40px; width: auto; }
.site-header .nav-link { font-weight: 600; color: var(--ink); }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand); }
.header-search { max-width: 420px; width: 100%; }
.header-search .form-control { background: var(--surface-alt); border-color: transparent; padding-left: 2.4rem; }
.header-search .bi-search { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); text-decoration: none; font-size: 1.25rem; }
.icon-btn:hover { background: var(--surface-alt); color: var(--brand); }
.cart-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cart-badge[data-count="0"] { display: none; }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #f3efe8 0%, #e9eef5 100%); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.hero p.lead { color: #4b5563; max-width: 34rem; }
.hero-media { border-radius: calc(var(--radius) * 1.5); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: #dfe5ee; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero.has-image-bg { color: #fff; background-size: cover; background-position: center; }
.trust-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.trust-item { display: flex; gap: .85rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.trust-item i { font-size: 1.5rem; color: var(--brand); }

/* Category tiles */
.category-tile { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); aspect-ratio: 1 / 1; text-decoration: none; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.category-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.category-tile img { width: 100%; height: 100%; object-fit: cover; }
.category-tile .label { position: absolute; inset: auto 0 0 0; padding: .9rem 1rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); color: #fff; font-weight: 700; }
.category-tile.no-image { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; text-align: center; padding: 1rem; }
.category-tile.no-image i { font-size: 2rem; color: var(--brand); }
.category-tile.no-image .label { position: static; background: none; color: var(--ink); padding: 0; }

/* Product card */
.product-card { position: relative; height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card .thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface-alt); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .thumb img { transform: scale(1.04); }
.product-card .body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-card .category { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.product-card .name { font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .name::after { content: ""; position: absolute; inset: 0; }
.product-card .badges { position: absolute; top: .65rem; left: .65rem; display: flex; gap: .35rem; z-index: 1; }
.placeholder-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b6b2a8; font-size: 2.5rem; }
.badge-sale { background: var(--accent); color: #fff; }
.badge-soft { background: rgba(var(--brand-rgb), .08); color: var(--brand); }
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }

.price { font-weight: 700; color: var(--ink); }
.price-sale { color: var(--accent); }
.price-old { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: .85em; }
.stock-indicator { font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.stock-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-in { color: #15803d; }
.stock-low { color: #b45309; }
.stock-out { color: #b91c1c; }

/* Product detail */
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); aspect-ratio: 1 / 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .5rem; margin-top: .75rem; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: var(--radius-sm); padding: 0; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface-alt); }
.gallery-thumbs button[aria-current="true"] { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.variant-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.variant-options .btn-check + .btn { border-color: var(--line); color: var(--ink); font-weight: 600; }
.variant-options .btn-check:checked + .btn { border-color: var(--brand); background: rgba(var(--brand-rgb), .06); color: var(--brand); }
.variant-options .btn-check:disabled + .btn { opacity: .45; text-decoration: line-through; }
.qty-input { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.qty-input button { border: 0; background: var(--surface-alt); width: 40px; font-size: 1.1rem; }
.qty-input input { width: 56px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.qty-input input::-webkit-outer-spin-button, .qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.product-description { white-space: pre-line; color: #374151; line-height: 1.7; }

/* Cart & checkout */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.25rem; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.cart-line { display: grid; grid-template-columns: 84px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.summary-total { border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .85rem; font-size: 1.1rem; font-weight: 800; }
.sticky-summary { position: sticky; top: 96px; }
.steps { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.steps .active { color: var(--brand); font-weight: 700; }

/* Empty / status */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .icon { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-alt); display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--brand); margin-bottom: 1rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { border-left-color: transparent; }

/* Footer */
.site-footer { background: #11161d; color: rgba(255, 255, 255, .72); font-size: .92rem; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.site-footer a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .social a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); font-size: 1.05rem; }

/* Toasts */
.toast-stack { position: fixed; z-index: 1090; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }

/* Account nav */
.account-nav .list-group-item { border: 0; border-radius: var(--radius-sm) !important; font-weight: 600; }
.account-nav .list-group-item.active { background: rgba(var(--brand-rgb), .08); color: var(--brand); }

@media (max-width: 767.98px) {
    .section { padding: 2.25rem 0; }
    .sticky-summary { position: static; }
    .product-card .body { padding: .75rem; }
    .mobile-checkout-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: .75rem 0; z-index: 1020; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Marketplace buttons on the product page */
.marketplace-btn { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--surface-alt); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line); font-weight: 600; padding: .45rem .9rem .45rem .5rem; border-radius: 999px; }
