/* ---------------------------------------------------------------------------------- */
/* --- GLOBAL RESET & PRODUCT PAGE STYLING (#product-main) --- */
/* ---------------------------------------------------------------------------------- */

/* FIX: UNIVERSAL BOX-SIZING RESET. CRITICAL for preventing any overflow. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* FIX: GLOBAL RESET and AGGRESSIVE SCROLL FIX */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden !important; 
    width: 100% !important; 
    min-width: 100% !important; 
}

/* --- BRAND COLORS DEFINITION --- */
:root {
    --color-black: #1a1a1a;
    --color-action-neon: #92ff83;
    --color-action-hover-text: #000000;
    --color-white: #ffffff;
}

/* --- GLOBAL FONT --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #fcfcfc;
}

/* --- 1. HEADER & MAIN CONTAINER SPACING (DESKTOP) --- */
#product-main {
    padding-top: 120px; 
    padding-bottom: 60px;
    padding-left: 0; 
    padding-right: 0; 
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: hidden; 
}

/* ---------------------------------------------------------------------------------- */
/* --- 2. CORE DESKTOP LAYOUT: TWO COLUMNS (3:2 GALLERY FOCUS) --- */
/* ---------------------------------------------------------------------------------- */
.product-wrapper {
    display: grid;
    grid-template-columns: 3fr 2fr; 
    gap: 50px; 
    padding-top: 0; 
    align-items: start; 
    padding-left: 30px; /* Base padding */
    padding-right: 30px; /* Base padding */
}

/* Vertical alignment fix for right column (details) */
.product-wrapper > *:nth-child(2) {
    padding-top: 30px; 
    padding-right: 0; 
}

/* A. Product Gallery (Left Column) */
.product-gallery {
    align-self: start; 
    width: 100%; 
    padding-left: 0; 
    border-radius: 12px;
    overflow: hidden;
}

