.main-container {
    margin-top: 40px; 
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgb(230, 230, 230);
    background: #f9f9f9;
    box-shadow: 0 8px 24px 0 rgba(26,44,80,0.10);
}

@media (max-width: 768px) {
    .main-container {
        margin-top: 0;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .col-lg-6.px-3 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}


/* Main product image */
.main-image {
    background: #fafbfc;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(2, 27, 78, 0.04);
    /* border: 1px solid crimson; */
}

.main-image img {
    width: 100%;
    min-height: 340px;
    max-height: 340px;
    object-fit: contain;
    border-radius: 10px;
    background: #f7f7f7;
}

@media (max-width: 768px) {
    .main-image img {
        min-height: 250px;
        max-height: 250px;
    }
}

/* Thumbnail images */
.thumb-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    /* border: 1px solid crimson; */
}
.thumb-images img {
    width: 80px;
    height:80px;
    object-fit: cover;
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s;
}
.thumb-images img:hover,
.thumb-images img.active-thumb {
    border: 1px solid #1a2c50;
    box-shadow: 0 2px 8px rgba(26,44,80,0.10);
}

/* Product title, category, price */
.product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.product-category {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.product-price {
    font-size: 1.7rem;
    font-weight: 700;
    color: #e85d04;
    margin-bottom: 0.7rem;
}

@media (max-width: 768px) {
    .product-title {
        font-size: 1.5rem;
    }
    .product-price {
        font-size: 1.4rem;
    }
}
.product-price .text-muted {
    font-size: 1.1rem;
    color: #888 !important;
}

/* Total stock & section spacing */
.merch-product-detail strong {
    font-weight: 600;
    color: #1a2c50;
}
.merch-product-detail .mb-3 {
    margin-bottom: 1.1rem !important;
}

/* Variant & size grid */
.variant-grid, .size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.7rem;
}

@media (max-width: 768px) {
    .variant-grid, .size-grid {
        gap: 8px;
    }
}
.variant-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e0e0e0;
    padding: 6px 14px 6px 6px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s, background 0.15s, color 0.15s;
}
.variant-btn img {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border: 1px solid #eee;
    background: #f7f7f7;
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    background: #fff;
    cursor: pointer;
    min-width: 50px;
    width: 65px;
    height: 40px;
    font-size: 1rem;
    font-weight: 600;
    transition: border 0.2s, box-shadow 0.2s, background 0.15s, color 0.15s;
}
.size-btn[disabled], .size-btn input[disabled] + span {
    color: #ccc !important;
    background: #f7f7f7;
    cursor: not-allowed;
}

.variant-btn input:checked + span,
.variant-btn input:checked ~ span,
.size-btn input:checked + span,
.size-btn input:checked ~ span {
    color: #1a2c50;
    /* font-weight: bold; */
}
.variant-btn:hover, .size-btn:hover {
    border: 1px solid #1a2c50;
    box-shadow: 0 2px 8px rgba(26,44,80,0.08);
}
.variant-btn.active,
.size-btn.active {
    border: 1px solid #1a2c50 !important;
    font-weight: bold;
    color: #1a2c50;
    background: #f3f6ff;
    box-shadow: 0 2px 8px rgba(26,44,80,0.10);
}

/* Add to cart button */
.btn-primary {
    background: #1a2c50;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 8px;
    padding: 12px 0;
    margin-top: 10px;
    transition: background 0.2s;
}
.btn-primary:disabled {
    background: #bfc8e6;
    color: #fff;
    cursor: not-allowed;
}

/* Product description */
.product-desc {
    color: #222;
    font-size: 1.08rem;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(26,44,80,0.04);
}

/* Related products card */
.related-products-section .card {
    background: #e8e8e8;
    border: 1.5px solid #b5b5b5;
    transition: box-shadow 0.18s, transform 0.18s;
}
.related-products-section .card:hover {
    box-shadow: 0 4px 16px rgba(26,44,80,0.13);
    transform: translateY(-3px) scale(1.03);
}
.related-products-section .related-img {
    height:130px;
    object-fit:cover;
}
.related-products-section .related-title {
    font-size:15px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.related-products-section .related-price {
    font-size:14px;
    color:#e85d04;
}

/* Product original strike price */
.product-price .original-strike {
    font-size:15px;
}

/* ==== Thumbnail Carousel ==== */
.thumb-carousel {
    position: relative;
    margin-bottom: 18px;
    padding: 6px 42px; /* ruang untuk tombol */
    background: transparent;
    border-radius: 10px;
}

.thumb-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.thumb-track {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.35s ease;
    will-change: transform;
}

.thumb-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    background: #f7f7f7;
    transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
}

