/* 
   Demirci Perde - Modern Editorial / Swiss Corporate
   Theme: High legibility, structural precision, timeless.
*/

:root {
    --f-sans: 'Inter', sans-serif;
    --c-bg: #FFFFFF;
    --c-text: #111111;
    --c-muted: #888888; 
    --c-border: #E5E5E5;
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   GLOBAL & TYPOGRAPHY
   ========================================== */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
}

body.is-loading {
    overflow: hidden !important; /* Lock scrolling during load */
}

/* ==========================================
   PRELOADER (THEATER STAGE EDITION)
   ========================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    pointer-events: none;
}

/* The Theater Curtains */
.theater-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background-color: #0d0d0d;
    /* Soft, elegant folds for the curtain */
    background-image: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0) 50%, 
        rgba(255,255,255,0.03) 75%, 
        rgba(255,255,255,0) 100%
    );
    background-size: 120px 100%;
    z-index: 1;
    box-shadow: 0 0 50px rgba(0,0,0,0.8); /* Heavy depth */
}

.theater-left {
    left: 0;
    transform-origin: left center;
    border-right: 1px solid rgba(255,255,255,0.1); /* Center slit */
}

.theater-right {
    right: 0;
    transform-origin: right center;
    border-left: 1px solid rgba(255,255,255,0.1); /* Center slit */
}

.preloader-content {
    position: relative;
    z-index: 2; /* Above the SVG fabric */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.preloader-logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 1; /* Animated via JS */
}

.preloader-logo span {
    color: #666;
}

.preloader-counter {
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.preloader-logo {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    opacity: 0;
}

.preloader-logo span {
    color: #888; /* Subtle dot color */
}

.preloader-bar-container {
    width: 240px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
    opacity: 0;
}

.preloader-bar {
    width: 0%;
    height: 100%;
    background: #ffffff;
}

/* Typography styles */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
a { text-decoration: none; color: inherit; }

/* Top Header */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--c-border);
}

.logo {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.catalog-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: none;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--c-text);
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover { opacity: 0.5; }

/* Hero Spacer */
.hero-spacer {
    padding: 140px 32px 64px;
    max-width: 1200px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 16px;
}

.hero-subtitle {
    color: var(--c-muted);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 400px;
}

/* Masonry Grid */
.masonry-grid {
    column-count: 2;
    column-gap: 24px;
    width: 100%;
}

/* Editorial Product Cards */
.product-card {
    break-inside: avoid;
    margin-bottom: 56px;
    background: transparent;
    opacity: 0.2;
    transform: translateY(20px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
    will-change: transform, opacity;
    cursor: pointer;
}

.product-card.in-focus,
.product-card:hover {
    opacity: 1;
    transform: translateY(0);
}

.p-image-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
    overflow: hidden;
    background: #F4F4F4;
}

.p-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 3/4;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:nth-child(even) .p-image-wrap img {
    aspect-ratio: 4/5;
}

.product-card.in-focus .p-image-wrap img,
.product-card:hover .p-image-wrap img {
    transform: scale(1.03);
}

.p-quick-action {
    position: absolute;
    top: 16px; right: 16px;
    width: 40px; height: 40px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: var(--c-text);
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
}

.product-card.in-focus .p-quick-action,
.product-card:hover .p-quick-action {
    opacity: 1;
    transform: scale(1);
}

/* Structured Data Rows (Swiss style) */
.p-info {
    display: flex;
    flex-direction: column;
}

.p-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--c-border);
}

/* Hide top border of first row for cleaner look */
.p-row:first-child {
    border-top: none;
    padding-top: 0;
}

.p-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.p-price {
    font-size: 0.95rem;
    font-weight: 500;
}
.p-price .unit {
    color: var(--c-muted);
    font-size: 0.8rem;
}

.p-meta {
    padding-bottom: 0;
}

.p-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-muted);
}

.p-colors {
    display: flex;
    gap: 8px;
}

/* Color Dots */
.c-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.c-dot:hover {
    transform: scale(1.1);
}

/* Active Color Dot */
.c-dot.active {
    outline: 1px solid var(--c-text);
    outline-offset: 3px;
}

.dock-spacer {
    height: 140px;
}

/* Fluid Bubble Category Dock */
.floating-dock {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 100px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid var(--c-border);
}

.dock-container {
    display: flex;
    align-items: center;
    position: relative;
}

/* The Sliding Bubble */
.dock-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--c-text);
    border-radius: 100px;
    z-index: 1;
    /* Transition is handled by GSAP for the elastic feel, but we add a fallback */
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-item {
    background: transparent;
    border: none;
    color: var(--c-muted);
    padding: 0 24px;
    height: 44px;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2; /* Sits above the sliding indicator */
    transition: color 0.3s ease;
}

.dock-item span {
    font-size: 0.85rem;
    font-family: var(--f-sans);
    font-weight: 500;
}

.dock-item:hover {
    color: var(--c-text);
}

.dock-item.active {
    color: #FFFFFF;
}

.dock-item.active:hover {
    color: #FFFFFF;
}

/* =========================================================
   PRODUCT DETAIL PAGE (PDP) - IMMERSIVE BOTTOM SHEET
   ========================================================= */

