/*
 * PRECISE - Product Details Page
 * Bespoke quality showcase with parallax zoom, compare slider, and unboxing animation
 */

/* --- Product Hero: Parallax Zoom Container --- */
.product-hero {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    max-height: 900px;
    overflow: hidden;
    margin-bottom: var(--space-xxl);
}

.parallax-zoom-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.parallax-zoom-image {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    transform-origin: center center;
    /* Initial scale - will zoom in via GSAP */
    transform: scale(1);
    transition: transform 0.1s ease-out;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(23, 26, 37, 0.7) 0%,
        rgba(23, 26, 37, 0.5) 50%,
        rgba(23, 26, 37, 0.9) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.product-hero-title {
    font-family: var(--ff-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    color: var(--clr-white);
    text-align: center;
    margin: 0 0 var(--space-md) 0;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(74, 158, 255, 0.4);
    letter-spacing: -0.02em;
}

.product-hero-subtitle {
    font-family: var(--ff-body);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--clr-sky-blue);
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Tech Specs Section: Compare Slider --- */
.tech-specs-section {
    padding: var(--space-xxxl) 0;
    background: var(--clr-background-card);
    border-radius: var(--br-xl);
    margin: var(--space-xxl) 0;
    box-shadow: var(--shadow-medium);
}

.tech-specs-section .section-title {
    font-family: var(--ff-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--clr-denim);
    text-align: center;
    margin: 0 0 var(--space-md) 0;
}

.tech-specs-section .section-description {
    font-size: 1.2rem;
    color: var(--clr-text-light);
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-xxl) auto;
    line-height: 1.8;
}

.compare-slider-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: var(--br-xl);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
}

.compare-slider-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.compare-slider-wrapper:active {
    cursor: grabbing;
}

.compare-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.compare-image-before {
    z-index: 1;
    clip-path: inset(0 50% 0 0);
}

.compare-image-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.compare-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.compare-label {
    position: absolute;
    top: var(--space-lg);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(23, 26, 37, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--br-md);
    color: var(--clr-white);
    font-weight: 600;
    font-size: 1.1rem;
    z-index: 10;
    box-shadow: var(--shadow-medium);
}

.compare-label-before {
    left: var(--space-lg);
}

.compare-label-after {
    right: var(--space-lg);
}

.compare-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--clr-white);
    z-index: 5;
    transform: translateX(-50%);
    cursor: grab;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.compare-slider-handle:active {
    cursor: grabbing;
}

.slider-line {
    width: 100%;
    height: 100%;
    background: var(--clr-white);
}

.slider-handle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--clr-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-mirage);
    font-size: 1.2rem;
    box-shadow: var(--shadow-heavy);
    border: 3px solid var(--clr-sky-blue);
}

.compare-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--clr-sky-blue);
    z-index: 4;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

/* --- Unboxing Animation Section --- */
.unboxing-section {
    padding: var(--space-xxxl) 0;
    background: linear-gradient(135deg, var(--clr-mirage) 0%, var(--clr-mirage-dark) 100%);
    margin-top: var(--space-xxl);
    position: relative;
    overflow: hidden;
}

.unboxing-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
    perspective: 1000px;
}

.unboxing-box {
    position: relative;
    width: 400px;
    height: 300px;
    transform-style: preserve-3d;
    transform-origin: center bottom;
}

/* Box Lid */
.box-lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    transform-style: preserve-3d;
    transform-origin: bottom center;
    z-index: 3;
    /* Initial state - closed */
    transform: rotateX(0deg);
    transition: transform 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.box-lid-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(135deg, #8b6914 0%, #d4af37 50%, #b8941f 100%);
    transform-origin: bottom;
    transform: rotateX(-90deg);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.box-lid-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 50%, #8b6914 100%);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(184, 148, 31, 0.3);
}

/* Box Base */
.box-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.box-base-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(135deg, #8b6914 0%, #d4af37 50%, #b8941f 100%);
    transform-origin: bottom;
    transform: rotateX(-90deg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.box-base-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #b8941f 0%, #8b6914 50%, #6b4f0f 100%);
    box-shadow: 
        0 -10px 40px rgba(0, 0, 0, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(139, 105, 20, 0.3);
}

.box-base-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(135deg, #8b6914 0%, #d4af37 50%, #b8941f 100%);
    transform-origin: top;
    transform: rotateX(90deg);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

/* Box Content (Hidden initially) */
.box-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease-in-out 0.5s;
    color: var(--clr-white);
    padding: var(--space-xl);
}

.box-content h3 {
    font-family: var(--ff-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 var(--space-md) 0;
    color: var(--clr-white);
}

.box-content p {
    font-size: 1.2rem;
    margin: 0 0 var(--space-lg) 0;
    color: var(--clr-text-light);
}

/* Box Open State */
.unboxing-box.box-open .box-lid {
    transform: rotateX(-120deg) translateY(-20px);
}

.unboxing-box.box-open .box-content {
    opacity: 1;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .product-hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .compare-slider-wrapper {
        height: 500px;
    }
    
    .unboxing-box {
        width: 350px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .product-hero {
        height: 60vh;
        min-height: 400px;
    }
    
    .compare-slider-wrapper {
        height: 400px;
    }
    
    .unboxing-box {
        width: 300px;
        height: 200px;
    }
    
    .box-content h3 {
        font-size: 1.5rem;
    }
    
    .box-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-hero {
        height: 50vh;
        min-height: 300px;
    }
    
    .compare-slider-wrapper {
        height: 300px;
    }
    
    .unboxing-box {
        width: 250px;
        height: 180px;
    }
}

/* --- Performance Optimizations --- */
.parallax-zoom-image,
.compare-slider-wrapper,
.unboxing-box {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* --- Reduced Motion Support --- */
@media (prefers-reduced-motion: reduce) {
    .parallax-zoom-image {
        transform: scale(1) !important;
        transition: none !important;
    }
    
    .box-lid {
        transition: none !important;
    }
    
    .box-content {
        transition: none !important;
        opacity: 1 !important;
    }
}






