/* css/product-detail.css */

.product-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5cqmax;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--text-primary);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

/* Gallery */
.product-gallery {
    position: sticky;
    top: 100px;
}

.gallery-main {
    position: relative;
    aspect-ratio: 3 / 5;
    background: var(--bg-card);
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid transparent;
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--accent);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Info */
.product-breadcrumb {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.product-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-price-container {
    margin-bottom: 2rem;
}

.product-original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    margin-right: 1rem;
}

.product-price {
    font-size: 2rem;
    font-family: var(--font-display);
    color: var(--accent-gold);
}

.product-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.product-option {
    margin-bottom: 2rem;
}

.product-option h4 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.option-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.option-btn.active {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: var(--bg-primary);
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    width: fit-content;
    box-sizing: border-box;
}

.quantity-selector button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

/* Accordion */
.product-accordion {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-header {
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--text-secondary);
}

.accordion-content.active {
    max-height: 200px;
    padding-bottom: 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-gallery {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .product-detail-container {
        padding: 1rem;
        overflow-x: hidden;
    }

    .product-detail-grid {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    /* Bleed the gallery edge-to-edge so a tall 3:5 image reads
       full-width and elegant instead of boxed in by page padding. */
    .product-gallery {
        margin: -1rem -1rem 0;
        width: calc(100% + 2rem);
    }

    .gallery-main {
        aspect-ratio: 3 / 5;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .gallery-thumbnails {
        padding: 0 1rem;
        gap: 0.4rem;
        margin-top: 0.75rem;
    }

    .thumbnail {
        width: 52px;
        height: 52px;
    }

    .product-info {
        padding: 0 0.25rem;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-price {
        font-size: 1.4rem;
    }

    .product-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .product-option {
        margin-bottom: 1rem;
    }

    .option-buttons {
        gap: 0.4rem;
    }

    .option-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .quantity-selector {
        width: 100%;
        justify-content: space-between;
    }

    #addToCartBtn {
        width: 100%;
        box-sizing: border-box;
    }

    .add-review-container {
        padding: 1rem !important;
    }

    .reviews-summary {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}