/* ==========================================
   CART MODAL - POP-UP PANIER GLASSMORPHISM
   ========================================== */

/* Overlay (backdrop avec flou) */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal-overlay.active {
    display: block;
    opacity: 1;
}

/* Modal (slide depuis la droite) - FOND GRIS GLASSMORPHISM */
.cart-modal {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(200, 200, 200, 0.3);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-modal-overlay.active .cart-modal {
    right: 0;
}

/* Header du modal */
.cart-modal-header {
    position: relative;
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Bouton fermer (X) - GLASSMORPHISM */
.cart-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cart-modal-close:hover {
    background: rgba(235, 235, 235, 0.7);
    border-color: rgba(200, 200, 200, 0.5);
    transform: scale(1.1);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cart-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: rgba(50, 50, 50, 0.8);
    stroke-width: 2;
    transition: stroke 0.2s ease;
}

.cart-modal-close:hover svg {
    stroke: rgba(0, 0, 0, 0.9);
}

/* Titre */
.cart-modal-title {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding-right: 40px;
}

/* Corps du modal (scrollable) */
.cart-modal-body {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

/* Liste des items */
.cart-modal-items {
    margin-bottom: 24px;
}

/* Item du panier - FOND GLASSMORPHISM */
.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cart-item:last-child {
    margin-bottom: 0;
}

/* Miniature du canvas - GLASSMORPHISM */
.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Info du produit */
.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.cart-item-format {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #666666;
    margin-bottom: 5px;
}

.cart-item-color {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #555555;
    margin-bottom: 5px;
    font-style: italic;
}

.cart-item-price {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 8px;
}

/* Actions (modifier/supprimer) - GLASSMORPHISM */
.cart-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cart-item-edit,
.cart-item-delete {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bouton modifier - GRIS GLASSMORPHISM */
.cart-item-edit {
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cart-item-edit svg {
    width: 18px;
    height: 18px;
    stroke: rgba(50, 50, 50, 0.8);  /* ← CHANGÉ : stroke au lieu de color */
    fill: none;  /* ← AJOUTÉ */
}

.cart-item-edit:hover {
    background: rgba(235, 235, 235, 0.7);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cart-item-edit:hover svg {
    stroke: rgba(0, 0, 0, 0.9);  /* ← CHANGÉ : stroke au lieu de color */
}

/* Bouton supprimer - NOIR GLASSMORPHISM */
.cart-item-delete {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cart-item-delete svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;  /* ← CHANGÉ : stroke au lieu de color */
    fill: none;  /* ← AJOUTÉ */
}

.cart-item-delete:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Message vide */
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
}

/* Footer du modal */
.cart-modal-footer {
    padding: 24px 32px 32px 32px;
    border-top: 1px solid rgba(200, 200, 200, 0.3);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Sous-total */
.cart-modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-modal-total-label {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.cart-modal-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-original {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #999999;
    text-decoration: line-through;
}

.price-current {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Section Réduction - GLASSMORPHISM STYLISÉ */
.cart-discount-section {
    background: rgba(232, 245, 233, 0.6);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 15px;
    box-shadow: 
        0 4px 16px rgba(76, 175, 80, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cart-discount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-discount-label {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #2e7d32;
}

.cart-discount-amount {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

.cart-discount-toggle {
    background: transparent;
    border: none;
    color: #2e7d32;
    text-decoration: underline;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}

.cart-discount-toggle:hover {
    opacity: 0.7;
}

.cart-discount-dropdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(76, 175, 80, 0.2);
}

/* Styles pour les bundles */
.cart-bundles-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #2e7d32;
}

.cart-bundle-item {
    font-size: 14px;
    color: #388e3c;
    margin: 5px 0;
    line-height: 1.5;
}

.bundle-original-price {
    color: #81c784;
    font-size: 13px;
}

/* Suggestions */
.cart-suggestion {
    background: rgba(232, 245, 233, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #2e7d32;
    font-weight: 500;
    box-shadow: 
        0 4px 12px rgba(76, 175, 80, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Badge économie */
.cart-savings-badge {
    display: inline-block;
    background: rgba(232, 245, 233, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #2e7d32;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 
        0 2px 8px rgba(76, 175, 80, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Divider */
.cart-modal-divider {
    height: 1px;
    background: rgba(200, 200, 200, 0.3);
    margin: 20px 0;
}

/* Lien "Voir le panier" */
.cart-modal-view-cart {
    display: block;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: underline;
    margin-bottom: 16px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cart-modal-view-cart:hover {
    opacity: 0.7;
}

/* Bouton "Passer commande" - NOIR GLASSMORPHISM */
.cart-modal-checkout {
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cart-modal-checkout:hover {
    background: rgba(0, 0, 0, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cart-modal-checkout:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* État désactivé */
.cart-modal-checkout:disabled {
    background: rgba(211, 215, 214, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(211, 215, 214, 0.3);
    color: rgba(102, 102, 102, 0.8);
    cursor: not-allowed;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cart-modal-checkout:disabled:hover {
    transform: none;
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */
@media (max-width: 768px) {
    .cart-modal {
        width: 100%;
        right: -100%;
    }
    
    .cart-modal-header,
    .cart-modal-body,
    .cart-modal-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .cart-item-image {
        width: 64px;
        height: 64px;
    }
    
    .cart-item-name {
        font-size: 14px;
    }
    
    .cart-item-format {
        font-size: 12px;
    }
    
    .cart-item-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .cart-item-edit,
    .cart-item-delete {
        width: 36px;
        height: 36px;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        right: -480px;
    }
    to {
        right: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}