* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-attachment: fixed;
    color: #e8edf2;
    padding: 48px 24px 80px;
    line-height: 1.5;
}

/* Top loading bar */
#catalog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    z-index: 9999;
    display: none;
}

#catalog-progress-bar.active {
    display: block;
}

#catalog-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #4fc3ff, transparent);
    animation: scroll-loading 1.2s ease-in-out infinite;
}

@keyframes scroll-loading {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ---------- Store hero ---------- */
.store-hero {
    max-width: 1200px;
    margin: 0 auto 48px;
    text-align: left;
}

.store-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 18px;
    transition: opacity 0.2s ease;
}

.store-brand:hover {
    opacity: 0.85;
}

.store-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.store-brand__wordmark {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #e8edf2;
}

.store-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #4fc3ff;
    background: rgba(79, 195, 255, 0.1);
    border: 1px solid rgba(79, 195, 255, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    margin: 0 0 16px 12px;
    vertical-align: middle;
}

.store-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    color: #fff;
}

.store-hero p {
    font-size: 1.05rem;
    color: #9aa6b2;
    max-width: 640px;
}

/* ---------- Shelves ---------- */
.shelf {
    max-width: 1200px;
    margin: 0 auto 56px;
}

.shelf-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shelf-head h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.shelf-sub {
    font-size: 0.9rem;
    color: #7f8a95;
}

/* ---------- Product grid & card ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(79, 195, 255, 0.5);
    background: rgba(79, 195, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    outline: none;
}

.product-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card__media img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__media img {
    transform: scale(1.04);
}

.product-card__media--tile {
    background: linear-gradient(135deg, #1a2733, #0f1922);
}

.product-card__emoji {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.product-card__body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-card__body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.product-card__meta {
    font-size: 0.85rem;
    color: #8792a0;
    margin-bottom: auto;
}

.product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-tag {
    font-size: 1.05rem;
    font-weight: 600;
    color: #4fc3ff;
    letter-spacing: -0.01em;
}

.product-card__cta {
    font-size: 0.85rem;
    color: #9aa6b2;
    transition: color 0.2s ease, transform 0.2s ease;
}

.product-card:hover .product-card__cta {
    color: #4fc3ff;
    transform: translateX(2px);
}

/* Card badges (sold out / low stock / coming soon) */
.product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(8px);
    z-index: 2;
}

.product-card__badge--soldout {
    background: rgba(255, 77, 77, 0.18);
    border: 1px solid rgba(255, 77, 77, 0.5);
    color: #ff8a8a;
}

.product-card__badge--low {
    background: rgba(255, 159, 67, 0.18);
    border: 1px solid rgba(255, 159, 67, 0.4);
    color: #ffb677;
}

.product-card__badge--variant {
    top: auto;
    bottom: 10px;
    left: 10px;
    background: rgba(79, 195, 255, 0.18);
    border: 1px solid rgba(79, 195, 255, 0.5);
    color: #a9e2ff;
}

/* Sold-out cards still open the detail page — users can pre-order from there. */
.product-card--sold-out {
    opacity: 0.85;
}

.product-card--sold-out .product-card__media img {
    filter: grayscale(0.6);
    transition: filter 0.2s ease, transform 0.3s ease;
}

.product-card--sold-out:hover .product-card__media img {
    filter: grayscale(0.3);
}

.product-card--coming-soon {
    cursor: default;
}

.product-card--coming-soon:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
}

.product-card--link {
    cursor: pointer;
}

/* ---------- Legacy color swatch styles (shared by detail page) ---------- */
.color-select-row {
    margin: 0 0 18px;
}

.color-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover:not(:disabled) {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #4fc3ff;
    box-shadow: 0 0 0 2px rgba(79, 195, 255, 0.35);
}

.color-swatch.sold-out {
    opacity: 0.3;
    cursor: not-allowed;
    position: relative;
}

.color-swatch.sold-out::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -4px;
    right: -4px;
    height: 2px;
    background: #ff4d4d;
    transform: rotate(45deg);
}

/* Legacy calculator-box classes retained for other pages that still render step-2 grids */
.calculator-box {
    position: relative;
}

.calculator-box.sold-out {
    opacity: 0.5;
    pointer-events: none;
}

.sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sold-out-text {
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.low-stock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff9f43;
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 2;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    body {
        padding: 32px 16px 56px;
    }

    .store-hero {
        margin-bottom: 32px;
    }

    .shelf {
        margin-bottom: 40px;
    }

    .shelf-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
}
