/* ===============================
   UNIFIED CART STYLES
   Estilos para carrito que maneja MAQSER y Grupo SCAL
   =============================== */

/* Cart Sections */
.cart-section {
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.maqser-section {
    border-color: #007bff;
}

.scal-section {
    border-color: #28a745;
}

.cart-section-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.maqser-section .cart-section-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.scal-section .cart-section-header {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.section-total {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Cart Items */
.cart-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 15px;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.item-brand, .item-price {
    margin: 2px 0;
    font-size: 0.9rem;
    color: #666;
}

.item-price {
    font-weight: 500;
}

/* Controls */
.item-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 5px;
}

.qty-btn {
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.qty-btn:hover {
    background: var(--primary-dark, #0056b3);
}

.qty-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    padding: 0 5px;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.remove-btn:hover {
    background: #c82333;
}

.item-total {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color, #007bff);
    text-align: right;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.maqser-btn {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border: none;
}

.maqser-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085) !important;
}

.scal-btn {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    border: none;
}

.scal-btn:hover {
    background: linear-gradient(135deg, #1e7e34, #155724) !important;
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
}

.cart-empty h3 {
    margin-bottom: 10px;
    color: #333;
}

.cart-empty p {
    color: #666;
    font-size: 1rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 15px 20px;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    min-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-content {
    padding-right: 30px;
}

.notification-content h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.notification-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    
    .item-controls {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    .item-total {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 5px;
        font-size: 1.2rem;
    }
    
    .cart-actions {
        gap: 10px;
    }
    
    .cart-actions .btn {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Loading States */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.cart-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cart Badge Enhancement */
#cart-count {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* Modal Enhancements for unified cart */
.cart-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.cart-body {
    max-height: 50vh;
    overflow-y: auto;
}

.cart-total {
    border-top: 2px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.total-amount {
    color: var(--primary-color, #007bff);
    font-size: 1.4rem;
}