/* /css/carrito.css */

/* Welcome Section */
.cart-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cart-welcome h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cart-welcome .lead {
    font-size: 1.1rem;
    opacity: 0.95;
}

.cart-welcome .btn-light {
    background: white;
    color: #667eea;
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cart-welcome .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* Cart Actions */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.cart-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.cart-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-bulk-delete {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-bulk-delete:hover {
    background: #bb2d3b;
    color: white;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Product Container */
.product-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    height: fit-content;
}

.product-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.product-container.selected {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

/* Checkbox */
.select-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
    accent-color: #0d6efd;
}

/* Delete Button Overlay */
.delete-btn-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.product-container:hover .delete-btn-overlay {
    opacity: 1;
    transform: scale(1);
}

.delete-btn-overlay:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.delete-btn-overlay i {
    font-size: 1.2rem;
    line-height: 1;
}

/* Product Image */
.product-image-wrapper {
    height: 200px;
    overflow: hidden;
    cursor: pointer;
    background: #f8f9fa;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 1rem;
}

.product-container:hover .product-image {
    transform: scale(1.05);
}

/* Product Details */
.product-details {
    padding: 1rem;
}

.product-codes {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-family {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Quantity Controls */
.product-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.quantity-label {
    font-size: 0.9rem;
    color: #666;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    color: #333;
}

.quantity-btn:hover:not(:disabled) {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Price */
.price-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0d6efd;
}

.subtotal-item {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 600;
    margin-left: auto;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.cart-summary h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #666;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    border-top: 2px solid #f0f0f0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: #198754;
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    background: #146c43;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.cart-empty-state h3 {
    color: #666;
    margin-bottom: 1rem;
}

.cart-empty-state .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
}

/* Loading State */
#loading-cart {
    background: white;
    border-radius: 12px;
    padding: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-welcome {
        padding: 1.5rem;
    }
    
    .cart-welcome h1 {
        font-size: 1.5rem;
    }
    
    .cart-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cart-actions > div {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .cart-actions .btn {
        flex: 1;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .delete-btn-overlay {
        opacity: 1;
        transform: scale(1);
    }
    
    .cart-summary {
        position: static;
        margin-top: 1.5rem;
    }
    
    .price-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subtotal-item {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .cart-actions > div {
        flex-direction: column;
        width: 100%;
    }
    
    .cart-actions .btn {
        width: 100%;
    }
    
    .product-quantity {
        flex-wrap: wrap;
    }
    
    .quantity-controls {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}