/* ===== CARRITO DE COMPRAS - VENTANA LATERAL ===== */

/* Overlay del carrito */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal del carrito */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.active {
    right: 0;
}

/* Header del carrito */
.cart-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 20px;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cart-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-header h3 i {
    font-size: 1.8rem;
}

.cart-close {
    background: none;
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Contenido del carrito */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Mensaje de carrito vacío */
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.cart-empty i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

.cart-empty h4 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #333;
}

.cart-empty p {
    margin: 0 0 20px 0;
    color: #888;
    line-height: 1.5;
}

.cart-empty .btn-shop {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.cart-empty .btn-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Lista de productos del carrito */
.cart-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.cart-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.cart-item-title {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-remove:hover {
    background: #dc3545;
    color: #fff;
    transform: scale(1.1);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    border: 2px solid #e9ecef;
}

.cart-item-details {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-price {
    font-weight: 700;
    color: #FFD700;
    font-size: 1.1rem;
    margin: 0;
}

.cart-item-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin-left: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    font-weight: 600;
}

.quantity-btn:hover {
    background: #FFD700;
    color: #000;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    border: none;
    text-align: center;
    width: 50px;
    padding: 8px;
    font-weight: 600;
    color: #333;
    background: transparent;
}

.quantity-input:focus {
    outline: none;
}

/* Footer del carrito */
.cart-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cart-summary {
    margin-bottom: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.cart-summary-row:last-child {
    margin-bottom: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.cart-summary-label {
    color: #666;
}

.cart-summary-value {
    color: #333;
    font-weight: 600;
}

.cart-summary-total {
    color: #FFD700 !important;
    font-size: 1.3rem !important;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cart-btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.cart-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.cart-btn-secondary {
    background: #6c757d;
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.cart-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Animaciones */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

.cart-sidebar.slide-in {
    animation: slideIn 0.3s ease;
}

.cart-sidebar.slide-out {
    animation: slideOut 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-header {
        padding: 15px;
    }
    
    .cart-header h3 {
        font-size: 1.3rem;
    }
    
    .cart-content {
        padding: 15px;
    }
    
    .cart-item {
        padding: 12px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-footer {
        padding: 15px;
    }
}

/* Scrollbar personalizado para el carrito */
.cart-content::-webkit-scrollbar {
    width: 6px;
}

.cart-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cart-content::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 3px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

/* Estados de carga */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.cart-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
    font-size: 1.5rem;
    color: #FFD700;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificaciones del carrito */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #FFD700;
    color: #000;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.cart-notification.show {
    transform: translateX(0);
}

.cart-notification.error {
    background: #000;
    color: #fff;
}

.cart-notification.warning {
    background: #FFA500;
    color: #000;
}

.cart-notification i {
    margin-right: 8px;
}

/* ===== ESTILOS PARA BOTONES DEL CARRITO ===== */

/* Botón del carrito en desktop */
.cart-link {
    background: none;
    border: none;
    color: #FFD700;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.cart-link:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #FFA500;
    transform: translateY(-2px);
}

.cart-link:active {
    transform: translateY(0);
}

/* Botón del carrito en móvil */
.mobile-cart {
    background: none;
    border: none;
    color: #FFD700;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
}

.mobile-cart:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #FFA500;
    transform: translateY(-1px);
}

.mobile-cart:active {
    transform: translateY(0);
}

/* Badge del carrito */
.cart-badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Iconos del carrito */
.cart-icon {
    font-size: 1.2rem;
}

.mobile-cart .cart-icon {
    font-size: 1rem;
}

/* Responsive para botones del carrito */
@media (max-width: 768px) {
    .cart-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .mobile-cart {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .cart-badge {
        font-size: 0.6rem;
        min-width: 16px;
        height: 16px;
    }
}
