/* Product Page Specific Styles */
/* Inherits base styles from storefront.css */

/* Error Page */
.error-page {
    padding: 8rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-content h1 {
    font-size: 3rem;
    font-weight: 300;
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Product Page Layout */
.product-page {
    padding-top: 100px; /* Account for fixed header */
    padding-bottom: 4rem;
    min-height: 100vh;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb span {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

/* Product Container */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
}

/* Product Images */
.product-images {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-image {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    background: rgb(255, 255, 255);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.placeholder-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1.125rem;
    font-weight: 300;
}

.thumbnail-images {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--border);
    object-fit: contain;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.thumbnail:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--accent);
    border-width: 3px;
}

/* Product Details */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand {
    color: var(--accent);
    font-weight: 600;
}

.category {
    color: var(--text-muted);
    font-weight: 400;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--primary);
    line-height: 1.2;
    margin: 0;
}

.product-price {
    margin: 1rem 0;
}

.current-price {
    font-size: 2.25rem;
    font-weight: 300;
    color: var(--primary);
}

.product-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
}

.variant-selection {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    background: var(--gray-50);
}

.variant-selection h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1rem;
}

.variant-group {
    margin-bottom: 1.25rem;
}

.variant-group:last-child {
    margin-bottom: 0;
}

.variant-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.variant-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.variant-option {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--gray-50);
}

.variant-option.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.variant-option.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.variant-option:disabled {
    cursor: not-allowed;
}

.stock-indicator {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #e53e3e;
    white-space: nowrap;
}

/* Stock Status */
.stock-status {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.in-stock {
    color: #38a169;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}

.out-of-stock {
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #feb2b2;
}

/* Product Actions */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.add-to-cart:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-1px);
}

/* Product Specifications */
.product-specifications {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.product-specifications h3 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.spec-grid {
    display: grid;
    gap: 0.75rem;
}

.spec-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.spec-value {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-container {
        gap: 3rem;
    }
    
    .main-image {
        height: 400px;
    }
    
    .product-title {
        font-size: 2rem;
    }
    
    .current-price {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding-top: 80px;
        padding-bottom: 2rem;
    }
    
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .main-image {
        height: 350px;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .current-price {
        font-size: 1.75rem;
    }
    
    .breadcrumb {
        padding: 1rem 0;
    }
    
    .variant-selection {
        padding: 1.5rem;
    }
    
    .variant-options {
        gap: 0.5rem;
    }
    
    .variant-option {
        padding: 0.5rem 1rem;
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .product-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        border-top: 1px solid var(--border);
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .product-actions .btn-large {
        margin: 0;
    }
    
    /* Add padding to body to account for fixed actions */
    body {
        padding-bottom: 120px;
    }
}

@media (max-width: 480px) {
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .thumbnail-images {
        gap: 0.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .spec-item {
        grid-template-columns: 120px 1fr;
        gap: 0.75rem;
    }
    
    .spec-label {
        font-size: 0.875rem;
    }
    
    .spec-value {
        font-size: 0.875rem;
    }
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image zoom effect */
.main-image:hover img {
    transform: scale(1.05);
}

/* Featured badge */
.featured-product {
    position: relative;
}

.featured-product::before {
    content: "â­ Featured";
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .product-actions,
    .breadcrumb {
        display: none;
    }
    
    .product-page {
        padding-top: 0;
    }
    
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .main-image {
        height: auto;
        max-height: 400px;
    }
    
    .variant-selection,
    .stock-status {
        border: 1px solid #ccc;
    }
}

/* Accessibility improvements */
.variant-option:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.thumbnail:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .variant-option {
        border-width: 2px;
    }
    
    .variant-option.active {
        border-width: 3px;
    }
    
    .spec-item {
        border-bottom-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .main-image img,
    .thumbnail,
    .variant-option,
    .btn-large {
        transition: none;
    }
    
    .loading-placeholder {
        animation: none;
        background: var(--gray-200);
    }
}

/* Dark mode support (if implemented later) */
@media (prefers-color-scheme: dark) {
    .variant-selection {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .variant-option {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .variant-option:hover:not(:disabled) {
        background: #4a5568;
    }
    
    .placeholder-image {
        color: #718096;
    }
}