/* ==========================================================================
   Variables y Tema Principal
   ========================================================================== */
:root {
    --blue-light: #87CEEB;
    --blue-medium: #4A90E2;
    --blue-dark: #1E3A8A;
    --primary-gradient: linear-gradient(135deg, var(--blue-medium) 0%, var(--blue-dark) 100%);
}

/* --- ESTILO DE LA CABECERA (RESTAURADO) --- */
.store-selector {
    background: var(--primary-gradient) !important;
    color: white;
}

/* --- RECUADRO DE TIENDA EN LA CABECERA --- */
.store-display-badge {
    background-color: #ffffff;
    color: var(--blue-dark, #1E3A8A);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 8px 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    justify-content: center;
}

/* --- ESTILOS PARA LISTA DE PRODUCTOS (IZQUIERDA) -- */

.product-card-compact {
    cursor: pointer;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease-in-out;
    background-color: white;
}

.product-card-compact:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transform: translateY(-1px);
}

.product-first-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.product-name {
    font-weight: 500;
    flex-grow: 1;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.2;
}

.product-price {
    font-weight: bold;
    color: #198754;
    font-size: 1rem;
    white-space: nowrap;
}

.product-second-line {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
}

.product-second-line small {
    display: inline-block;
}

.product-second-line .fas {
    width: 12px;
    text-align: center;
}

/* --- ESTILOS PARA EL CARRITO (DERECHA) -- */

.cart-item-row {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    background-color: #fafafa;
}

.product-info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.product-name-cart {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.line-total {
    font-weight: bold;
    color: #198754;
    font-size: 1rem;
}

.product-controls-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 2px;
}

.control-group.quantity-display span {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
}

.control-group.price-control,
.control-group.discount-control {
    flex-grow: 1;
}

.price-control .form-control,
.discount-control .form-control {
    text-align: right;
}

.product-controls-line .btn-outline-danger {
    height: 31px;
}

.quantity-display {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.original-price {
    font-size: 0.875rem;
}

/* Estilos para el modal de descuento */
.form-control-plaintext {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.form-control-plaintext.bg-light {
    background-color: #e9ecef !important;
    font-weight: 500;
}

#final-price-input {
    font-size: 1.1rem;
    font-weight: 500;
}

#final-price-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Estilos para los botones de descuento rápido */
.btn-group .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Mejorar el total de solo lectura */
#final-total-input[readonly] {
    background-color: #e9ecef !important;
    border-color: #ced4da;
    color: #495057;
    font-weight: bold;
    cursor: not-allowed;
}

/* Indicadores visuales en el carrito */
.line-total.text-warning {
    font-weight: bold;
}

.line-total.text-success {
    font-weight: bold;
}

.original-price {
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* Mejorar la visualización del resumen en el modal */
.alert-info {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.alert-info .fs-5 {
    font-size: 1.1rem !important;
}

.alert-info .fs-6 {
    font-size: 0.95rem !important;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .product-controls-line {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .product-controls-line > * {
        text-align: center;
    }
    
    .product-second-line {
        font-size: 0.75rem;
    }
}
/* Estilos para productos activos e inactivos */
.product-card {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-card.inactive {
    cursor: not-allowed;
}

.product-status {
    font-size: 0.8em;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.product-status.active {
    background-color: #4caf50;
    color: white;
}

.product-status.inactive {
    background-color: #ef5350;
    color: white;
}

.product-card .btn-secondary[disabled] {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-details {
    margin-bottom: 15px;
}

.product-details p {
    margin-bottom: 5px;
    font-size: 0.9em;
}

.product-price {
    font-weight: bold;
    font-size: 1.1em !important;
    color: #2c3e50;
}

/* ==========================================================================
   Controles de Paginación
   ========================================================================== */
.pagination-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-buttons button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-buttons button:hover:not(:disabled) {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.pagination-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-buttons .page-number {
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    color: #0d6efd;
}

.pagination-jump {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-jump label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 0.875rem;
}

.pagination-jump input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    text-align: center;
}

.pagination-jump button {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #0d6efd;
    background-color: #0d6efd;
    color: white;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-jump button:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}
