/* --- RESET & BASE --- */
:root {
    --primary-color: #000;
    --accent-beige: #B49282;
    --light-beige: #F5DBC4;
    --bg-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --text-dark: #333;
    --text-muted: #777;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    margin: 0;
}

.cart-page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.cart-title {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 700;
}

/* --- LAYOUT GRID --- */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 350px; /* Liste large + Résumé 350px */
    gap: 40px;
    align-items: start;
}

/* --- TABLEAU PRODUITS --- */
.cart-items-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-table td {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.cart-table tr:last-child td { border-bottom: none; }

/* Colonne Produit */
.product-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.img-box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    flex-shrink: 0;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* L'image ne sera pas déformée */
}

.product-name {
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1rem;
    display: block;
}

.product-name:hover {
    color: var(--accent-beige);
}

.product-options {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Colonnes Prix & Total */
.td-price, .td-total {
    font-weight: 600;
    white-space: nowrap;
}

/* Colonne Quantité */
.qty-control {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 5px;
    width: fit-content;
    padding: 5px;
}

.btn-qty {
    background: none;
    border: none;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-qty:hover { color: #000; }
.btn-qty.disabled { color: #ccc; cursor: default; }

.qty-value {
    margin: 0 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Colonne Action (Poubelle) */
.btn-trash {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.btn-trash:hover { color: #d9534f; }

/* --- RÉSUMÉ (SUMMARY) --- */
.cart-summary-section {
    position: sticky;
    top: 20px; /* Reste visible au scroll */
}

.summary-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.summary-card h2 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-beige);
    padding-bottom: 10px;
    display: inline-block;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.summary-row.total-row {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 30px;
}

.divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 20px 0;
}

.text-muted { color: #888; font-size: 0.85rem; }

.btn-checkout {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color); /* Noir élégant */
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.btn-checkout:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.btn-continue {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: underline;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.btn-continue:hover { color: var(--primary-color); }

.secure-badges {
    margin-top: 30px;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}
.payment-icons {
    font-size: 1.5rem;
    margin-top: 5px;
    gap: 10px;
    display: flex;
    justify-content: center;
}

/* --- PANIER VIDE --- */
.empty-cart-container {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 10px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--light-beige);
    margin-bottom: 20px;
}

.btn-start-shopping {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background-color: var(--accent-beige);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .cart-grid {
        grid-template-columns: 1fr; /* Pile verticale sur tablette/mobile */
    }
    
    .cart-summary-section {
        position: static; /* Plus de sticky */
    }
}

@media (max-width: 600px) {
    .th-price, .td-price { display: none; } /* Cache le prix unitaire sur mobile */
    
    .product-wrapper { flex-direction: column; align-items: flex-start; }
    .img-box { width: 60px; height: 60px; }
    
    .btn-qty { width: 30px; height: 30px; } /* Boutons plus gros pour le doigt */
}