/**
 * =====================================================================================
 * HELLA 3D MANAGEMENT SUITE: PRODUCT DETAIL PAGE (PDP) STYLESHEET
 * =====================================================================================
 * @file        product.css
 * @description Optimized layout for product galleries, variation selection, and cross-sells.
 * @version     1.0.0
 * @cleared     Jul 5, 2026
 * * ARCHITECTURE OVERVIEW:
 * 1. Sticky Galleries: Utilizes position: sticky on the left column to keep product imagery 
 * anchored while scrolling through long variation lists.
 * 2. Progressive Enhancement: Employs CSS filter: blur() on lazy-loaded cross-sell grids 
 * to provide smooth visual transitions as high-res images swap in.
 * 3. Invisible Inputs: Completely hides native radio buttons, styling their associated 
 * labels to create a premium, Apple-style tactile variation selector.
 * 4. Hover Query Isolation: Protects cards from mobile sticky-hover bugs using @media (hover: hover).
 * =====================================================================================
 */

/* --- 1. GLOBAL LAYOUT --- */
.page-main-content {
    position: relative;
    z-index: 10; 
    padding-top: 40px; 
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.pdp-container {
    max-width: 1500px; 
    width: calc(100% - 40px);
    margin: 0 auto 2rem auto; 
    display: flex;
    gap: 3.5rem; 
    align-items: flex-start;
    
    /* GLASSMORPHISM BASE */
    background-color: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* GLASSMORPHISM OPTIMIZATIONS */
    background-blend-mode: overlay; 
    will-change: backdrop-filter; 
    
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 2.5rem;
}

/* --- 2. LEFT COLUMN: IMAGE GALLERY --- */
.pdp-gallery-column {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 100px;
}

.pdp-main-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: rgba(0, 0, 0, 0.4); /* Reverted to preserve transparent part visibility */
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdp-main-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.pdp-badge-container {
    position: absolute; 
    top: 20px; 
    left: 20px;
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    z-index: 5;
}

.pdp-thumbnail-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.8rem;
}

.pdp-thumb {
    aspect-ratio: 3 / 2;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.pdp-thumb:hover img, .pdp-thumb.active img {
    opacity: 1;
}

.pdp-thumb.active {
    border-color: #ff3b3b;
}

/* --- 3. RIGHT COLUMN: PRODUCT INFO --- */
.pdp-info-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pdp-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.8rem;
}

