/* ============================================
   PRODUCTS PAGE STYLES — matches home redesign
   ============================================ */

.products-page {
    background-color: var(--secondary-black);
    min-height: 100vh;
}

/* ============================================
   PAGE HEADER (compact, beam background)
   ============================================ */
.products-header {
    position: relative;
    padding: 12rem 2.5rem 5rem;
    text-align: center;
    overflow: hidden;
    background: var(--secondary-black);
}

.products-header-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(60% 65% at 70% 18%, rgba(255, 46, 55, 0.28), transparent 60%),
        radial-gradient(55% 60% at 15% 90%, rgba(120, 20, 24, 0.35), transparent 60%),
        radial-gradient(80% 80% at 50% 0%, rgba(40, 40, 50, 0.5), transparent 70%);
}

.products-header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(118deg, transparent 32%, rgba(255, 46, 55, 0.07) 49%, transparent 62%),
        linear-gradient(72deg, transparent 54%, rgba(255, 255, 255, 0.05) 71%, transparent 84%);
    filter: blur(2px);
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 40%, #000 20%, transparent 85%);
    mask-image: radial-gradient(ellipse 95% 80% at 50% 40%, #000 20%, transparent 85%);
}

.products-title {
    position: relative;
    z-index: 1;
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    color: var(--primary-white);
    line-height: 1;
    letter-spacing: -0.03em;
}

.products-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 46, 55, 0.1);
    color: var(--primary-red);
    padding: 0.5rem 1.1rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.78rem;
    margin-bottom: 1.6rem;
    border: 1px solid rgba(255, 46, 55, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.products-header h1 {
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    margin-bottom: 1.2rem;
    color: var(--primary-white);
    line-height: 1;
    letter-spacing: -0.03em;
}

.products-header p {
    font-size: 1.12rem;
    color: var(--text-grey);
    line-height: 1.7;
    max-width: 38em;
    margin: 0 auto;
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */
.products-section {
    padding: 5rem 2.5rem 8rem;
    /* darker cream — the page background */
    background: #F3ECDD;
    color: var(--text-dark);
    border-radius: 40px 40px 0 0;
    margin-top: -2rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    color: #6a6a72;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 46, 55, 0.2);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #8a8a92;
}

/* ============================================
   ERROR STATE
   ============================================ */
.error-state {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.error-state h3 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.error-state p {
    color: #6a6a72;
    margin-bottom: 2rem;
}

/* ============================================
   CATEGORY FILTER
   ============================================ */
.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3.5rem;
    gap: 1.2rem;
}

.filter-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #8a8a92;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    background: #FDFAF3;
    border: 1px solid rgba(90, 70, 40, 0.18);
    color: #5a4d3a;
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    border-radius: 100px;
    transition: all 0.3s var(--ease);
}

.filter-btn:hover {
    border-color: rgba(255, 46, 55, 0.5);
    color: var(--red-deep);
    background: rgba(255, 46, 55, 0.08);
}

.filter-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
    box-shadow: 0 8px 22px var(--red-glow);
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6a6a72;
    font-size: 1.1rem;
}

/* Category Badge */
.catalog-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.35rem 0.8rem;
    background: rgba(253, 250, 243, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(90, 70, 40, 0.14);
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #5a4d3a;
    z-index: 5;
}

/* ============================================
   PRODUCT CATALOG GRID
   ============================================ */
.product-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   PRODUCT CARD STYLES
   ============================================ */
.catalog-product-card {
    /* lighter cream — the item background */
    background: #FDFAF3;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(90, 70, 40, 0.12);
    transition: transform 0.45s var(--ease),
        box-shadow 0.45s ease,
        border-color 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.catalog-product-card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: cardFadeIn 0.6s var(--ease) forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalog-product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(70, 50, 20, 0.16),
        0 0 0 1px rgba(255, 46, 55, 0.18);
    border-color: rgba(255, 46, 55, 0.25);
}

