/* CSS Reset et Base */
.cart-wrapper-modern {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cart-wrapper-modern {
    font-family: 'Arial', sans-serif;
    background: #f8fafc;
    padding: 20px;
    line-height: 1.6;
}

/* Conteneur principal */
.cart-wrapper-modern {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Largeurs adaptatives pour différentes tailles d'écran */
@media (min-width: 768px) {
    .cart-wrapper-modern {
        max-width: 1400px; /* Écrans moyens - plus large */
    }
}

@media (min-width: 1024px) {
    .cart-wrapper-modern {
        max-width: 1600px; /* Écrans larges - encore plus large */
    }
}

/* En-tête du panier */
.cart-header-modern {
    background: linear-gradient(135deg, #e8e8ec, #f7f7f7);
    color: white;
    padding: 25px;
    text-align: center;
    border-radius: 18px;

}

.cart-title-modern {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-subtitle-modern {
    font-size: 14px;
    opacity: 0.9;
}

/* Conteneur principal avec sidebar */
.cart-main-container-modern {
    display: flex;
    gap: 25px;
    padding: 25px;
    background: white;
}

/* Conteneur du tableau */
.cart-table-wrapper-modern {
    flex: 1;
    padding: 0;
    background: white;
}

/* Bloc récapitulatif */
.cart-summary-modern {
    width: 320px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 20px;
}

.cart-summary-title-modern {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    text-align: center;
}

.cart-summary-item-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.cart-summary-item-modern:last-of-type {
    border-bottom: 2px solid #d1d5db;
    margin-bottom: 15px;
}

.cart-summary-label-modern {
    color: #6b7280;
}

.cart-summary-value-modern {
    font-weight: 600;
    color: #374151;
}

.cart-summary-total-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    padding: 15px 0;
}

.cart-summary-checkout-modern {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-summary-checkout-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Tableau */
.cart-table-modern {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* En-tête du tableau */
.cart-table-modern thead {
    background: #f1f5f9;
}

.cart-table-modern th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.cart-table-modern th:first-child {
    padding-left: 25px;
}

.cart-table-modern th:last-child {
    text-align: center;
}

/* Corps du tableau */
.cart-table-modern tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.cart-table-modern tbody tr:hover {
    background: #f9fafb;
}

.cart-table-modern td {
    padding: 20px 15px;
    vertical-align: middle;
    color: #374151;
}

.cart-table-modern td:first-child {
    padding-left: 25px;
}

/* Cellule producteur */
.cart-producer-cell-modern {
    display: flex;
    align-items: center;
}

.cart-producer-img-modern {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.cart-producer-name-modern {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

/* Cellule produit */
.cart-product-cell-modern {
    display: flex;
    align-items: center;
}

.cart-product-img-modern {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    margin-right: 18px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-product-name-modern {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

/* Prix */
.cart-price-modern {
    font-weight: 700;
    color: #059669;
    font-size: 16px;
}

/* Contrôles de quantité */
.cart-quantity-wrapper-modern {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-qty-btn-modern {
    width: 35px;
    height: 35px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.cart-qty-btn-modern:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.cart-qty-input-modern {
    width: 60px;
    height: 35px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.cart-qty-input-modern:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Total */
.cart-total-modern {
    font-weight: 700;
    color: #1f2937;
    font-size: 16px;
}

/* Bouton supprimer */
.cart-delete-btn-modern {
    width: 38px;
    height: 38px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.cart-delete-btn-modern:hover {
    background: #fecaca;
    transform: scale(1.05);
}

/* Pied du panier */
.cart-footer-modern {
    background: #f8fafc;
    padding: 25px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.cart-grand-total-modern {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 15px;
}

.cart-checkout-btn-modern {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-checkout-btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* RESPONSIVE DESIGN */

/* Tablettes */
@media (max-width: 768px) {
    .cart-wrapper-modern {
        margin: 10px;
        max-width: none; /* Réinitialise la largeur sur tablette */
    }

    .cart-header-modern {
        padding: 20px;
    }

    .cart-title-modern {
        font-size: 20px;
    }

    /* Layout mobile pour le conteneur principal */
    .cart-main-container-modern {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .cart-summary-modern {
        width: 100%;
        position: static;
        order: 2;
    }

    .cart-table-wrapper-modern {
        order: 1;
    }

    .cart-table-modern th,
    .cart-table-modern td {
        padding: 12px 10px;
    }

    .cart-table-modern th:first-child,
    .cart-table-modern td:first-child {
        padding-left: 15px;
    }

    .cart-producer-img-modern,
    .cart-product-img-modern {
        width: 50px;
        height: 50px;
    }

    .cart-producer-name-modern,
    .cart-product-name-modern {
        font-size: 13px;
    }
}

/* Mobiles - Transformation en cartes */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .cart-main-container-modern {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .cart-summary-modern {
        width: 100%;
        position: static;
        order: 2;
        padding: 20px;
    }

    .cart-table-wrapper-modern {
        order: 1;
    }

    .cart-table-modern,
    .cart-table-modern thead,
    .cart-table-modern tbody,
    .cart-table-modern th,
    .cart-table-modern td,
    .cart-table-modern tr {
        display: block;
        width: 100%;
    }

    .cart-table-modern thead {
        display: none;
    }

    .cart-table-modern tbody tr {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }

    .cart-table-modern tbody tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        border-radius: 12px 12px 0 0;
    }

    .cart-table-modern td {
        display: block;
        width: 100%;
        padding: 15px 20px;
        border: none;
        border-bottom: 1px solid #f3f4f6;
        position: relative;
        text-align: left;
    }

    .cart-table-modern td:first-child {
        padding-left: 20px;
        margin-top: 4px;
    }

    .cart-table-modern td:last-child {
        border-bottom: none;
        text-align: center;
        padding-bottom: 20px;
    }

    .cart-table-modern td::before {
        content: attr(data-label) ":";
        display: inline-block;
        font-weight: 600;
        color: #6b7280;
        font-size: 12px;
        text-transform: uppercase;
        margin-bottom: 5px;
        width: 100%;
    }

    /* Ajustements du contenu pour mobile */
    .cart-producer-cell-modern,
    .cart-product-cell-modern {
        display: flex;
        align-items: center;
        margin-top: 5px;
    }

    .cart-producer-img-modern,
    .cart-product-img-modern {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }

    .cart-quantity-wrapper-modern {
        margin-top: 5px;
    }

    .cart-qty-btn-modern {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .cart-qty-input-modern {
        width: 50px;
        height: 32px;
        font-size: 13px;
    }

    .cart-delete-btn-modern {
        width: 35px;
        height: 35px;
        font-size: 14px;
        margin-top: 10px;
    }

    .cart-price-modern,
    .cart-total-modern {
        margin-top: 5px;
        display: inline-block;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    .cart-table-modern td {
        padding: 12px 15px;
    }

    .cart-table-modern td:first-child {
        padding-left: 15px;
    }

    .cart-producer-name-modern,
    .cart-product-name-modern {
        font-size: 12px;
    }

    .cart-price-modern,
    .cart-total-modern {
        font-size: 14px;
    }
}