/* ============================================================
   ESTILOS DE LA BOLSA DE PEDIDOS - CARCOPAL S.A.S
   ============================================================ */

/* 1. CONTENEDOR PRINCIPAL (SIDEBAR) */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%; /* Oculto por defecto fuera de la pantalla */
    width: 400px;
    height: 100vh;
    background-color: #112240; /* Azul oscuro profundo */
    z-index: 3000;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    box-shadow: -15px 0 35px rgba(2, 12, 27, 0.7);
    transition: all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    border-left: 1px solid rgba(100, 255, 218, 0.1);
    font-family: 'Inter', sans-serif;
}

/* Estado activo: se desliza hacia adentro */
.cart-sidebar.active {
    right: 0;
}

/* 2. CABECERA */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    padding-bottom: 20px;
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-title h2 {
    color: #e6f1ff;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
}

.cart-title h2 span {
    color: #64ffda; /* Verde cian corporativo */
}

.close-cart {
    background: none;
    border: none;
    color: #64ffda;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease;
}

.close-cart:hover {
    transform: rotate(90deg);
    color: #f44336; /* Rojo al pasar el mouse para cerrar */
}

/* 3. LISTA DE PRODUCTOS (CUERPO) */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

/* Personalización del scroll */
.cart-items::-webkit-scrollbar {
    width: 6px;
}
.cart-items::-webkit-scrollbar-thumb {
    background: #233554;
    border-radius: 10px;
}

/* Diseño de cada item dentro de la bolsa */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0a192f;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(100, 255, 218, 0.05);
    transition: transform 0.2s ease;
}

.cart-item:hover {
    border-color: rgba(100, 255, 218, 0.3);
    transform: scale(1.02);
}

.cart-item-info h4 {
    color: #ccd6f6;
    font-size: 1.15rem;
    margin-bottom: 5px;
}

.cart-item-info p {
    color: #64ffda;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

/* 4. PIE DE LA BOLSA (TOTALES) */
.cart-footer {
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    padding-top: 30px;
    margin-top: 20px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-total-row span:first-child {
    color: #8892b0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
}

.cart-total-row #cartTotalText {
    color: #e6f1ff;
    font-size: 1.6rem;
    font-weight: 900;
}

.cart-note {
    font-size: 0.9rem;
    color: #495670;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* 5. BOTÓN DE ACCIÓN FINAL */
.btn-checkout {
    width: 100%;
    padding: 20px;
    background: #64ffda;
    color: #0a192f;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: #ffffff; /* Brillo blanco al hacer hover */
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(100, 255, 218, 0.2);
}

/* 6. CAPA OSCURA (OVERLAY) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 12, 27, 0.8);
    backdrop-filter: blur(4px);
    display: none; /* Se activa por JS */
    z-index: 2500;
}

/* RESPONSIVO */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%; /* En móviles ocupa toda la pantalla */
        padding: 30px 20px;
    }
}
/* ESTILOS PARA EL BOTÓN VACIAR QUE NO SALÍA */
#clearCartBtn {
    background: rgba(244, 67, 54, 0.1); /* Rojo muy suave de fondo */
    border: 1px solid #f44336;
    color: #f44336;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px; /* Separación del contador */
}

#clearCartBtn:hover {
    background: #f44336;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

/* Ajuste para que el texto de cantidad no se amontone */
#itemsCountText {
    color: #8892b0;
    font-size: 0.9rem;
    font-weight: 600;
}
