/* --- Main Layout --- */
.pd-container {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

/* --- Breadcrumb --- */
.custom-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.custom-breadcrumb a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.custom-breadcrumb a:hover {
    color: #1a1a1a;
}
.custom-breadcrumb .breadcrumb-item.active {
    color: #1a1a1a;
    font-weight: 500;
}

/* --- Left: Image Gallery (Fixed 1:1 Ratio) --- */
.pd-gallery-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;    /* บังคับสัดส่วนสี่เหลี่ยมจัตุรัส */
    background-color: #ffffff; /* พื้นหลังสีขาว */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: zoom-in; /* เมาส์เป็นรูปแว่นขยาย */
}

.pd-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;    /* จัดรูปให้พอดีกรอบ ไม่เบี้ยว ไม่โดนตัด */
    transition: opacity 0.3s ease;
    display: block;
}

/* ป้าย Sold Out */
.sold-overlay {
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    pointer-events: none;
}
.sold-text {
    background: #000; 
    color: #fff; 
    padding: 10px 30px;
    font-size: 1.5rem; 
    text-transform: uppercase; 
    letter-spacing: 2px;
}

/* ไอคอนแว่นขยาย */
.zoom-icon-hint {
    position: absolute; 
    bottom: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}

/* --- Thumbnails (รูปเล็กด้านล่าง) --- */
.pd-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
}

.thumb-item {
    width: 70px;
    height: 70px;
    border: 1px solid #ddd;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    flex-shrink: 0;
    background: #fff;
    padding: 2px;
    border-radius: 4px;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.thumb-item:hover {
    opacity: 1;
    border-color: #999;
}

.thumb-item.active {
    opacity: 1;
    border-color: #000;
    border-width: 2px;
}

/* --- Right: Product Info (Sticky) --- */
.pd-info-wrapper {
    position: sticky;
    top: 120px;
    padding-left: 2rem;
}

.pd-brand {
    font-size: 0.9rem;
    color: #D4AF37; /* สีทอง */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.pd-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.pd-price {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.pd-description {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* --- Actions Buttons --- */
.btn-action-group {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.btn-add-cart {
    flex: 2;
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #1a1a1a;
    padding: 15px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s;
}
.btn-add-cart:hover {
    background-color: #fff;
    color: #1a1a1a;
}

.btn-line-contact {
    flex: 1;
    background-color: #00B900; /* สีเขียว LINE */
    color: #fff;
    border: 1px solid #00B900;
    padding: 15px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none; /* เอาขีดเส้นใต้ออก */
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-line-contact:hover {
    background-color: #009900;
    color: #fff;
}

/* --- Accordion (Details) --- */
.pd-accordion .accordion-item {
    border: none;
    border-bottom: 1px solid #eee;
}
.pd-accordion .accordion-button {
    background: transparent;
    box-shadow: none;
    padding: 1.2rem 0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #1a1a1a;
}
.pd-accordion .accordion-button:not(.collapsed) {
    color: #D4AF37;
    background-color: transparent; /* แก้ไขไม่ให้มีพื้นหลังเทา */
}
.pd-accordion .accordion-body {
    padding: 0 0 1.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* --- Related Products (Swiper) --- */
.related-section {
    background-color: #fafafa;
    padding: 4rem 0;
    margin-top: 4rem;
}
.related-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Swiper Nav Buttons */
.swiper-button-next, .swiper-button-prev {
    color: #000;
    background: rgba(255,255,255,0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

/* Related Product Card Hover */
.related-card {
    transition: transform 0.3s ease;
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* --- Lightbox Modal (Zoom Fullscreen) --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: 0.3s;
}
.lightbox-close:hover { color: #bbb; }

.lightbox-modal.show { display: flex; opacity: 1; }
.lightbox-modal.show .lightbox-content { transform: scale(1); }

/* --- Mobile Adjustments --- */
@media (max-width: 991px) {
    .pd-info-wrapper {
        position: static;
        padding-left: 0;
        margin-top: 2rem;
    }
    .pd-title { font-size: 1.8rem; }
    
    .pd-gallery-wrapper {
        margin-bottom: 10px;
    }
}