/* Product Detail Page Styles */

.product-detail-container {
    background-color: #f5f5f5;
    padding-bottom: 40px;
}

/* Breadcrumb */
.product-breadcrumb {
    background: white;
    padding: 15px 0;
    margin-bottom: 20px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li::after {
    content: '>';
    margin-left: 8px;
    color: #999;
}

.breadcrumb li:last-child::after {
    content: '';
}

.breadcrumb a {
    color: #05a;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #ee4d2d;
}

/* Product Main Section */
.product-main {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Product Images */
.product-images {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid #efefef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumbnails {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.thumbnail {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #ee4d2d;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-info {
    padding: 0 20px;
}

.product-name {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 20px;
    line-height: 1.4;
}

/* Price Section */
.product-price-section {
    background: #fafafa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-price {
    font-size: 32px;
    color: #ee4d2d;
    font-weight: 500;
}

.original-price {
    font-size: 16px;
    color: #929292;
    text-decoration: line-through;
}

.discount-badge {
    background: #ee4d2d;
    color: white;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

/* Wholesale Info */
.product-wholesale {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #efefef;
    margin-bottom: 15px;
}

.wholesale-label {
    min-width: 120px;
    color: #757575;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wholesale-value {
    color: #222;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wholesale-detail {
    color: #05a;
    text-decoration: none;
    font-size: 13px;
}

.wholesale-detail:hover {
    color: #ee4d2d;
}

/* Shipping Info */
.product-shipping {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #efefef;
    margin-bottom: 15px;
}

.shipping-label {
    min-width: 120px;
    color: #757575;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.shipping-info {
    flex: 1;
}

.shipping-guarantee {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #222;
    font-size: 14px;
}

.shipping-guarantee i {
    color: #26aa99;
    font-size: 16px;
}

.shipping-voucher {
    font-size: 13px;
    color: #757575;
}

/* Guarantee Badge */
.product-guarantee {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #efefef;
    margin-bottom: 20px;
}

.guarantee-label {
    min-width: 120px;
    color: #757575;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.guarantee-value {
    flex: 1;
}

.guarantee-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff3f3;
    color: #ee4d2d;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 13px;
}

.guarantee-tag i {
    font-size: 12px;
}

/* Color Variants */
.product-variants {
    margin-bottom: 25px;
}

/* Header with label and stock */
.variant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.variant-label {
    font-size: 14px;
    color: #757575;
}

.variant-required {
    color: #ee4d2d;
    margin-left: 2px;
}

.variant-stock {
    font-size: 14px;
    color: #222;
    font-weight: 500;
}

/* Container for variants */
.variant-options-container {
    border: 1px solid #efefef;
    border-radius: 4px;
    padding: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

/* Scrollable container (only when variants > 10) */
.variant-options-container.scrollable {
    max-height: 240px; /* Shopee-like: ~4-5 items visible */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for variant container */
.variant-options-container.scrollable::-webkit-scrollbar {
    width: 6px;
}

.variant-options-container.scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.variant-options-container.scrollable::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.variant-options-container.scrollable::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Variant list - Flex wrap horizontal layout */
.variant-options {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping to multiple rows */
    gap: 8px;
    align-items: flex-start;
}

/* Variant button with DYNAMIC WIDTH based on content */
.variant-btn {
    /* Remove width: 100%, use inline-flex for dynamic sizing */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #222;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap; /* Prevent text wrapping inside button */
}

.variant-btn:hover:not(:disabled) {
    border-color: #ee4d2d;
    color: #ee4d2d;
    background: #fff8f8;
}

.variant-btn.active:not(:disabled) {
    border-color: #ee4d2d;
    background: #fff3f3;
    color: #ee4d2d;
    font-weight: 500;
}

/* Disabled/Out of Stock Variant Button */
.variant-btn.out-of-stock,
.variant-btn:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.variant-btn.out-of-stock:hover,
.variant-btn:disabled:hover {
    border-color: #ee4d2d;  
    background: #fff8f8;   
    color: #999;           
}

.variant-btn:hover {
    border-color: #ee4d2d;
    color: #ee4d2d;
    background: #fff8f8;
}

.variant-btn.active {
    border-color: #ee4d2d;
    background: #fff3f3;
    color: #ee4d2d;
    font-weight: 500;
}

/* Out of Stock Badge */
.variant-stock-badge {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 500;
    margin-left: auto;
}

/* Mini preview image */
.variant-image-preview {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #efefef;
    background: white;
}

.variant-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Grayscale image for out of stock variant */
.variant-btn.out-of-stock .variant-image-preview img,
.variant-btn:disabled .variant-image-preview img {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* Variant name */
.variant-name {
    line-height: 1.4;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Check icon */
.variant-check {
    font-size: 14px;
    color: #ee4d2d;
    margin-left: 4px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .variant-options-container.scrollable {
        max-height: 200px;
    }
    
    .variant-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .variant-image-preview {
        width: 28px;
        height: 28px;
    }
    
    .variant-name {
        font-size: 13px;
    }
}

/* Quantity Selector */
.product-quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}/* Quantity Selector */
.product-quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.quantity-label {
    font-size: 14px;
    color: #757575;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.2s;
}

.quantity-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    width: 50px;
    height: 32px;
    border: none;
    border-left: 1px solid #d9d9d9;
    border-right: 1px solid #d9d9d9;
    text-align: center;
    font-size: 14px;
}

.quantity-input:focus {
    outline: none;
}

/* Stock display beside quantity */
.quantity-stock {
    font-size: 14px;
    color: #757575;
    margin-left: 8px;
}

.quantity-stock #stockNumber {
    font-weight: 500;
    color: #222;
}

/* Responsive */
@media (max-width: 576px) {
    .product-quantity {
        flex-wrap: wrap;
    }
    
    .quantity-stock {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        font-size: 13px;
    }
}

/* Action Buttons */
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-add-cart,
.btn-buy-now {
    padding: 12px 20px;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart {
    background: #fff3f3;
    color: #ee4d2d;
    border: 1px solid #ee4d2d;
}

.btn-add-cart:hover:not(:disabled) {
    background: #ee4d2d;
    color: white;
}

.btn-buy-now {
    background: #ee4d2d;
    color: white;
}

.btn-buy-now:hover:not(:disabled) {
    background: #d73211;
}

/* Disabled state for out of stock */
.btn-add-cart:disabled,
.btn-buy-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    color: #999 !important;
    border-color: #d9d9d9 !important;
}

.btn-add-cart:disabled:hover,
.btn-buy-now:disabled:hover {
    background: #f5f5f5 !important;
    color: #999 !important;
}

/* Quantity selector disabled state */
.quantity-selector.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.quantity-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Stock display when out of stock */
.quantity-stock.out-of-stock {
    color: #ee4d2d;
    font-weight: 600;
}

.quantity-stock.out-of-stock #stockNumber {
    color: #ee4d2d;
}

/* Responsive */
@media (max-width: 576px) {
    .product-actions {
        grid-template-columns: 1fr;
    }
}

/* Product Tabs */
.product-tabs {
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.tab-headers {
    display: flex;
    border-bottom: 2px solid #f5f5f5;
}

.tab-header {
    flex: 1;
    padding: 15px 20px;
    background: white;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-header:hover {
    color: #ee4d2d;
}

.tab-header.active {
    color: #ee4d2d;
    border-bottom-color: #ee4d2d;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Product Description */
.product-description h3 {
    font-size: 18px;
    margin: 0 0 15px;
    color: #333;
}

.product-description p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.product-description ul {
    padding-left: 20px;
}

.product-description li {
    line-height: 2;
    color: #555;
}

/* Product Specs */
.product-specs {
    display: grid;
    gap: 1px;
    background: #f5f5f5;
}

.spec-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    background: white;
    padding: 15px 20px;
}

.spec-label {
    color: #757575;
    font-size: 14px;
}

.spec-value {
    color: #222;
    font-size: 14px;
}

/* Wholesale Modal */
.wholesale-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.wholesale-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wholesale-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #efefef;
}

.wholesale-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.wholesale-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.wholesale-modal-close:hover {
    background: #f5f5f5;
    color: #222;
}

.wholesale-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.wholesale-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.wholesale-table thead {
    background: #f7f7f7;
}

.wholesale-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #efefef;
}

.wholesale-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

.wholesale-table tbody tr:hover {
    background: #fafafa;
}

.qty-col {
    color: #222;
    font-weight: 500;
}

.price-col {
    color: #ee4d2d;
    font-weight: 600;
}

.savings-col {
    color: #26aa99;
    font-weight: 500;
}

.wholesale-note {
    background: #fff3f3;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.wholesale-note i {
    color: #ee4d2d;
    margin-top: 2px;
}

.wholesale-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #efefef;
    display: flex;
    justify-content: flex-end;
}

.btn-close-modal {
    padding: 10px 24px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    border-color: #ee4d2d;
    color: #ee4d2d;
}

/* Responsive */
@media (max-width: 992px) {
    .product-main {
        grid-template-columns: 1fr;
    }

    .product-images {
        position: relative;
        top: 0;
    }

    .product-actions {
        grid-template-columns: 1fr;
    }

    .spec-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 576px) {
    .product-price {
        font-size: 24px;
    }

    .product-name {
        font-size: 18px;
    }

    .image-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .wholesale-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .wholesale-modal-header,
    .wholesale-modal-body,
    .wholesale-modal-footer {
        padding: 16px;
    }
    
    .wholesale-table th,
    .wholesale-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ========================================
   THUMBNAIL NAVIGATION (Updated Design)
   ======================================== */
.image-thumbnails-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.thumbnail-nav {
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 36px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.thumbnail-nav:hover:not(:disabled) {
    background: #fafafa;
    border-color: #ee4d2d;
    color: #ee4d2d;
}

.thumbnail-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.thumbnail-nav i {
    font-size: 16px;
}

.image-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: hidden; /* Hide scrollbar */
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
}

.image-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    min-width: 70px;
    width: 70px;
    height: 70px;
    border: 2px solid #efefef;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.thumbnail:hover {
    border-color: #ee4d2d;
}

.thumbnail.active {
    border-color: #ee4d2d;
    box-shadow: 0 0 0 1px #ee4d2d;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}