.main-product-image {
    width: 100%;
    max-width: 100%; 
    height: auto;
    display: block;
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.thumbnail-selector {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    padding-left: 0; 
    justify-content: flex-start;
}
.thumbnail {
    cursor: pointer;
    border: 2px solid transparent; 
    transition: border-color 0.2s, opacity 0.2s, transform 0.1s;
    border-radius: 10px; 
    opacity: 0.8;
    width: 100px; 
    height: auto; 
    max-width: 100px;
}
.thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.thumbnail.active {
    border-color: var(--color-action-neon); 
    opacity: 1;
    transform: translateY(0);
}


/* --- START NEW: Specs Video Responsive Styles (In Left Column, BENEATH Gallery) --- */
.specs-video-in-gallery {
    display: none; /* Hidden by default */
    width: 100%;
    margin-top: 40px; /* Space below thumbnails */
}
.specs-video-in-gallery.visible {
    display: block; /* Shown when specs are open */
}

.video-container-responsive {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (9 / 16 * 100) */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.specs-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.specs-video-caption {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-top: 10px;
}
/* --- END NEW --- */


/* --- B. DETAILS SECTION (Title/Price) --- */
.product-info-header-desktop {
    margin-bottom: 25px; 
}

.product-title-desktop {
    font-size: 52px; 
    font-weight: 400; 
    margin-bottom: 5px; 
    line-height: 1.1; 
    text-transform: uppercase;
    letter-spacing: -1px; 
}

.product-price-desktop {
    font-size: 28px; 
    font-weight: 300; 
    color: var(--color-black); 
    margin-top: 0;
}


/* --- PURCHASE OPTIONS (Controls - GRID LAYOUT) --- */
.purchase-options {
    border-top: 1px solid #eee;
    padding-top: 20px; 
    margin-bottom: 40px; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

/* **DESKTOP ORDER** */
.lens-type-selector { 
    grid-column: 1 / -1; /* Full width */
    order: 1; 
}
.quantity-selector { 
    grid-column: 1 / 2; /* Half width (left) */
    order: 2; 
    width: 100%; 
}
.prescription-option { 
    grid-column: 2 / 3; /* Half width (right) */
    order: 3; 
    width: 100%; 
}
.buy-button { 
    grid-column: 1 / -1; /* Full width */
    order: 4; 
    width: 100%; 
}


/* Labels, Inputs, Buttons (Standard) */
.quantity-selector label, .prescription-option label, .lens-type-selector label {
    font-size: 14px; 
    font-weight: 700;
    color: var(--color-black); 
    padding: 0 0 5px 0; 
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block; 
}

.input-group, 
.lens-type-selector select, 
.prescription-button {
    height: 48px; 
    border-radius: 10px; 
    font-size: 16px;
    font-weight: 500; 
    border: 1px solid #ddd; 
    box-sizing: border-box; 
    transition: border-color 0.2s, box-shadow 0.2s; 
    width: 100%; 
}

.lens-type-selector select:focus, 
.input-group:focus-within {
    border-color: var(--color-action-neon);
    box-shadow: 0 0 0 1px var(--color-action-neon);
    outline: none;
}

.lens-type-selector select {
    padding: 0 15px; 
    background-color: white;
    appearance: none; 
    line-height: 46px; 
    /* Custom SVG for dropdown arrow */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>'); 
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px; 
}

/* Quantity Controls */
.input-group {
    display: flex; 
    align-items: stretch; 
    justify-content: space-between;
    overflow: hidden;
    background-color: white;
}

.qty-btn {
    padding: 0 14px; 
    height: 100%;
    font-size: 20px; 
    color: var(--color-black);
    background-color: #ffffff; 
    border: none;
    border-left: 1px solid #eee; 
    border-right: 1px solid #eee;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-sizing: border-box;
    transition: background-color 0.1s; 
    border-radius: 0;
    cursor: pointer;
}
.qty-btn:first-child { 
    border-right: none;
    border-top-left-radius: 10px; 
    border-bottom-left-radius: 10px;
}
.qty-btn:last-child { 
    border-left: none;
    border-top-right-radius: 10px; 
    border-bottom-right-radius: 10px;
}
.qty-btn:hover:enabled {
    background-color: #f5f5f5; 
}
.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-group input {
    flex-grow: 1;
    height: 100%;
    border: none;
    padding: 0 5px;
    text-align: center;
    font-weight: 500;
    color: var(--color-black);
    box-sizing: border-box;
    border-radius: 0; 
    pointer-events: none; /* Prevent manual number editing */
}

/* Prescription Upload Button */
.prescription-button {
    height: 48px; 
    width: 100%; 
    border-radius: 10px; 
    background-color: #ffffff;
    color: var(--color-black);
    font-weight: 600;
    letter-spacing: 1.5px; 
    text-transform: uppercase;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03); 
    cursor: pointer;
}
.prescription-button:hover:not(:disabled) {
    background-color: var(--color-action-neon); 
    color: var(--color-action-hover-text); 
    border-color: var(--color-action-neon);
    box-shadow: 0 4px 8px rgba(146, 255, 131, 0.4); 
}
.prescription-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

/* CTA BUTTON */
.buy-button {
    height: 54px; 
    padding: 18px 0; 
    font-size: 17px; 
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 2px; 
    border-radius: 10px; 
    background-color: var(--color-black); 
    color: var(--color-white); 
    border: 1px solid var(--color-black);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    width: 100%; 
}

.buy-button:hover:not(:disabled) {
    background-color: var(--color-action-neon); 
    color: var(--color-action-hover-text); 
    border-color: var(--color-action-neon);
    box-shadow: 0 6px 18px rgba(146, 255, 131, 0.8); 
}
.buy-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #333;
    color: #ccc;
}

/* --- Accordion Styles --- */
.accordion-separator {
    width: 100%;
    height: 1px;
    background-color: #eee; 
    margin-bottom: 40px; 
    margin-left: 0; 
    margin-right: 0;
}

.product-accordion {
    padding-top: 0; 
    margin-top: 50px; 
    padding-left: 30px;
    padding-right: 30px; 
    max-width: 1400px;
    margin: 50px auto 0;
}

.accordion-item {
    border-bottom: 1px solid #eee; 
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden; 
}

.accordion-header {
    padding: 28px 0; 
    font-size: 19px; 
    font-weight: 500; 
    letter-spacing: 0.5px;
    width: 100%; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    transition: color 0.2s;
}

.accordion-icon {
    transition: transform 0.3s ease-out; 
    display: flex; 
    align-items: center;
}

/* Icon rotation is handled via CSS when aria-expanded="true" */
.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg); 
}

