/* ========================================= */
/* Product Detail Page Layout                */
/* ========================================= */

.product-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 100%;
    gap: 30px;
    margin-bottom: 60px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;

    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden; /* Prevent layout blowout */
}

@media (min-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 3fr 2fr;
        overflow: visible;
    }
}

/* ========================================= */
/* CSS-ONLY GALLERY (Logic Update)           */
/* ========================================= */

.product-detail-image-column {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.css-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 100%;
}

/* 1. Stage */
.gallery-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

/* Badges (Right Top) */
.badges-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: inline-block;
}
.status-badge.sold { background-color: #a93226; }
.status-badge.reserved { background-color: #933c00; }
.status-badge.draft { background-color: #4a5568; }
.status-badge.available { background-color: #145a32; }

/* Status specific layout adjustments */
.status-sold .main-img {
    filter: grayscale(30%);
}

.status-sold .product-detail-price {
    color: #7f8c8d;
    text-decoration: line-through;
    font-size: 1.4rem;
}

.status-reserved .product-detail-price {
    color: #d35400;
}

/* Status Notice Box */
.product-status-box {
    margin: 25px 0;
}

.status-notice {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 8px;
    align-items: center;
}

.sold-notice {
    background-color: #fdf2f2;
    border: 1px solid #fbd5d5;
}

.reserved-notice {
    background-color: #fffaf0;
    border: 1px solid #feebc8;
}

.notice-icon {
    font-size: 2.5rem;
}

.notice-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #2d3748;
}

.notice-content p {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 0.95rem;
}

.product-detail-dimensions {
    margin-top: 25px;
    margin-bottom: 25px;
}

/* Dimensions List */
.dimensions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dimensions-list li {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #D35400;
    font-size: 0.95rem;
    max-width: fit-content;
}

/* 2. Slides (Default Hidden) */
.gallery-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-container {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

.main-img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;

    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;

    width: 100%;
    min-width: 0;
    max-width: 100vw;

    touch-action: pan-x;
}
.gallery-thumbnails::-webkit-scrollbar { height: 6px; }
.gallery-thumbnails::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }

.thumb-label {
    cursor: pointer;
    border: 3px solid transparent; /* Thick border for visibility */
    border-radius: 6px;
    opacity: 0.5; /* Pale by default */
    transition: all 0.2s;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    background-color: #f4f4f4;
    scroll-snap-align: start;
}

.thumb-label:hover {
    opacity: 0.8;
}

.thumb-label img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}


@media (max-width: 767px) {
    .product-detail-page {
        padding: 15px;
    }

    .product-detail-layout {
        padding: 15px;
    }
}
/* ================================================================= */
/* THE CONNECTION LOGIC (Connects Top Radios to Slides & Thumbs)     */
/* Supports up to 12 images (standard limit for furniture)           */
/* ================================================================= */

/* Show Slide 1 when Radio 1 checked */
.gallery-radio:nth-of-type(1):checked ~ .gallery-stage .gallery-slide:nth-of-type(1) { opacity: 1; visibility: visible; z-index: 2; }
/* Highlight Thumb 1 when Radio 1 checked */
.gallery-radio:nth-of-type(1):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(1) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(2):checked ~ .gallery-stage .gallery-slide:nth-of-type(2) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(2):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(2) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(3):checked ~ .gallery-stage .gallery-slide:nth-of-type(3) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(3):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(3) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(4):checked ~ .gallery-stage .gallery-slide:nth-of-type(4) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(4):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(4) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(5):checked ~ .gallery-stage .gallery-slide:nth-of-type(5) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(5):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(5) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(6):checked ~ .gallery-stage .gallery-slide:nth-of-type(6) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(6):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(6) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(7):checked ~ .gallery-stage .gallery-slide:nth-of-type(7) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(7):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(7) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(8):checked ~ .gallery-stage .gallery-slide:nth-of-type(8) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(8):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(8) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(9):checked ~ .gallery-stage .gallery-slide:nth-of-type(9) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(9):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(9) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.gallery-radio:nth-of-type(10):checked ~ .gallery-stage .gallery-slide:nth-of-type(10) { opacity: 1; visibility: visible; z-index: 2; }
.gallery-radio:nth-of-type(10):checked ~ .gallery-thumbnails .thumb-label:nth-of-type(10) { border-color: #D35400; opacity: 1; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

/* ========================================= */
/* Info Column Styles                        */
/* ========================================= */

.product-detail-name {
    font-size: 2.2rem;
    color: #222;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.2;
}

.product-detail-price-container {
    margin-bottom: 20px;
}

.product-detail-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #D35400; /* Brand Color */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-primary { background-color: #a04000; color: white; }
.btn-primary:hover { background-color: #803000; }

.btn-secondary { background-color: #6c757d; color: white; }
.btn-secondary:hover { background-color: #5a6268; }

.btn-success { background-color: #145a32; color: white; }
.btn-success:hover { background-color: #0d3d21; }

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
    width: 100%;
}

@media (max-width: 480px) {
    .status-notice {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Description */
.product-detail-description h2 {
    font-size: 1.3rem;
    color: #555;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 30px;
}

.product-detail-meta {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    color: #666;
}

.product-detail-meta a {
    color: #D35400;
    text-decoration: underline;
}

/* ========================================= */
/* Similar Products Section                  */
/* ========================================= */

.section-separator {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #333;
}