/* Card Image Container */
.catalog-card-image {
    position: relative;
    height: 280px;
    background: linear-gradient(160deg, #F8F1E6 0%, #EFE6D5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.catalog-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(255, 46, 55, 0.08) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.catalog-product-card:hover .catalog-card-image::before {
    opacity: 1;
}

.catalog-card-image img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
    transition: transform 0.6s var(--ease), opacity 0.2s ease;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.16));
    mix-blend-mode: multiply;
}

.catalog-product-card:hover .catalog-card-image img {
    transform: scale(1.08) rotate(-2deg);
}

/* Carousel Arrows */
.card-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 12, 0.65);
    color: white;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s var(--ease);
    font-size: 1.1rem;
    user-select: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.catalog-product-card:hover .card-arrow {
    opacity: 1;
}

.card-arrow:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-50%) scale(1.1);
}

.card-arrow-prev {
    left: 12px;
}

.card-arrow-next {
    right: 12px;
}

/* Overlay on hover */
.catalog-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 10, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.catalog-product-card:hover .catalog-card-overlay {
    opacity: 1;
}

.btn-view-details {
    padding: 0.9rem 2rem;
    background: var(--primary-red);
    color: #fff;
    border: none;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    border-radius: 100px;
    transform: translateY(20px);
    transition: transform 0.3s var(--ease), background 0.3s ease, box-shadow 0.3s ease;
}

.catalog-product-card:hover .btn-view-details {
    transform: translateY(0);
}

.btn-view-details:hover {
    background: var(--red-deep);
    box-shadow: 0 10px 26px var(--red-glow);
}

/* Card Content */
.catalog-card-content {
    padding: 1.6rem 1.7rem 1.7rem;
    border-top: 1px solid rgba(90, 70, 40, 0.12);
}

.catalog-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.catalog-card-description {
    font-size: 0.9rem;
    color: #6a6a72;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    min-height: 40px;
}

.catalog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-card-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -0.01em;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1024px) {
    .product-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }

    .filter-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .products-header {
        padding: 10rem 1.5rem 4rem;
    }

    .products-section {
        padding: 2rem 1.5rem 6rem;
    }

    .filter-container {
        margin-bottom: 2.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.74rem;
    }

    .catalog-card-category {
        font-size: 0.55rem;
        padding: 0.25rem 0.6rem;
    }

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

    .catalog-card-image {
        height: 180px;
        padding: 1.2rem;
    }

    .catalog-card-content {
        padding: 1.1rem;
    }

    .catalog-card-title {
        font-size: 1rem;
    }

    .catalog-card-description {
        font-size: 0.8rem;
        min-height: auto;
    }

    .catalog-card-price {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .products-header {
        padding: 9rem 1rem 3rem;
    }

    .product-catalog-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem;
    }

    .catalog-card-image {
        height: 150px;
    }

    .catalog-card-overlay {
        display: none;
    }
}

/* ============================================
   NAV ACTIVE STATE
   ============================================ */
.nav-links li a.active {
    color: var(--primary-red);
}

.nav-links li a.active::after {
    width: 100%;
}

/* ============================================
   SCROLL-REVEAL INTRO
   ============================================ */
.reveal-scroll {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: 7rem;
    padding-bottom: 0;
    overflow: hidden;
    background: var(--secondary-black);
}

/* ============================================
   RED LAMP LIGHT EFFECT (top of reveal section)
   ============================================ */
.lamp {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 62vh;
    min-height: 400px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* vertical position of the light line / beam apex */
    --lamp-apex: 8.5rem;
    /* target width the beams / line grow to */
    --lamp-w: 30rem;
}