.thumb-item:hover {
    border-color: #1a2c50;
    box-shadow: 0 2px 8px rgba(26,44,80,0.10);
    transform: scale(1.04);
}

.thumb-item.active-thumb {
    border-color: #1a2c50;
    box-shadow: 0 2px 8px rgba(26,44,80,0.15);
}

.thumb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(26,44,80,0.85);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, opacity 0.2s;
}

.thumb-nav.prev { left: 6px; }
.thumb-nav.next { right: 6px; }

.thumb-nav:hover:not(:disabled) {
    background: rgba(26,44,80,1);
}

.thumb-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-group {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    width: max-content;
}
.qty-input {
    width: 48px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 6px 0;
    background: transparent;
}
.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f6ff;
    color: #1a2c50;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.qty-btn:active {
    background: #e0e7ff;
}
.qty-btn:disabled {
    color: #ccc;
    background: #f7f7f7;
    cursor: not-allowed;
}

/* --- Product Guide Modal --- */
.product-guide-modal .modal-header {
    background: linear-gradient(135deg, #f3f6ff 0%, #e8eeff 100%);
    border-bottom: 2px solid #d0d9f5;
    padding: 1.2rem 1.5rem;
}
.product-guide-modal .modal-title {
    font-weight: 700;
    color: #1a2c50;
    font-size: 1.3rem;
}
.product-guide-modal .modal-body {
    background: #fff;
    padding: 1.8rem;
}
.product-guide-modal .guide-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 0 auto 1.5rem;
    display: block;
    border: 1px solid #e0e7ef;
}
.product-guide-modal .product-guide-content {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}
.product-guide-modal .product-guide-content table {
    border-collapse: collapse !important;
    width: 100%;
    margin: 1rem auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.product-guide-modal .product-guide-content th,
.product-guide-modal .product-guide-content td {
    border: 1px solid #8a9bc4 !important;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.9rem;
}
.product-guide-modal .product-guide-content th {
    background: linear-gradient(135deg, #e8eeff 0%, #d0d9f5 100%);
    font-weight: 700;
    color: #1a2c50;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.product-guide-modal .product-guide-content td {
    background: #fafbff;
}
.product-guide-modal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e7ef;
    padding: 0.9rem 1.5rem;
}

/* Image modal preview styling */
#imageModal .modal-body {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.5rem;
}

#modal-image-el {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    cursor: zoom-in;
    transition: transform 0.25s ease;
    display: block;
    margin: 0 auto;
}

#modal-image-el.zoomed {
    transform: scale(1.8);
    cursor: zoom-out;
}

/* Close button - must be visible and clickable on all devices */
#imageModal .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    opacity: 0.9;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

#imageModal .btn-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.4);
}

/* Modal centering and spacing */
#imageModal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
}

#imageModal .modal-content {
    background: transparent;
    border: none;
    width: 100%;
    max-width: 90vw;
    margin: 0 auto;
}

/* Mobile-specific modal styles */
@media (max-width: 768px) {
    #imageModal .modal-content {
        background: rgba(0,0,0,0.92);
        max-width: 100vw;
    }

    #imageModal .modal-body {
        padding: 1rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #modal-image-el {
        max-height: calc(100vh - 100px);
        max-width: calc(100vw - 2rem);
        object-fit: contain;
    }

    /* Larger, more visible close button on mobile */
    #imageModal .btn-close {
        width: 48px;
        height: 48px;
        top: 15px;
        right: 15px;
        background-color: rgba(255, 255, 255, 0.25);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    .thumb-carousel { 
        padding: 6px 36px; 
    }
    .thumb-item { 
        width: 70px; 
        height: 70px; 
    }
}

@media (max-width: 420px) {
    #modal-image-el {
        max-height: calc(100vh - 80px);
        max-width: calc(100vw - 1.5rem);
    }
    
    #imageModal .btn-close {
        top: 10px;
        right: 10px;
    }
}