/* Product Detail Page Styles */

/* Product Detail Section */
.product-detail-section {
    padding: 8rem 0 4rem; /* Increased top padding to account for fixed header */
    background: var(--background-color);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 80rem;
    margin: 0 auto;
    align-items: start;
}

/* Product Images */
.product-images {
    position: sticky;
    top: 2rem;
}

.main-image {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--neutral-light);
}

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

.main-image:hover img {
    transform: scale(1.02);
}

/* Image Carousel */
.image-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--neutral-light);
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carousel-slide:hover img {
    transform: scale(1.02);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.carousel-nav.prev {
    left: 1rem;
}

.carousel-nav.next {
    right: 1rem;
}

.carousel-nav i {
    font-size: 1rem;
    color: var(--text-dark);
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.carousel-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: white;
    transform: scale(1.2);
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Thumbnail Grid (fallback for single image) */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--neutral-light);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 196, 154, 0.2);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.thumbnail:hover img {
    transform: scale(1.1);
}

/* Product Info */
.product-info {
    padding: 1rem 0;
}

.product-badge {
    display: inline-block;
    background: rgba(0, 196, 154, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-price-section {
    margin-bottom: 2rem;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-old-price {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 1rem;
}

.product-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.product-features {
    margin-bottom: 2rem;
}

.product-features h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.features-list li::before {
    content: '✓';
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    background: rgba(0, 196, 154, 0.1);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Action Buttons */
.product-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-primary {
    flex: 1;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 196, 154, 0.3);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

/* Product Meta */
.product-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    font-weight: 600;
    color: var(--text-dark);
}

.meta-value {
    color: var(--text-muted);
}

/* Related Products */
.related-products-section {
    padding: 4rem 0;
    background: var(--neutral-light);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 3rem;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 2rem;
    max-width: 1000px; /* Reduced from 80rem */
    margin: 0 auto;
    justify-content: center; /* Center the cards */
}

.related-product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.related-product-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.related-product-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--neutral-light);
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-product-card:hover .related-product-image img {
    transform: scale(1.05);
}

.related-product-content {
    padding: 1.5rem;
}

.related-product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.related-product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.related-product-btn {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.related-product-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 196, 154, 0.3);
    color: white;
    text-decoration: none;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-images {
        position: static;
    }
    
    .product-title {
        font-size: 2rem;
    }
    
    .product-price {
        font-size: 1.75rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .related-products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-detail-section {
        padding: 1rem 0 2rem;
    }
    
    .product-detail-grid {
        gap: 1.5rem;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .carousel-nav {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .carousel-nav.prev {
        left: 0.5rem;
    }
    
    .carousel-nav.next {
        right: 0.5rem;
    }
    
    .carousel-indicators {
        bottom: 0.5rem;
    }
    
    .carousel-indicator {
        width: 0.5rem;
        height: 0.5rem;
    }
}
