/* =========================================
   SLIDE-OUT CART (Nivel Dios)
   ========================================= */

/* Botón del Header */
.btn-cart-trigger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-cart-trigger:hover {
    color: var(--brand-accent);
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--brand-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000; /* Borde negro para separar del icono */
}

/* OVERLAY (Fondo oscuro borroso) */
.cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* Efecto Glass */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* SIDEBAR (El panel) */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background-color: #050505; /* Negro puro */
    z-index: 9999;
    transform: translateX(100%); /* Oculto a la derecha */
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1); /* Animación elástica suave */
    display: flex;
    flex-direction: column;
    border-left: 1px solid #222;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}

.cart-sidebar.open {
    transform: translateX(0);
}

/* Header Carrito */
.cart-header {
    padding: 20px 30px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.btn-close-cart {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-close-cart:hover { color: #fff; }

/* Lista de Items */
.cart-items {
    flex: 1;
    overflow-y: auto; /* Scroll si hay muchos productos */
    padding: 20px;
}

/* Item Individual */
.cart-item {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #1a1a1a;
    position: relative;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    color: #fff;
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.item-variant {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.item-price {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

/* Selector de Cantidad */
.qty-selector {
    display: flex;
    align-items: center;
    background: #111;
    border-radius: 6px;
    padding: 2px;
}

.qty-selector button {
    background: none;
    border: none;
    color: #888;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

.qty-selector button:hover { color: #fff; }

.qty-selector span {
    color: #fff;
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

.btn-remove-item {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-remove-item:hover { color: #ff4444; }

/* Footer Carrito */
.cart-footer {
    padding: 25px 30px;
    background: #0a0a0a;
    border-top: 1px solid #222;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.cart-total span { color: #888; font-size: 1rem; }
.cart-total .total-price { color: #fff; font-size: 1.5rem; font-weight: 800; }

.shipping-note {
    font-size: 0.85rem;
    color: #4caf50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--brand-accent);
    color: #fff;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-checkout:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

/* Mobile */
@media (max-width: 480px) {
    .cart-sidebar { width: 100%; }
}