.pdp-immersive {
    background-color: #000;
    overflow-x: hidden;
    /* Ensure lenis doesn't clash with the background */
}

/* Fixed Background Image */
.pdp-bg-image {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: 1;
    transform: scale(1.02);
}

/* Floating Top Controls */
.pdp-floating-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.btn-back-circle, .btn-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex; align-items: center; justify-content: center;
    color: #FFF;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back-circle:hover, .btn-circle:hover {
    background: #FFF;
    color: #111;
}

.pdp-floating-header .actions {
    display: flex; gap: 12px;
}

/* Mobile Immersive App - Allow Body Scroll */
body.pdp-immersive {
    overflow: auto;
    overflow-x: hidden;
}

/* Scrollable Area */
.pdp-scroll-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    pointer-events: none; /* Let clicks pass to header buttons when hovering over the empty spacer */
}

/* Pushes the sheet down so we can see the image */
.pdp-spacer {
    display: block;
    height: 55vh;
}

/* Glassmorphic Bottom Sheet */
.pdp-bottom-sheet {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 40px 40px 0 0;
    padding: 24px 24px 120px; /* 120px to easily clear the action bar */
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    flex-grow: 1; /* Fills remaining space */
    pointer-events: auto;
}

.drag-indicator {
    width: 40px; height: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    margin: 0 auto 24px;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.sh-left .p-category {
    font-size: 0.7rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block; margin-bottom: 8px;
}

.sh-left .p-title {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.sh-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.sh-right .p-price {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}

.sh-right .p-unit {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-top: 4px;
}

/* Sheet Sections */
.sheet-section {
    margin-bottom: 36px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Horizontal Color Row */
.color-scroll-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 6px 4px 12px;
    margin: 0 -4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.color-scroll-row::-webkit-scrollbar { display: none; }

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.color-item .c-dot {
    width: 48px; height: 48px;
    flex-shrink: 0; /* Prevent squishing */
}

.color-item span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Description */
.p-desc {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; /* Reduced gap from 16px */
}

.spec-card {
    background: rgba(0,0,0,0.04);
    border-radius: 16px; /* Reduced from 20px */
    padding: 16px; /* Reduced from 20px */
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 6px */
    transition: transform 0.2s, background 0.2s;
}

.spec-card:hover {
    background: rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.spec-card i {
    font-size: 20px; /* Reduced from 24px */
    color: var(--c-text);
    margin-bottom: 6px; /* Reduced from 8px */
}

.spec-card .s-label {
    font-size: 0.75rem;
    color: var(--c-sub);
    font-weight: 500;
}

.spec-card .s-val {
    font-size: 0.9rem; /* Reduced from 0.95rem */
    font-weight: 600;
    color: var(--c-text);
}

/* Sticky Action Bar at Bottom of Screen */
.sheet-action-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 16px 24px 24px;
    background: linear-gradient(transparent, rgba(255,255,255,0.95) 30%);
    z-index: 20;
}

.btn-dark-full {
    background: var(--c-text);
    color: #FFF;
    border: none;
    width: 93%;
    padding: 12px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Desktop Adjustments for Immersive App */
@media (min-width: 768px) {
    .catalog-status { display: block; }
    .masonry-grid { column-count: 3; padding: 0 40px; column-gap: 40px; }
    .hero-spacer { padding: 180px 40px 80px; }
    .hero-title { font-size: 4rem; }
    
    .product-card { opacity: 1; transform: translateY(0); margin-bottom: 80px; }
    .masonry-grid:hover .product-card { opacity: 0.3; }
    .masonry-grid .product-card:hover { opacity: 1; }
    
    .floating-dock { bottom: 48px; }

    /* For desktop, we let the page scroll so the beautiful parallax triggers, 
       but we align the sheet to the right like a sleek floating card */
    body.pdp-immersive {
        overflow: auto; /* Unlock body scroll on PC */
        overflow-x: hidden;
    }

    .pdp-scroll-container {
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        padding-right: 40px;
        pointer-events: auto; /* Enable container pointer events on PC */
    }

    .pdp-spacer {
        display: block;
        height: 60vh;
        width: 100%;
        flex-shrink: 0;
    }

    .pdp-bottom-sheet {
        position: relative;
        top: auto;
        bottom: auto;
        max-width: 500px;
        width: 100%;
        margin: 0 0 80px 0; /* Space at the bottom to let user scroll past it */
        border-radius: 40px;
        height: auto;
        max-height: none;
        overflow-y: visible;
        padding: 40px 40px 100px;
    }
    
    .drag-indicator {
        display: none; /* PC doesn't need drag indicator */
    }

    .sheet-action-bar {
        position: sticky;
        bottom: 24px;
        left: 0; right: 0;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        margin: 0 -40px -100px; /* Pull out to match padding */
        padding: 24px 40px;
        border-radius: 0 0 40px 40px;
        z-index: 20;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.03);
    }
    
    .pdp-floating-header {
        padding: 40px;
    }

    .pdp-floating-header .actions {
        display: none; /* Hide on PC to avoid overlapping the right-aligned card */
    }
}