.accordion-content {
    max-height: 0; 
    overflow: hidden;
    transition: max-height 0.4s ease-in-out; 
}

.accordion-content-inner {
    padding: 0 0 30px 0; 
    font-size: 15px; 
    line-height: 1.7; 
    color: #666; 
}


/* --- FOOTER STYLING --- */
#main-footer {
    width: 100vw; 
    max-width: 100vw;
    margin-top: 50px;
    padding: 0;
    background-color: var(--color-black);
    color: var(--color-white);
    overflow-x: hidden !important; 
}

/* FIX: Added top padding to the footer container for spacing */
#main-footer > .container {
    padding-top: 40px; /* Added 40px top padding */
}

/* ---------------------------------------------------------------------------------- */
/* --- MOBILE RESPONSIVENESS FIXES (BELOW 992px) --- */
/* ---------------------------------------------------------------------------------- */
@media (max-width: 992px) {
    
    #product-main {
        padding-top: 80px; 
        padding-bottom: 30px; 
        width: 100vw; 
        max-width: 100vw; 
        overflow-x: hidden; 
        padding-left: 15px; 
        padding-right: 15px; 
        margin: 0 auto; 
    }
    
    .product-wrapper {
        grid-template-columns: 1fr;
        gap: 20px; 
        padding-left: 0; 
        padding-right: 0; 
        width: 100%;
        max-width: 100%; 
        margin: 0 auto; 
    }
    
    /* Strict constraints on all key child elements to prevent overflow */
    .product-gallery, 
    .main-product-image, 
    .product-info-header-desktop, 
    .purchase-options,
    .accordion-separator,
    .product-accordion {
        max-width: 100%;
        width: 100%;
        margin-left: 0; 
        margin-right: 0;
        padding-left: 0; 
        padding-right: 0; 
    }

    .thumbnail-selector {
        margin-top: 15px; 
        padding: 0; 
        justify-content: center; 
        max-width: 100%;
    }
    
    .product-title-desktop {
        font-size: 36px;
        text-align: center;
    }
    .product-price-desktop {
        font-size: 24px;
        text-align: center;
    }

    /* MOBILE ORDER */
    .purchase-options {
        margin-bottom: 0; 
        display: flex; 
        flex-direction: column;
        gap: 10px; 
        padding-top: 15px; 
        border-top: none;
    }
    
    .quantity-selector { order: 1; }
    .lens-type-selector { order: 2; }
    .prescription-option { order: 3; }
    .buy-button { order: 99; margin-top: 15px; } 

    .accordion-header {
        padding: 20px 0; 
        font-size: 17px; 
    }
    
    /* Mobile: Ensure gallery content has correct padding on the single column layout */
    .gallery-default {
         padding: 0 15px;
    }
    .specs-video-in-gallery {
        /* Remove margin-top in mobile to tighten up spacing, or adjust as needed */
        margin-top: 20px; 
        padding: 0 15px;
    }

    .accordion-content-inner {
        padding: 0 0 20px 0;
    }
    .product-accordion {
        padding-left: 15px; 
        padding-right: 15px; 
    }
}