.cat-pill {
    padding: 4px 12px;
    background: rgba(255, 59, 59, 0.15); 
    border: 1px solid rgba(255, 59, 59, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdp-title {
    font-size: 1.8rem; 
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.pdp-sku {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.pdp-price-block {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem; 
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pdp-price-current {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ff3b3b;
    line-height: 1;
}

.pdp-price-original {
    font-size: 1.2rem;
    color: #666;
    text-decoration: line-through;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.pdp-description {
    font-size: 1rem;
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 1.5rem; 
}

.fitment-info-box {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 4px solid #ff3b3b;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.fitment-info-box svg {
    width: 22px;
    height: 22px;
    color: #ff3b3b;
    flex-shrink: 0;
    margin-top: 2px;
}

.fitment-info-text {
    font-size: 0.85rem;
    color: #b0b0b0;
    line-height: 1.5;
}

.fitment-info-text strong {
    color: #ffffff;
}

/* --- 4. APPLE-STYLE VARIATION ENGINE --- */
.pdp-variations-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.variation-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.variation-label {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variation-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variation-radio { display: none; }

.variation-btn {
    display: inline-block;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.variation-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.variation-radio:checked + .variation-btn {
    border-color: #ff3b3b;
    background: rgba(255, 59, 59, 0.15);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 59, 59, 0.1);
}

/* --- 5. ADD TO CART & DISCLAIMER --- */
.pdp-action-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.qty-selector {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    width: 130px;
}

.qty-btn {
    width: 40px;
    height: 52px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.qty-btn:hover { background: rgba(255, 255, 255, 0.1); }
.qty-btn:active { transform: scale(0.85); background: rgba(255, 255, 255, 0.2); }

.qty-input {
    flex: 1;
    height: 52px;
    background: transparent;
    border: none;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    outline: none;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease;
}

.qty-input.qty-pop {
    transform: scale(1.25);
    color: #ff3b3b;
}

.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-add-to-cart {
    flex: 1;
    height: 52px;
    background-color: #ff3b3b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-to-cart:hover {
    background-color: #ff1f1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 59, 59, 0.4);
}

.btn-add-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 59, 59, 0.3);
}

.btn-add-to-cart:disabled {
    background-color: #555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.product-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-disclaimer svg { width: 18px; height: 18px; color: #888; flex-shrink: 0; margin-top: 2px; }
.product-disclaimer span { font-size: 0.8rem; color: #888; line-height: 1.5; }
.product-disclaimer strong { color: #a0a0a0; }

/* --- 6. CROSS-SELL GRIDS --- */
.showcase-wrapper { 
    max-width: 1800px; 
    width: calc(100% - 40px); 
    margin: 0 auto 2rem auto; 
    position: relative; 
    z-index: 10; 
} 

.showcase-category { margin-bottom: 3rem; } 
.showcase-category:last-child { margin-bottom: 0; } 

.showcase-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 2rem; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    padding-bottom: 1rem; 
}

.showcase-header h2 { font-size: 2rem; font-weight: 700; color: #ffffff; margin: 0; }
.product-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem; }

.product-card { 
    background-color: var(--glass-bg); 
    background-image: var(--glass-noise); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    background-blend-mode: overlay;
    will-change: backdrop-filter; 
    border: 1px solid var(--glass-border); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); 
    border-radius: 16px; 
    overflow: hidden; 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease; 
    -webkit-tap-highlight-color: transparent; /* Kills the mobile blue flash */
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover { 
        transform: translateY(-8px); 
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.15); 
        border-color: rgba(255, 59, 59, 0.3); 
    }
    
    /* REMOVED the opacity drop on primary-img to fix the background flash. 
       Hover image now gracefully fades IN over top of the solid primary image. */
    .product-card:hover a.product-image-container.has-hover img.hover-img { 
        opacity: 1; 
    }
    
    .product-card:hover .product-add-icon { background: #ff3b3b; }
}

a.product-image-container, .product-image-container { 
    width: 100%; 
    aspect-ratio: 3 / 2; 
    background: rgba(0, 0, 0, 0.2); /* Reverted to preserve transparent part visibility */
    position: relative; 
    overflow: hidden; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0; 
    text-decoration: none !important; /* Strips browser blue underline */
    color: inherit;
}

/* Progressive Loading Image Styles */
.product-image-container img { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: filter 0.4s ease, transform 0.4s ease, opacity 0.4s ease; 
}

.product-image-container img.hover-img { opacity: 0; }

.lazy-grid-img { filter: blur(10px); transform: scale(1.05); }
.lazy-grid-img.loaded { filter: blur(0); transform: scale(1); }

.badge-container { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.product-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: white; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.badge-sale { background: rgba(255, 59, 59, 0.9); }
.badge-oos { background: rgba(85, 85, 85, 0.9); }
.badge-discontinuing { background: rgba(255, 152, 0, 0.9); color: #000; }

a.product-details, .product-details { 
    padding: 1.25rem 1.25rem 1.5rem 1.25rem; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    text-decoration: none !important; /* Strips browser blue underline */
    color: inherit;
}

.product-tag { 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: #ff3b3b; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    margin-bottom: 0.5rem; 
}

.product-title { 
    color: #ffffff; 
    font-size: 1rem; 
    font-weight: 700; 
    line-height: 1.4; 
    margin-bottom: 1.5rem; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.product-price-row { 
    margin-top: auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.price-block { display: flex; align-items: center; gap: 8px; }
.product-price { font-size: 1.2rem; font-weight: 800; color: #ff3b3b; }
.price-original { text-decoration: line-through; color: #888; font-size: 0.9rem; font-weight: 500; }

.product-add-icon { 
    width: 34px; 
    height: 34px; 
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #ffffff; 
    transition: background 0.2s ease; 
}

/* MOBILE JS TOGGLE OVERRIDE */
/* Removed opacity: 0 from primary-img to eliminate flash */
.product-card.is-flipped .hover-img { opacity: 1 !important; }

/* --- MOBILE IMAGE TOGGLE BUTTON --- */
.mobile-image-toggle-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background-color: #1e1e1e; 
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4); 
    -webkit-tap-highlight-color: transparent; /* Kills the mobile blue flash */
}

.mobile-image-toggle-btn:active {
    transform: scale(0.92);
}

.mobile-image-toggle-btn svg { width: 20px; height: 20px; pointer-events: none; }

@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}

@media (max-width: 1300px) { 
    .product-grid { grid-template-columns: repeat(3, 1fr); } 
    .pdp-container { gap: 2.5rem; padding: 2rem; }
}

@media (max-width: 968px) { 
    .pdp-container { flex-direction: column; }
    .pdp-title { font-size: 2rem; }
    .pdp-gallery-column { width: 100%; position: static; }
    .pdp-info-column { width: 100%; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } 
}

@media (max-width: 500px) { 
    .product-grid { grid-template-columns: 1fr; } 
    .pdp-action-row { flex-direction: column; }
    .qty-selector { width: 100%; justify-content: space-between; }
    .btn-add-to-cart { width: 100%; flex: none; flex-shrink: 0; height: 52px; } 
}