/* Améliorations modale produit */

.product-modal-meta {
    display: none !important;
}

/* Titre du produit sticky en haut */
.product-modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 16px 0 12px 0;
    margin: -16px 0 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}



/* Affichage double devise */
.price-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-price-usd,
.price-usd {
    font-size: 0.75em;
    color: #666;
    font-weight: 500;
}

.price-old-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* Sélecteur de SKU - Style AliExpress avec tailles */
.sku-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.sku-item,
.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sku-image-wrapper,
.color-image-wrapper {
    width: 70px;
    height: 70px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: white;
    transition: all 0.2s ease;
}

.sku-item:hover:not(.out-of-stock) .sku-image-wrapper,
.color-item:hover:not(.out-of-stock) .color-image-wrapper {
    border-color: #B8461F;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(184, 70, 31, 0.2);
}

.sku-item.selected .sku-image-wrapper,
.color-item.selected .color-image-wrapper {
    border-color: #B8461F;
    border-width: 3px;
    box-shadow: 0 0 0 1px #B8461F;
}

.sku-image-wrapper img,
.color-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sku-no-image,
.color-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #6b7280;
    background: #f3f4f6;
}

.sku-label,
.color-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

.sku-item.selected .sku-label,
.color-item.selected .color-label {
    color: #B8461F;
    font-weight: 700;
}

/* Out of stock */
.sku-item.out-of-stock,
.color-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.sku-item.out-of-stock .sku-image-wrapper,
.color-item.out-of-stock .color-image-wrapper {
    background: #f9fafb;
}

.sku-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sku-out-overlay span {
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Info SKU sélectionné - Caché, on utilise juste les bordures orange */
.sku-selected-info {
    display: none !important;
}

/* Sélecteur de couleur amélioré */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    position: relative;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 70px;
}

.color-option:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.color-option.selected {
    border-color: #000;
    background: #f8f8f8;
}

.color-option img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.color-option span {
    font-size: 12px;
    text-align: center;
    color: #333;
}

/* Sélecteur de taille */
.size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-option,
.size-btn {
    min-width: 60px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.size-option:hover,
.size-btn:hover:not(.out-of-stock) {
    border-color: #B8461F;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(184, 70, 31, 0.15);
}

.size-option.selected,
.size-btn.selected {
    border-color: #B8461F !important;
    border-width: 3px !important;
    background: white !important;
    color: #B8461F !important;
    font-weight: 700 !important;
    box-shadow: 0 0 0 1px #B8461F !important;
}

.size-btn.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Animation pour l'apparition du sélecteur de taille */
#sizeSelector {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Info stock */
.stock-info {
    font-size: 13px;
    font-weight: 500;
}

.stock-info.in-stock {
    color: #28a745;
}

.stock-info.out-of-stock {
    color: #dc3545;
}

/* Label requis */
.selector-label .required {
    color: #dc3545;
    margin-left: 2px;
}

/* Miniatures images */
.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnail:hover {
    border-color: #333;
}

.thumbnail.active {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bouton désactivé */
.add-to-cart-modal:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.add-to-cart-modal:disabled:hover {
    transform: none;
}

/* Caractéristiques */
.product-features {
    list-style: none;
    padding: 0;
}

.product-features li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

.product-features li:last-child {
    border-bottom: none;
}

.product-features strong {
    min-width: 150px;
    color: #666;
    font-weight: 500;
}

/* Spinner de chargement */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Titre sticky sur mobile */
    .product-modal-header {
        padding: 24px 0 16px 0;
        margin: -24px 0 16px 0;
        background: transparent;
    }
    
    .product-modal-title {
        font-size: 18px;
        font-weight: 800;
        margin-top: 12px;
        color: #1a1a1a;
        line-height: 1.4;
    }
    
    /* Enlever fond blanc sur mobile */
    .sku-image-wrapper,
    .color-image-wrapper {
        background: transparent;
        padding: 3px;
        box-sizing: border-box;
    }
    
    .size-option,
    .size-btn {
        background: transparent;
    }
    
    .size-option.selected,
    .size-btn.selected {
        background: transparent !important;
    }
    
    /* Rendre la zone des variations scrollable */
    .product-selector {
        max-height: 320px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
        margin-bottom: 16px;
    }
    
    /* Scrollbar stylée pour la zone SKU */
    .product-selector::-webkit-scrollbar {
        width: 6px;
    }
    
    .product-selector::-webkit-scrollbar-track {
        background: rgba(184, 70, 31, 0.1);
        border-radius: 3px;
    }
    
    .product-selector::-webkit-scrollbar-thumb {
        background: #B8461F;
        border-radius: 3px;
    }
    
    /* Scrollbar pour Firefox */
    .product-selector {
        scrollbar-width: thin;
        scrollbar-color: #B8461F rgba(184, 70, 31, 0.1);
    }
    
    .sku-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }
    
    .sku-image-wrapper,
    .color-image-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .sku-label,
    .color-label {
        font-size: 10px;
        line-height: 1.1;
        font-weight: 600;
    }
    
    .color-option {
        min-width: 50px;
        padding: 5px;
    }
    
    .color-option img,
    .color-swatch {
        width: 32px;
        height: 32px;
    }
    
    .size-option,
    .size-btn {
        min-width: 48px;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .product-thumbnails {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .sku-options-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    
    .sku-image-wrapper,
    .color-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
    
    .sku-label,
    .color-label {
        font-size: 9px;
        line-height: 1.1;
        padding: 0 1px;
        font-weight: 600;
    }
    
    .sku-no-image,
    .color-no-image {
        font-size: 11px;
    }
    
    .size-option,
    .size-btn {
        min-width: 42px;
        padding: 7px 8px;
        font-size: 11px;
    }
    
    .thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .product-thumbnails {
        gap: 5px;
    }
    
    .sku-out-overlay span {
        font-size: 7px;
        padding: 2px 5px;
    }
}


/* Indicateur de drag pour mobile */
.modal-drag-indicator {
    display: none;
    width: 40px;
    height: 5px;
    background: #d1d5db;
    border-radius: 10px;
    margin: 12px auto 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .modal-drag-indicator {
        display: block;
    }
    
    /* Amélioration de la scrollbar sur mobile - VISIBLE ET STYLÉE */
    .product-modal-content {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }
    
    .product-modal-content::-webkit-scrollbar {
        width: 8px !important;
        display: block !important;
    }
    
    .product-modal-content::-webkit-scrollbar-track {
        background: rgba(184, 70, 31, 0.1) !important;
        border-radius: 4px !important;
        margin: 4px 0 !important;
    }
    
    .product-modal-content::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%) !important;
        border-radius: 4px !important;
        border: 2px solid rgba(255, 255, 255, 0.5) !important;
        min-height: 40px !important;
    }
    
    .product-modal-content::-webkit-scrollbar-thumb:active {
        background: linear-gradient(135deg, #8B2F0F 0%, #B8461F 100%) !important;
    }
    
    /* Scrollbar pour Firefox mobile */
    .product-modal-content {
        scrollbar-width: thin !important;
        scrollbar-color: #B8461F rgba(184, 70, 31, 0.1) !important;
    }
}
