/* ======================================================
   OVERLAY PANIER
   ID utilisés : #cart-overlay
   ====================================================== */
#cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

#cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ======================================================
   PANNEAU PANIER
   Classe : .cart-panel
   ====================================================== */
.cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 33.333vw;
    max-width: 420px;
    height: 100%;
    background: #ffffff;
    color: #111111;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s ease;
}

#cart-overlay.active .cart-panel {
    transform: translateX(0);
}

/* ======================================================
   HEADER PANIER
   ====================================================== */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
}

.cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

#close-cart {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #111;
}

#close-cart:hover {
    color: #d10000;
}

/* ======================================================
   LISTE PRODUITS
   ID : #cart-items
   Classe : .cart-item
   ====================================================== */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

/* ======================================================
   INFOS PRODUIT
   ====================================================== */
.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #111;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    color: #333;
}

/* ======================================================
   ACTIONS (+ / −)
   ====================================================== */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.cart-item-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    background: #ffffff;
    color: #111;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.cart-item-actions button:hover {
    background: #111;
    color: #ffffff;
}

/* ======================================================
   FOOTER PANIER
   ====================================================== */
.cart-footer {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 16px;
}

.cart-total span {
    color: #111;
}

.cart-total span:last-child {
    font-weight: 700;
}

/* ======================================================
   BOUTON PAIEMENT
   ====================================================== */
.cart-checkout {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.cart-checkout:hover {
    background: #000;
}

/* ======================================================
   BADGE PANIER (NAVBAR)
   ID : #cart-count
   ====================================================== */
#cart-count {
    background: #ffffff !important;
    color: #111 !important;
    font-weight: 600;
    border: 1px solid #111;
}

/* ======================================================
   BOUTON AJOUTER AU PANIER (SHOP)
   Classe : .add-to-cart
   ====================================================== */
.add-to-cart {
    background: #541116;
    color: #fffdfd;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-to-cart:hover {
    background: #000;
}

/* ======================================================
   RESPONSIVE MOBILE
   ====================================================== */
@media (max-width: 768px) {
    .cart-panel {
        width: 100%;
        max-width: none;
    }
}

/* ======================================================
   MODE SOMBRE (optionnel)
   Body class : .dark
   ====================================================== */
body.dark .cart-panel {
    background: #121212;
    color: #f1f1f1;
}

body.dark .cart-header,
body.dark .cart-footer {
    background: #1a1a1a;
}

body.dark .cart-item-title,
body.dark .cart-total span {
    color: #f1f1f1;
}
