/* carrito.css - Estilos del carrito de compras */

/* --- Botón "Agregar al carrito" (NARANJA) --- */
.btn-add-cart {
    display: inline-block;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    background-color: #f97316;  /* Naranja */
    color: white;
    text-align: center;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 6px;
    width: 100%;
}

.btn-add-cart:hover {
    background-color: #ea580c;  /* Naranja más oscuro al pasar el mouse */
    transform: translateY(-1px);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

/* --- Panel flotante del carrito --- */
.cart-panel {
    position: fixed;
    bottom: 80px;
    left: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 16px;
    max-width: 320px;
    width: calc(100% - 32px);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid #e5e7eb;
}

.cart-panel.visible {
    display: block;
}

.cart-panel h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1d4ed8;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-price {
    color: #15803d;
    font-weight: 600;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 15px;
    padding: 10px 0;
    border-top: 2px solid #e5e7eb;
    margin-top: 6px;
}

.cart-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.cart-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.btn-whatsapp-cart {
    background-color: #22c55e;
    color: white;
}

.btn-whatsapp-cart:hover {
    background-color: #16a34a;
}

.btn-clear-cart {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-clear-cart:hover {
    background-color: #d1d5db;
}

/* --- Botón flotante del carrito (ícono 🛒) --- */
.btn-toggle-cart {
    position: fixed;
    bottom: 80px;
    left: 16px;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 999px;
    width: 50px;
    height: 50px;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-cart:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
}

.btn-toggle-cart .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 999px;
    font-size: 11px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

/* --- Responsive para móviles --- */
@media (max-width: 640px) {
    .cart-panel {
        bottom: 140px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .btn-toggle-cart {
        bottom: 140px;
        left: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}