/*==============================================
=   MÓDULO: CARRITO DE COTIZACIONES - ESTILOS   =
==============================================*/

/* ===== MODAL DEL CARRITO ===== */
#cartModal .modal-header {
    border-bottom: none;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0d6efd, #0a58ca) !important;
}

#cartModal .modal-header .btn-close-white {
    filter: brightness(0) invert(1);
}

#cartModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

#cartModal .modal-body {
    padding: 1.5rem;
    background: #ffffff;
}

#cartModal .modal-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 1.5rem;
    background: #f8f9fa;
}

/* ===== FORMULARIO DE DATOS DEL CLIENTE ===== */
.customer-form-section {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.customer-form-section:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.customer-form-section h6 {
    color: #0d6efd;
    font-size: 1.1rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.75rem;
}

.customer-form-section .form-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.customer-form-section .form-control {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.customer-form-section .form-control:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
    outline: none;
}

.customer-form-section .form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.customer-form-section .form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.customer-form-section .invalid-feedback {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
    font-weight: 500;
}

.customer-form-section small.text-muted {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ===== SECCIÓN DE PRODUCTOS ===== */
.cart-items-section h6 {
    color: #0d6efd;
    font-size: 1.1rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.75rem;
}

/* ===== TABLA DE PRODUCTOS ===== */
#cartModal .table {
    margin-bottom: 0;
}

#cartModal .table thead th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
}

#cartModal .table tbody td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

#cartModal .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Items del carrito (vista dinámica) */
.cart-items-list .cart-item {
    transition: all 0.2s ease;
    padding: 1rem 0.5rem;
}

.cart-items-list .cart-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.cart-items-list .cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cart-items-list .cart-item h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #212529;
}

.cart-items-list .cart-item small {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6c757d;
}

.cart-items-list .cart-item .remove-item {
    color: #dc3545;
    transition: all 0.2s ease;
}

.cart-items-list .cart-item .remove-item:hover {
    transform: scale(1.2);
    color: #bb2d3b;
}

/* ===== BADGES DE OPCIONES ===== */
#cartModal .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
}

#cartModal .badge.bg-info {
    background: linear-gradient(135deg, #0dcaf0, #0b9fc2) !important;
    color: #000;
}

#cartModal .badge.bg-success {
    background: linear-gradient(135deg, #198754, #0d6e44) !important;
    color: #fff;
}

/* ===== FOOTER DEL MODAL ===== */
#cartFooter .btn-outline-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
}

#cartFooter .btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

#cartFooter .btn-success {
    background: linear-gradient(135deg, #198754, #0d6e44);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

#cartFooter .btn-success:hover {
    background: linear-gradient(135deg, #0d6e44, #198754);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(25, 135, 84, 0.3);
}

#cartFooter .btn-success i {
    transition: transform 0.2s ease;
}

#cartFooter .btn-success:hover i {
    transform: translateX(3px);
}

/* ===== ESTADO VACÍO ===== */
#cartContent .text-center {
    padding: 3rem 1rem;
}

#cartContent .text-center i {
    color: #dee2e6;
    margin-bottom: 1rem;
}

#cartContent .text-center h5 {
    color: #495057;
    font-weight: 600;
}

#cartContent .text-center p {
    color: #6c757d;
}

#cartContent .text-center .btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

#cartContent .text-center .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

/* ===== ALERTA INFORMATIVA ===== */
#cartModal .alert-info {
    background: #cff4fc;
    border: none;
    color: #055160;
    border-radius: 8px;
    border-left: 4px solid #0dcaf0;
}

#cartModal .alert-info i {
    color: #0dcaf0;
}

/* ===== CONTADOR DEL CARRITO ===== */
#cartCountDesktop,
#cartCountMobileHeader {
    transition: all 0.2s ease;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    #cartModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
}

@media (max-width: 767.98px) {
    .customer-form-section {
        padding: 1rem !important;
    }
    
    .customer-form-section .row {
        gap: 0.5rem;
    }
    
    .cart-items-list .cart-item .row {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-items-list .cart-item .col-2,
    .cart-items-list .cart-item .col-6,
    .cart-items-list .cart-item .col-4 {
        width: 100%;
        text-align: center !important;
        margin-bottom: 0.5rem;
    }
    
    .cart-items-list .cart-item img {
        margin: 0 auto;
    }
    
    #cartFooter .d-flex {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    #cartFooter .d-flex > div {
        width: 100%;
        text-align: center;
    }
    
    #cartFooter .d-flex .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    #cartModal .modal-header h5 {
        font-size: 1rem;
    }
    
    .cart-items-list .cart-item {
        padding: 0.75rem 0.25rem;
    }
    
    .cart-items-list .cart-item h6 {
        font-size: 0.85rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes cartItemAdded {
    0% { transform: scale(1); background: #fff3cd; }
    100% { transform: scale(1); background: transparent; }
}

.cart-item-added {
    animation: cartItemAdded 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* ===== SCROLL PERSONALIZADO ===== */
#cartModal .modal-body {
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f1f1f1;
}

#cartModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#cartModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#cartModal .modal-body::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 3px;
}

#cartModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}