/* =====================================================
   CARRITO - ESTILOS
   ===================================================== */

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--white);
    z-index: 1501;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.cart-header h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-header h3 i {
    color: var(--primary-color);
}

.cart-close {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.cart-close:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Cart Items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    position: relative;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-qty button {
    width: 28px;
    height: 28px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cart-item-qty button:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.cart-item-qty span {
    min-width: 35px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-light);
    transition: var(--transition);
}

.cart-item-remove:hover {
    background: var(--danger-color);
    color: var(--white);
}

/* Cart Empty */
.cart-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.cart-empty.active {
    display: flex;
}

.cart-empty i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 25px;
}

/* Cart Footer */
.cart-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.cart-footer.hidden {
    display: none;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

.cart-subtotal span:last-child {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.cart-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #e8f5e9;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.cart-discount span:first-child {
    color: #2e7d32;
}

.cart-discount span:last-child {
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--secondary-color);
    color: var(--white);
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast i {
    font-size: 1.2rem;
}

.toast span {
    font-weight: 500;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
    }
    
    .cart-item {
        gap: 12px;
        padding: 12px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-name {
        font-size: 0.85rem;
    }
    
    .toast-container {
        left: 15px;
        right: 15px;
        bottom: 15px;
    }
    
    .toast {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}
