/* Product Page - ALD-Inspired Layout with OF THE CULTURE Foundation */

/* 
==============================================================================
🎯 PRODUCT PAGE ARCHITECTURE - ALD-INSPIRED DESIGN
==============================================================================

This product page maintains OF THE CULTURE's minimal aesthetic while incorporating
ALD-inspired layout patterns:
- Clean vertical layout with accordion sections
- Thin, refined typography
- Main image + 2 half-width secondary images
- Light grey Add to Cart treatment
- Floating mobile cart with proper spacing

==============================================================================
*/

/* Product Page Container */
.product-page {
    max-width: 1200px; /* Much wider for horizontal desktop layout */
    margin: 0 auto;
    padding: 0 40px;
}

/* CRITICAL: Ensure consistent wordmark/footer positioning on product pages */
.product-page .wordmark-section {
    margin-bottom: 80px !important;
}

.product-page .footer-section {
    margin-bottom: 40px !important;
    margin-top: 80px !important;
}

/* Product Content Grid - ALD Layout */
.product-container {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.2fr;
    gap: 80px;
    margin-bottom: 120px;
    margin-top: 80px;
    align-items: start;
}

/* ==============================================================================
   PRODUCT IMAGES - Center Column with Lookbook-style View System
============================================================================== */

.product-images {
    display: flex;
    flex-direction: column;
    grid-column: 2;
}

.product-gallery {
    width: 100%;
}

/* Main Product Image */
.image-container.main-view {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 2px;
}

/* Product Image Element - Consistent Sizing Across All Products */
.product-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* Ensures consistent 4:5 aspect ratio container sizing */
}

/* Additional Views Grid */
.additional-views {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0;
}

.image-container.view-item {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 2px;
}

/* Placeholder Images */
.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f8f8 0%, #eeeeee 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.placeholder-image.small {
    font-size: 0.7rem;
}

.placeholder-text {
    color: #555;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.placeholder-subtitle {
    color: #555;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 300;
    opacity: 0.7;
    margin-top: 4px;
    letter-spacing: 0.05em;
}

.placeholder-image.small .placeholder-text {
    font-size: 0.7rem;
}

.placeholder-image.small .placeholder-subtitle {
    font-size: 0.5rem;
}

/* Image Overlay System */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(1px);
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.view-label {
    color: var(--color-white);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.view-label:hover {
    background-color: var(--color-white);
    color: var(--color-black);
}

.thumbnail:hover {
    opacity: 0.8;
}

/* ==============================================================================
   PRODUCT DETAILS - Left Column (ALD Style)
============================================================================== */

.product-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
    grid-column: 1;
}

.product-purchase {
    display: flex;
    flex-direction: column;
    gap: 30px;
    grid-column: 3;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 50px;
}

.product-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-black);
    line-height: 1.3;
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.product-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-gold);
    margin: 16px 0;
    letter-spacing: 0;
}

.product-page .product-description {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    color: #333333;
    letter-spacing: 0;
}

.product-page .product-description p {
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.product-description p:last-child {
    margin-bottom: 0;
}

/* Cultural headers styling - Removed gold for product pages */
.cultural-header {
    color: var(--color-black);
    font-weight: 500;
    opacity: 0.9;
}

/* ==============================================================================
   PURCHASE FORM - Desktop Version
============================================================================== */

.purchase-form.desktop-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 36px;
    background-color: #f7f7f7;
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Desktop product info row - matches mobile */
.desktop-product-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.desktop-product-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.desktop-product-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-black);
    letter-spacing: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.size-selection,
.quantity-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.size-selection label,
.quantity-selection label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.product-page .size-selection select,
.product-page .quantity-selection select {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-color: var(--color-white);
    border-radius: 2px;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.product-page .size-selection select:focus,
.product-page .quantity-selection select:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
}

.add-to-cart-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    padding: 16px 24px;
    background-color: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.add-to-cart-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Universal inline validation styling - all devices */
.add-to-cart-btn:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

.add-to-cart-btn:disabled:hover {
    opacity: 1;
    transform: none;
}

.size-selection select.error {
    border-color: var(--color-gold) !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 1px var(--color-gold) !important;
}

/* ==============================================================================
   MOBILE PURCHASE FORM - Fixed Bottom
============================================================================== */

.purchase-form.mobile-form {
    display: none; /* Hidden on desktop */
}

/* ==============================================================================
   PRODUCT SPECIFICATIONS - ACCORDION STYLE
============================================================================== */

.product-specs {
    border-top: 1px solid #e5e5e5;
    margin-top: 40px;
}

.spec-accordion {
    border-bottom: 1px solid #e5e5e5;
}

.spec-accordion-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-black);
    padding: 16px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.spec-accordion-header:hover {
    opacity: 0.7;
}

.spec-accordion-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.spec-accordion.open .spec-accordion-icon {
    transform: rotate(180deg);
}

.spec-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.spec-accordion.open .spec-accordion-content {
    max-height: none; /* Remove fixed height to prevent mobile overflow */
    height: auto;
}

.spec-accordion-body {
    padding: 20px 0; /* Equal top/bottom padding */
}

.product-page .spec-accordion-body p {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 8px;
    color: #333333;
}

.spec-accordion-body p:last-child {
    margin-bottom: 0;
}

/* ==============================================================================
   NAVIGATION FOOTER
============================================================================== */