.lamp-beam {
    position: absolute;
    top: var(--lamp-apex);
    height: 14rem;
    width: 15rem;
    opacity: 0;
    animation: lampGrow 1.1s var(--ease) 0.25s forwards;
    -webkit-mask-image:
        linear-gradient(to top, transparent, #000 42%),
        linear-gradient(to var(--lamp-fade), transparent, #000 42%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to top, transparent, #000 42%),
        linear-gradient(to var(--lamp-fade), transparent, #000 42%);
    mask-composite: intersect;
}

.lamp-beam-left {
    right: 50%;
    --lamp-fade: right;
    background-image: conic-gradient(from 70deg at center top, var(--primary-red), transparent 50%);
}

.lamp-beam-right {
    left: 50%;
    --lamp-fade: left;
    background-image: conic-gradient(from 290deg at center top, transparent 50%, var(--primary-red));
}

/* Bright horizontal filament line */
.lamp-line {
    position: absolute;
    top: var(--lamp-apex);
    left: 50%;
    height: 2px;
    width: 15rem;
    transform: translateX(-50%);
    background: var(--primary-red);
    box-shadow: 0 0 18px 1px rgba(255, 46, 55, 0.7);
    opacity: 0;
    animation: lampLineGrow 1.1s var(--ease) 0.25s forwards;
}

/* Soft radial glow behind the line */
.lamp-glow {
    position: absolute;
    top: var(--lamp-apex);
    left: 50%;
    height: 9rem;
    width: 26rem;
    transform: translate(-50%, -55%);
    border-radius: 50%;
    background: var(--primary-red);
    opacity: 0;
    filter: blur(65px);
    animation: lampGlowIn 1.1s var(--ease) 0.25s forwards;
}

@keyframes lampGrow {
    from { width: 15rem; opacity: 0.4; }
    to { width: var(--lamp-w); opacity: 1; }
}

@keyframes lampLineGrow {
    from { width: 15rem; opacity: 0.5; }
    to { width: var(--lamp-w); opacity: 0.95; }
}

@keyframes lampGlowIn {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

/* Push the heading below the lamp light */
.reveal-scroll .reveal-stagger {
    padding-top: 5rem;
}

/* The intro text fills the first screen; the catalog box opens only on scroll */
.reveal-stagger {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    /* sized to its content so the small box sits right below "Scroll to explore" */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reveal-stagger .products-title {
    margin-top: 0.4rem;
}

.reveal-sub {
    font-size: 1.18rem;
    color: var(--text-grey);
    line-height: 1.7;
    max-width: 34em;
    margin: 1.5rem auto 0;
}

.reveal-cue {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.4rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-mute);
}

.reveal-cue svg {
    width: 16px;
    height: 16px;
    animation: cueBounce 2s ease-in-out infinite;
}

@keyframes cueBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Staggered entrance */
.reveal-item {
    opacity: 0;
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.r-top {
    transform: translateY(-60px);
}

.r-bottom {
    transform: translateY(60px);
}

.r-blur {
    filter: blur(12px);
}

.reveal-stagger.in .reveal-item {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.reveal-stagger.in .reveal-item:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.in .reveal-item:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.in .reveal-item:nth-child(3) { transition-delay: 0.38s; }
.reveal-stagger.in .reveal-item:nth-child(4) { transition-delay: 0.56s; }

/* Scroll-linked opening box — frames the real product catalog.
   clip-path (set by JS) opens from a small rounded window into the full grid. */
.reveal-inset {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: 0.75rem;
    clip-path: inset(16px 13% calc(100% - 376px) 13% round 24px);
    will-change: clip-path;
}

/* The catalog becomes the box interior — no second rounded panel / negative pull */
.reveal-inset .products-section {
    margin-top: 0;
    border-radius: 0;
}

@media (max-width: 768px) {
    .reveal-scroll {
        min-height: 100vh;
        padding-top: 6rem;
    }

    .reveal-sub {
        font-size: 1.02rem;
    }

    .reveal-inset {
        clip-path: inset(16px 8% calc(100% - 376px) 8% round 24px);
        margin-top: 0.75rem;
    }

    .lamp {
        --lamp-w: 19rem;
        --lamp-apex: 7.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-item {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .reveal-cue svg {
        animation: none;
    }

    .lamp-beam,
    .lamp-line,
    .lamp-glow {
        animation: none;
    }

    .lamp-beam { width: var(--lamp-w); opacity: 1; }
    .lamp-line { width: var(--lamp-w); opacity: 0.95; }
    .lamp-glow { opacity: 0.4; }
}
