/* ============================================
   DRAWER PANIER - BOTTOM SHEET SUR MOBILE
   ============================================ */

/* Desktop - Drawer classique sur le côté */
@media (min-width: 769px) {
    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s 0.3s;
    }
    
    .drawer-overlay.active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease, visibility 0s 0s;
    }
    
    .drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 450px;
        max-width: 90vw;
        background: white;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 10000;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }
    
    .drawer.active {
        transform: translateX(0);
    }
    
    /* Styles Desktop pour les items */
    .cart-item {
        display: flex;
        gap: 12px;
        padding: 14px;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        transition: all 0.3s ease;
    }
    
    .cart-item:hover {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    
    .cart-summary {
        padding: 18px;
        background: #f8f9fa;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .drawer-header {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .drawer-footer {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .drawer-header .modal-close {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(184, 70, 31, 0.08);
        border: none;
        border-radius: 8px;
        color: #B8461F;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .drawer-header .modal-close:hover {
        background: rgba(184, 70, 31, 0.15);
    }
    
    .empty-icon {
        color: #B8461F;
        opacity: 0.3;
    }
    
    /* Bouton Commander sur Desktop - ORANGE/MARRON */
    .drawer-footer .btn {
        width: 100%;
        padding: 14px 20px;
        background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(184, 70, 31, 0.3);
    }
    
    .drawer-footer .btn:hover {
        background: linear-gradient(135deg, #9a3819 0%, #7d2e14 100%);
        box-shadow: 0 6px 16px rgba(184, 70, 31, 0.4);
        transform: translateY(-2px);
    }
    
    .drawer-footer .btn:active {
        background: linear-gradient(135deg, #7d2e14 0%, #6a2511 100%);
        transform: scale(0.98) translateY(0);
        box-shadow: 0 2px 8px rgba(184, 70, 31, 0.3);
    }
}

/* Mobile - Bottom Sheet comme les autres modales */
@media (max-width: 768px) {
    /* Overlay */
    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s 0.3s;
    }
    
    .drawer-overlay.active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease, visibility 0s 0s;
    }
    
    /* Drawer en bottom sheet */
    .drawer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 92vh;
        max-height: 92vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
        z-index: 10000;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.4s;
        visibility: hidden;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .drawer.active {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    }
    
    /* Header du drawer */
    .drawer-header {
        padding: 24px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }
    
    .drawer-title {
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
        letter-spacing: -0.3px;
        margin: 0;
    }
    
    /* Bouton fermer */
    .drawer-header .modal-close {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(184, 70, 31, 0.08);
        border: none;
        border-radius: 8px;
        color: #B8461F;
        font-size: 20px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
    }
    
    .drawer-header .modal-close:active {
        background: rgba(184, 70, 31, 0.15);
        transform: scale(0.95);
    }
    
    /* Body du drawer - scrollable */
    .drawer-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
        padding-bottom: 240px;
    }
    
    /* Encadré gris solide en bas - uniquement dans le drawer */
    .drawer::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 230px;
        background: #e8e8e8;
        z-index: 10000;
        pointer-events: none;
    }
    
    /* Footer du drawer */
    .drawer-footer {
        position: fixed;
        bottom: 80px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        padding: 0;
        border-top: none;
        background: transparent;
        flex-shrink: 0;
        z-index: 10002;
        box-shadow: none;
    }
    
    /* Items du panier */
    .cart-items {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .cart-item {
        display: flex;
        gap: 12px;
        padding: 14px;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        transition: all 0.3s ease;
    }
    
    .cart-item:active {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        object-fit: cover;
        flex-shrink: 0;
    }
    
    .cart-item-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .cart-item-name {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        line-height: 1.3;
    }
    
    .cart-item-price {
        font-size: 16px;
        font-weight: 700;
        color: #1a1a1a;
    }
    
    .cart-item-variant {
        font-size: 12px;
        color: #666;
    }
    
    .cart-item-quantity {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(184, 70, 31, 0.08);
        border: none;
        border-radius: 6px;
        color: #B8461F;
        font-size: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
    }
    
    .qty-btn:active {
        background: rgba(184, 70, 31, 0.15);
        transform: scale(0.95);
    }
    
    .qty-value {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        min-width: 24px;
        text-align: center;
    }
    
    .cart-item-remove {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(239, 68, 68, 0.08);
        border: none;
        border-radius: 8px;
        color: #ef4444;
        font-size: 14px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }
    
    .cart-item-remove:active {
        background: rgba(239, 68, 68, 0.15);
        transform: scale(0.95);
    }
    
    /* État vide */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        text-align: center;
    }
    
    .empty-icon {
        font-size: 64px;
        margin-bottom: 16px;
        color: #B8461F;
        opacity: 0.3;
    }
    
    .empty-title {
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 8px;
    }
    
    .empty-text {
        font-size: 14px;
        color: #6b7280;
        line-height: 1.5;
    }
    
    /* Résumé du panier */
    .cart-summary {
        position: fixed;
        bottom: 148px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 18px;
        background: #f8f9fa;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        z-index: 10002;
        margin-bottom: 0;
    }
    
    .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
    }
    
    .summary-row.total {
        padding-top: 12px;
        border-top: 2px solid rgba(0, 0, 0, 0.1);
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
    }
    
    .summary-label {
        color: #6b7280;
    }
    
    .summary-row.total .summary-label {
        color: #1a1a1a;
    }
    
    .summary-value {
        font-weight: 600;
        color: #1a1a1a;
    }
    
    .summary-row.total .summary-value {
        color: #1a1a1a;
    }
    
    /* Bouton commander - ORANGE/MARRON */
    .drawer-footer .btn {
        width: 100%;
        padding: 16px 20px;
        background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
        min-height: 56px;
    }
    
    .drawer-footer .btn:active {
        background: linear-gradient(135deg, #7d2e14 0%, #6a2511 100%);
        transform: scale(0.98);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .drawer {
        height: 94vh;
        max-height: 94vh;
    }
    
    .drawer-header {
        padding: 20px 16px;
    }
    
    .drawer-title {
        font-size: 17px;
    }
    
    .drawer-body {
        padding: 16px;
        padding-bottom: 240px;
    }
    
    .drawer::after {
        height: 220px;
    }
    
    .drawer-footer {
        bottom: 75px;
        left: 6px;
        right: 6px;
        width: calc(100% - 12px);
    }
    
    .drawer-footer .btn {
        min-height: 52px;
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .cart-item {
        padding: 10px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-name {
        font-size: 13px;
    }
    
    .cart-item-price {
        font-size: 15px;
    }
    
    .cart-summary {
        bottom: 139px;
        left: 6px;
        right: 6px;
        width: calc(100% - 12px);
    }
}

/* Empêcher le scroll du body quand le drawer est ouvert */
body.drawer-open {
    overflow: hidden;
}


