/* Cart drawer + icon - Bikini Tahiti */

.cart-icon-btn {
    position: relative;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--dark);
    transition: color 0.2s;
}
.cart-icon-btn:hover { color: var(--pink); }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--pink);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.4);
    animation: cartBadgePop 0.3s ease;
}
@keyframes cartBadgePop {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}
.cart-drawer.open { pointer-events: auto; }

.cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 25, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cart-drawer.open .cart-backdrop { opacity: 1; }

.cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(460px, 100%);
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.cart-drawer.open .cart-panel { transform: translateX(0); }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid #eee;
}
.cart-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--dark);
    margin: 0;
}
.cart-close {
    background: #f5f5f5;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    transition: background 0.2s;
}
.cart-close:hover { background: #e5e7eb; }

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 82px 1fr auto;
    gap: 14px;
    padding: 12px;
    background: #fafafa;
    border-radius: 14px;
    position: relative;
    transition: background 0.2s;
}
.cart-item:hover { background: #f5f5f7; }

.cart-item-img {
    width: 82px;
    height: 96px;
    border-radius: 10px;
    object-fit: cover;
    background: #eee;
}
.cart-item-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, #fdf2f7, #f0f8ff);
}
.cart-item-body { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.cart-item-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
    line-height: 1.2;
}
.cart-item-variant {
    color: var(--gray-500);
    font-size: 0.82rem;
    margin-top: 2px;
}
.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px;
}
.qty-control button {
    width: 26px; height: 26px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--dark);
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.15s;
}
.qty-control button:hover { background: #f5f5f7; }
.qty-control span {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}
.cart-item-price {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.cart-item-remove:hover { color: #b91c1c; background: #fef2f2; }

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}
.cart-empty svg { color: var(--gray-400); margin-bottom: 20px; }
.cart-empty h3 {
    font-family: 'Playfair Display', serif;
    color: var(--dark);
    font-size: 1.3rem;
    margin: 0 0 8px;
}
.cart-empty p { margin: 0 0 22px; }

.cart-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #eee;
    background: white;
}
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.cart-subtotal span { color: var(--gray-600); font-size: 0.95rem; }
.cart-subtotal strong {
    font-family: 'Playfair Display', serif;
    color: var(--dark);
    font-size: 1.4rem;
}
.cart-shipping-note {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin: 0 0 14px;
}
.cart-checkout-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.cart-continue {
    width: 100%;
    background: none;
    border: none;
    padding: 10px;
    color: var(--gray-500);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    text-decoration: underline;
}
.cart-continue:hover { color: var(--dark); }

/* Replace FB button on product card */
.order-fb-btn.add-to-cart {
    background: var(--dark);
    color: white;
}
.order-fb-btn.add-to-cart:hover {
    background: var(--pink);
}

@media (max-width: 520px) {
    .cart-panel { width: 100%; }
    .cart-item { grid-template-columns: 70px 1fr auto; gap: 10px; }
    .cart-item-img { width: 70px; height: 84px; }
}

/* ===== Mode sombre — panier ===== */
html[data-theme="dark"] .cart-panel { background: #15171e; color: #e7e9ee; }
html[data-theme="dark"] .cart-header { border-bottom-color: #262b34; }
html[data-theme="dark"] .cart-header h2 { color: #f3f4f6; }
html[data-theme="dark"] .cart-close { background: #20242d; color: #e7e9ee; }
html[data-theme="dark"] .cart-close:hover { background: #2a2f3a; }
html[data-theme="dark"] .cart-item { background: #1b1f27; }
html[data-theme="dark"] .cart-item:hover { background: #20242d; }
html[data-theme="dark"] .cart-item-img { background: #2a2f3a; }
html[data-theme="dark"] .cart-item-name { color: #f3f4f6; }
html[data-theme="dark"] .cart-item-variant { color: #9aa1ac; }
html[data-theme="dark"] .cart-item-price { color: #f3f4f6; }
html[data-theme="dark"] .qty-control { background: #20242d; border-color: #343b47; }
html[data-theme="dark"] .qty-control button { color: #e7e9ee; }
html[data-theme="dark"] .qty-control button:hover { background: #2f3540; }
html[data-theme="dark"] .qty-control span { color: #f3f4f6; }
html[data-theme="dark"] .cart-item-remove { color: #7b818c; }
html[data-theme="dark"] .cart-item-remove:hover { color: #fca5a5; background: rgba(185,28,28,0.18); }
html[data-theme="dark"] .cart-empty { color: #9aa1ac; }
html[data-theme="dark"] .cart-empty h3 { color: #f3f4f6; }
html[data-theme="dark"] .cart-footer { background: #15171e; border-top-color: #262b34; }
html[data-theme="dark"] .cart-subtotal span { color: #c2c7d0; }
html[data-theme="dark"] .cart-subtotal strong { color: #f3f4f6; }
html[data-theme="dark"] .cart-shipping-note { color: #7b818c; }
html[data-theme="dark"] .cart-continue { color: #9aa1ac; }
html[data-theme="dark"] .cart-continue:hover { color: #f3f4f6; }