.navigation-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e5e5e5;
}

/* ==============================================================================
   MOBILE RESPONSIVE DESIGN
============================================================================== */

@media (max-width: 768px) {
    /* CRITICAL: Ensure mobile wordmark/footer positioning matches homepage */
    .product-page .wordmark-section {
        margin-bottom: 60px !important;
    }
    
    .product-page .footer-section {
        margin-bottom: 40px !important;
        margin-top: 60px !important;
    }
    
    .product-page {
        max-width: 600px !important; /* Match lookbook mobile width */
        padding: 30px 16px 160px 16px !important; /* Extra bottom padding for footer visibility above cart */
    }
    
    .product-container {
        grid-template-columns: 1fr;
        gap: 50px;
        margin-top: 50px;
        margin-bottom: 40px; /* Significantly reduced bottom margin */
    }
    
    .product-images {
        grid-column: 1;
        order: 1;
    }
    
    .product-details {
        grid-column: 1;
        order: 2;
    }
    
    .product-purchase {
        grid-column: 1;
        order: 3;
    }
    
    .product-details {
        gap: 30px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 0.85rem;
    }
    
    .thumbnail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .thumbnail {
        height: 70px;
    }
    
    /* Hide desktop form on mobile */
    .purchase-form.desktop-form {
        display: none;
    }
    
    /* Show and position mobile form - ALD-style with product info */
    .purchase-form.mobile-form {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #f7f7f7;
        border: none;
        padding: 20px;
        z-index: 1000;
        gap: 16px;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
        border-radius: 0;
        transform: translate3d(0, 100%, 0);
        transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
        will-change: transform;
        backface-visibility: hidden;
    }
    
    /* Mobile cart visible state - elegant slow gliding animation */
    .purchase-form.mobile-form.visible {
        transform: translate3d(0, 0, 0);
        transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    }
    
    /* Product info row in mobile cart */
    .mobile-product-info {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .mobile-product-name {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--color-black);
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    
    .mobile-product-price {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--color-black);
        letter-spacing: 0;
    }
    
    /* Form controls row */
    .mobile-form-controls {
        display: flex;
        align-items: end;
        gap: 12px;
    }
    
    .mobile-form-controls .size-selection {
        flex: 1.2;
        gap: 6px;
    }
    
    .mobile-form-controls .quantity-selection {
        flex: 0.8;
        gap: 6px;
    }
    
    .mobile-form label {
        font-size: 0.85rem;
        margin-bottom: 4px;
        font-weight: 400;
        opacity: 0.8;
    }
    
    .product-page .mobile-form select {
        font-family: 'JetBrains Mono', monospace !important;
        font-weight: 400 !important;
        border: 1px solid rgba(0, 0, 0, 0.2);
        border-radius: 2px;
        background-color: rgba(255, 255, 255, 0.9);
        color: #333333;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><polyline points='18,15 12,9 6,15'></polyline></svg>");
        background-repeat: no-repeat;
        direction: ltr;
        /* Sizing handled by media query below for better specificity */
    }
    
    .mobile-form .add-to-cart-btn {
        flex: 2;
        padding: 14px 20px;
        font-size: 0.85rem;
        height: 48px;
        border-radius: 0;
        font-weight: 400;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile navigation adjustments */
    .navigation-footer {
        margin-top: 40px;
        padding-top: 30px;
    }
}

/* ==============================================================================
   TABLET RESPONSIVE (768px - 1024px)
============================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .product-page {
        max-width: 800px;
    }
    
    .product-container {
        gap: 50px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .thumbnail-grid {
        gap: 8px;
    }
    
    .form-row {
        gap: 16px;
    }
}

/* ==============================================================================
   ACCESSIBILITY ENHANCEMENTS
============================================================================== */

/* Universal SELECT element styling for consistent sizing */
.product-page select {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.85rem !important;
    font-weight: 400;
}

/* Mobile override - Higher specificity than global rules */
@media (max-width: 768px) {
    .product-page .purchase-form.mobile-form select {
        font-size: 0.75rem !important;
        padding: 14px 8px !important;
        height: 48px !important;
        line-height: 1.2 !important;
        background-position: right 8px center !important;
        background-size: 14px !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile focus styling - no gold borders */
    .product-page .purchase-form.mobile-form select:focus {
        outline: none !important;
        border-color: rgba(0, 0, 0, 0.3) !important;
        box-shadow: none !important;
    }
}

/* Focus states for keyboard navigation */
.thumbnail:focus,
.add-to-cart-btn:focus,
.product-page select:focus {
    outline: 1px solid rgba(0, 0, 0, 0.2);
    outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .thumbnail {
        border: 1px solid var(--color-black);
    }
    
    .thumbnail.active {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .main-image,
    .thumbnail,
    .add-to-cart-btn {
        transition: none;
    }
}

/* ==============================================================================
   PERFORMANCE OPTIMIZATIONS
============================================================================== */

.main-image {
    will-change: opacity;
}

.thumbnail {
    will-change: opacity, border-color;
}

.add-to-cart-btn {
    will-change: transform, opacity;
}

/* ==============================================================================
   PRINT STYLES
============================================================================== */

@media print {
    .purchase-form,
    .navigation-footer {
        display: none;
    }
    
    .product-page {
        max-width: none;
        padding: 0;
    }
    
    .product-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}