/* product.css */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

html {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

body.product-page {
    background-color: #020202; /* Onyx Black */
    color: #E6E3DB; /* Bone text */
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Header Tweaks for Product Pages */
.product-page .site-header:not(.scrolled) {
    /* Make header transparent over the full-screen hero cover */
    background: transparent;
    border-bottom: none;
}

.product-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 8rem 4vw 0 4vw; /* Space after the hero cover */
}

/* Navigation */
.product-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.product-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(230, 227, 219, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.product-back-link span {
    font-size: 1.2rem;
    line-height: 1;
}

.product-back-link:hover {
    color: #B2D5E5; /* Candy Blue */
}

/* Hero Cover Section */
.product-cover {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-cover-title {
    position: relative;
    z-index: 2;
    font-size: clamp(3rem, 10vw, 10rem);
    font-weight: 500;
    line-height: 0.9;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #E6E3DB;
    text-align: center;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* For readability over images */
}

.product-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.product-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Asymmetrical Masonry Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Specific Grid Spans */
.gi-full {
    grid-column: span 12;
}

/* Zone Highlights Typography */
.zone-title-block {
    margin-bottom: 1.5rem;
}

.zone-title-block h2,
.gi-muuto-hero-text h2 {
    font-size: clamp(2.2rem, 3.8vw, 3.6rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0.3rem 0 1rem 0;
    text-transform: uppercase;
    color: var(--text-color, #ffffff);
}

.zone-tag {
    display: inline-block;
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color, #B2D5E5);
    margin-bottom: 0.6rem;
}

.zone-desc,
.zone-desc-compact {
    font-size: clamp(0.95rem, 1.05vw, 1.12rem);
    font-weight: 300;
    line-height: 1.7;
    color: rgba(230, 227, 219, 0.85);
    max-width: 680px;
}

.gi-large-left {
    grid-column: 1 / 9;
}

.gi-small-right {
    grid-column: 9 / 13;
}

.gi-small-left {
    grid-column: 1 / 5;
}

.gi-large-right {
    grid-column: 5 / 13;
}

.gi-half {
    grid-column: span 6;
}

.gi-third {
    grid-column: span 4;
}

.gi-quarter {
    grid-column: span 3;
}

/* Muuto Editorial Layout Grid Extensions */
.muuto-row {
    margin-bottom: 12rem; /* Massive gaps between sections for editorial feel */
    align-items: start; /* Ensure images align to top */
}

@media (max-width: 768px) {
    .muuto-row {
        margin-bottom: 6rem;
    }
}

.gi-muuto-hero { grid-column: 1 / 7; }
.gi-muuto-hero-text { grid-column: 7 / 13; align-self: center; padding-left: 2.5rem; }

.gi-muuto-left-small { grid-column: 1 / 5; }
.gi-muuto-right-large { grid-column: 6 / 13; }

.gi-muuto-left-large { grid-column: 1 / 8; }
.gi-muuto-right-small { grid-column: 9 / 13; }

.gi-muuto-center-horizontal { grid-column: 2 / 11; } /* 9 columns wide, shifted left */
.gi-muuto-center-horizontal-alt { grid-column: 3 / 12; } /* 9 columns wide, shifted right */

.gi-muuto-center-vertical { grid-column: 5 / 11; } /* 6 columns wide, shifted right */
.gi-muuto-center-vertical-alt { grid-column: 3 / 9; } /* 6 columns wide, shifted left */

/* Category Labels */
.category-label {
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--graphite);
    margin: 8rem 0 4rem;
    opacity: 0.7;
    font-weight: 500;
}

/* Typography & Content Sections */
.product-text-section {
    max-width: 680px;
    margin: 8rem auto;
    text-align: center;
}

.product-text-section .zone-title-block {
    text-align: center;
}

.product-text-section p {
    font-size: clamp(0.95rem, 1.05vw, 1.12rem);
    line-height: 1.7;
    font-weight: 300;
    color: rgba(230, 227, 219, 0.85);
    margin: 0 auto;
    max-width: 680px;
}

/* Next Project Footer */
.next-project-wrap {
    text-align: center;
    padding: clamp(5rem, 8vw, 8rem) 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.next-project-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(230, 227, 219, 0.5);
    margin-bottom: 2rem;
    display: block;
}

.next-projects-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(2rem, 4vw, 4.5rem);
    flex-wrap: wrap;
}

.next-project-title {
    font-size: clamp(2rem, 4.5vw, 4.8rem);
    font-weight: 500;
    color: #E6E3DB;
    text-decoration: none;
    transition: color 0.4s ease, transform 0.4s ease;
    display: inline-block;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.next-project-title:hover {
    color: var(--accent-color, #B2D5E5);
    transform: translateY(-2px);
}

.all-projects-btn-wrap {
    margin-top: clamp(3rem, 5vw, 4.5rem);
    display: flex;
    justify-content: center;
}

.all-projects-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #E6E3DB;
    text-decoration: none;
    padding: 0.85rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.all-projects-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 1.1em;
    line-height: 1;
}

.all-projects-btn:hover {
    color: var(--accent-color, #B2D5E5);
    border-color: var(--accent-color, #B2D5E5);
    background-color: rgba(178, 213, 229, 0.06);
    box-shadow: 0 0 20px rgba(178, 213, 229, 0.15);
}

.all-projects-btn:hover .all-projects-arrow {
    transform: translateX(-4px);
}

@media (max-width: 768px) {
    .next-projects-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .next-project-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .all-projects-btn {
        padding: 0.75rem 1.6rem;
    }
}

/* Initial GSAP states */
.gsap-reveal {
    opacity: 0;
    transform: translateY(60px);
}

.gsap-parallax-img {
    will-change: transform;
}

/* =========================================
   ASYMMETRICAL EDITORIAL LOOKBOOK (<= 1024px)
   ========================================= */

@media (max-width: 1024px) {
    .product-container {
        padding-top: 4rem;
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .product-cover-title {
        font-size: clamp(2.2rem, 8.5vw, 5.5rem);
    }

    /* Base row spacing */
    .product-grid,
    .product-grid.muuto-row {
        margin-bottom: 5rem !important;
        margin-top: 0 !important;
        gap: 2.5rem !important;
    }

    /* Intro Hero Block (Image + Title/Text) */
    .gi-muuto-hero-text {
        margin-top: 0 !important;
        padding: 0 0.5rem;
    }

    .zone-title-block h2,
    .gi-muuto-hero-text h2 {
        font-size: clamp(1.8rem, 4.2vw, 3rem);
        letter-spacing: 0.02em;
        margin-bottom: 0.8rem;
    }

    .gi-muuto-hero-text p,
    .product-text-section p,
    .product-grid .grid-item p,
    .zone-desc,
    .zone-desc-compact {
        font-size: clamp(0.92rem, 1.2vw, 1.05rem) !important;
        line-height: 1.65 !important;
        font-weight: 300 !important;
        color: rgba(230, 227, 219, 0.85) !important;
        max-width: 100% !important;
    }

    /* Reset inline styles that force massive desktop margins or fixed grid columns */
    .grid-item {
        grid-column: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        aspect-ratio: auto !important;
        box-sizing: border-box;
    }

    .grid-item img {
        width: 100%;
        height: auto;
        max-height: 78vh;
        object-fit: contain;
        display: block;
        border-radius: 2px;
    }
}

/* Tablet (600px - 1024px) Asymmetric Grid Rhythm */
@media (min-width: 600px) and (max-width: 1024px) {
    .product-grid {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    /* Hero Intro Row: Photo left, Title/Text right on the exact same level */
    .product-grid .gi-muuto-hero {
        width: 42% !important;
        max-width: 440px !important;
        margin-right: 0 !important;
        align-self: center !important;
        flex-shrink: 0 !important;
    }

    .product-grid .gi-muuto-hero img {
        width: 100% !important;
        max-height: 80vh !important;
        object-fit: cover !important;
    }

    .product-grid .gi-muuto-hero-text {
        width: calc(58% - 1.2rem) !important;
        flex-grow: 1 !important;
        margin-left: auto !important;
        margin-top: 0 !important;
        align-self: center !important;
        padding-left: 1.2rem !important;
    }

    /* When a row has two items */
    .product-grid .grid-item:nth-child(1):nth-last-child(2) {
        width: 58% !important;
        align-self: flex-start;
    }
    
    .product-grid .grid-item:nth-child(2):nth-last-child(1) {
        width: 38% !important;
        margin-left: auto !important;
        margin-top: 3.5rem !important;
        align-self: flex-start;
    }

    /* Alternating 2-item rows */
    .product-grid:nth-of-type(even) .grid-item:nth-child(1):nth-last-child(2) {
        width: 38% !important;
        margin-top: 3rem !important;
    }

    .product-grid:nth-of-type(even) .grid-item:nth-child(2):nth-last-child(1) {
        width: 58% !important;
        margin-left: auto !important;
        margin-top: 0 !important;
    }

    /* Single-item rows: Alternating widths and alignment */
    .product-grid:nth-of-type(4n + 1) .grid-item:only-child {
        width: 86% !important;
        margin-right: auto !important;
    }

    .product-grid:nth-of-type(4n + 2) .grid-item:only-child {
        width: 74% !important;
        margin-left: auto !important;
    }

    .product-grid:nth-of-type(4n + 3) .grid-item:only-child {
        width: 96% !important;
        margin: 0 auto !important;
    }

    .product-grid:nth-of-type(4n + 4) .grid-item:only-child {
        width: 80% !important;
        margin-left: 6% !important;
    }
}

/* Smartphone (< 600px) Editorial Collage Rhythm */
@media (max-width: 599px) {
    .product-container {
        padding-top: 3rem;
        padding-left: 4vw;
        padding-right: 4vw;
    }

    .product-grid {
        display: flex;
        flex-direction: column;
        gap: 3.5rem !important;
        margin-bottom: 4rem !important;
        margin-top: 0 !important;
    }

    /* Single photos & grid items inside rows get alternating widths and offsets */
    .product-grid:nth-of-type(5n + 1) .grid-item {
        width: 88% !important;
        margin-right: auto !important;
        margin-left: 0 !important;
    }

    .product-grid:nth-of-type(5n + 2) .grid-item {
        width: 76% !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .product-grid:nth-of-type(5n + 3) .grid-item {
        width: 96% !important;
        margin: 0 auto !important;
    }

    .product-grid:nth-of-type(5n + 4) .grid-item {
        width: 82% !important;
        margin-left: 7% !important;
        margin-right: auto !important;
    }

    .product-grid:nth-of-type(5n + 5) .grid-item {
        width: 100% !important;
        margin: 0 !important;
    }

    /* When a row has 2 items on mobile, stack with alternating offsets */
    .product-grid .grid-item:nth-child(2) {
        margin-top: 1rem !important;
    }

    /* Intro Hero Block always full width on phone */
    .gi-muuto-hero,
    .gi-muuto-hero-text {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Text block indents */
    .product-grid:nth-of-type(odd) .grid-item p {
        padding-left: 0.8rem;
        border-left: 2px solid rgba(178, 213, 229, 0.35);
    }

    .product-grid:nth-of-type(even) .grid-item p {
        padding-right: 0.8rem;
        border-right: 2px solid rgba(230, 227, 219, 0.2);
    }
}

/* Page Transition Animation */
.project-link-anim {
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.project-link-anim.is-clicked {
    transform: translateY(-30px);
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   GLOBAL CUSTOM SCROLLBAR (Lookbook Style)
========================================= */
.koloryt-global-scrollbar {
    position: fixed !important;
    right: 3px !important;
    top: 0 !important;
    width: 8px !important;
    height: 100vh !important;
    background: transparent !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

.koloryt-global-scrollbar .swiper-scrollbar-drag {
    background: rgba(255, 255, 255, 0.35) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: background 0.2s ease !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.koloryt-global-scrollbar .swiper-scrollbar-drag:hover {
    background: rgba(255, 255, 255, 0.6) !important;
}
