/* assets/css/cart.css */
/* Estilos completos para el sistema de carrito */

/* Contador del carrito en navegación */
.nav-cart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-counter {
    background: var(--color-black);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
}

/* Overlay del carrito */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar del carrito */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.cart-sidebar.open {
    right: 0;
}

/* Header del carrito */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.cart-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.cart-close:hover {
    background: #f5f5f5;
}

/* Contenido del carrito */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.cart-empty p {
    margin: 0 0 1rem 0;
    color: #666;
}

.cart-empty a {
    color: var(--color-black);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--color-black);
}

/* Items del carrito */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.cart-item-size {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: #666;
}

.cart-item-price {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8rem;
}

.price-final {
    font-weight: 600;
    color: var(--color-black);
}

/* Controles de cantidad */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: column;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #f5f5f5;
    border-color: var(--color-black);
}

.quantity {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Botón eliminar */
.cart-item-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: #f5f5f5;
    color: #333;
}

/* Footer del carrito */
.cart-footer {
    border-top: 1px solid #eee;
    padding: 1.5rem;
    background: #fafafa;
}

.cart-summary {
    margin-bottom: 1rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-total {
    color: var(--color-black);
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary, .btn-primary {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: white;
    border: 1px solid #ddd;
    color: var(--color-black);
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-primary {
    background: var(--color-black);
    color: white;
}

.btn-primary:hover {
    background: #333;
}

/* Notificaciones toast */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-black);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
    
    .cart-item-quantity {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .cart-actions {
        flex-direction: column;
    }
}
