/* Custom styles for Compras Conjuntas */
/* Esquema de colores: AZUL OSCURO (Fecha: 23 de enero de 2026) */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-color: #f1f5f9;
    --dark-color: #0f172a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Sobrescribir colores de Bootstrap con nuestra paleta personalizada */
/* NO redefinir --bs-bg-opacity aquí: dejaríamos sin efecto a bg-opacity-* */
/* porque style.css se carga después de Bootstrap y ganaría en el cascade. */
.bg-primary {
    background-color: rgba(30, 58, 138, var(--bs-bg-opacity, 1)) !important;
}

.navbar.bg-primary,
header.bg-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%) !important;
}

.btn-primary {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

.btn-primary:hover {
    background-color: #1e40af;
    border-color: #1e40af;
}

.text-primary {
    color: #1e3a8a !important;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 300;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 10px 10px 0 0 !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Step circles for process flow */
.step-circle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

/* Statistics cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info {
    border: none;
    border-radius: 15px;
}

.card.bg-primary {
    background: linear-gradient(135deg, #1e3a8a, #0f172a) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(30, 58, 138, 0.05);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-circle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .card-body h5 {
        font-size: 1.1rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Status indicators */
.status-abierta {
    color: var(--success-color);
}

.status-cerrada {
    color: var(--secondary-color);
}

.status-evaluacion {
    color: var(--warning-color);
}

.status-adjudicada {
    color: var(--info-color);
}

/* Custom utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.m-top1 {
    margin-top: 10px;
}

.m-top2 {
    margin-top: 20px;
}

.m-top5 {
    margin-top: 50px;
}

.m-bottom1 {
    margin-bottom: 10px;
}

.m-bottom2 {
    margin-bottom: 20px;
}

.h-center {
    display: flex;
    justify-content: center;
}

.c-dark {
    color: var(--dark-color);
}

.f-small {
    font-size: 0.75rem;
}

/* Wizard Form Styles */
.wizard-tabs {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.wizard-tabs .step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.wizard-tabs .step:hover {
    color: #1e3a8a;
}

.wizard-tabs .step.active {
    color: #1e3a8a;
    font-weight: 600;
}

.wizard-tabs .step.completed {
    color: #1e3a8a;
}

.wizard-tabs .step.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.wizard-tabs .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.wizard-tabs .step.active .step-number {
    background: #1e3a8a;
    color: white;
    border-color: #1e3a8a;
}

.wizard-tabs .step.completed .step-number {
    background: #1e3a8a;
    color: white;
    border-color: #1e3a8a;
}

.wizard-tabs .step-line {
    flex: 1;
    height: 2px;
    background: #ddd;
    min-width: 40px;
}

.wizard-tabs .step-line.active {
    background: #1e3a8a;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wizard-form {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
}

.wizard-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    gap: 1rem;
}

.form-section-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.form-section-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Ocultar marca "Powered by CKEditor" */
.ck.ck-balloon-panel[class*="ck-powered-by"] {
    display: none !important;
}

.ck-powered-by {
    display: none !important;
}

a[href*="ckeditor.com"][target="_blank"] {
    display: none !important;
}

.badge-warning-custom {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Resaltado de productos con logística inconsistente */
.logistica-inconsistente-highlight {
    border: 2px solid #ffc107 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.35);
    animation: logistica-pulse 1.2s ease-out 2;
}
@keyframes logistica-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70%  { box-shadow: 0 0 0 0.75rem rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}
.logistica-inconsistente-highlight .card-header::after {
    content: "Inconsistente";
    background-color: #ffc107;
    color: #000;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

/* ========================================
   Vista de precios del proveedor
   ======================================== */
.table-precios input[type="number"] {
    width: 120px;
    text-align: right;
}
/* Header de tabla en azul medio (más claro que el del header del producto) */
.table-precios thead th {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: 600;
}
.producto-card {
    margin-bottom: 2.5rem;
}
/* Header del producto en azul oscuro (paleta primaria del proyecto) */
.producto-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
}
.table-container {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}
.badge-total {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
}
/* Botón "Especificaciones" en el header del producto: amarillo destacado */
.btn-especificaciones {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
    font-weight: 600;
}
.btn-especificaciones:hover {
    background-color: #ffb300;
    border-color: #ffb300;
    color: #212529;
}
/* Fila tfoot "Aplicar a toda la columna" más compacta */
.table-precios tfoot td {
    padding: 0.15rem 0.4rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}
.table-precios tfoot .btn {
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
}
.table-precios tfoot .small-label {
    font-size: 0.75rem;
    line-height: 1.2;
}
.alert-fixed {
    position: fixed !important;
    top: 100px !important;
    right: 30px !important;
    z-index: 99999 !important;
    min-width: 400px !important;
    max-width: 500px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
    animation: slideInRight 0.4s ease-out !important;
    margin: 0 !important;
    padding: 1rem 1.5rem !important;
    font-size: 1.1rem !important;
}
@keyframes slideInRight {
    from {
        transform: translateX(500px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ==========================================
   Tablas compactas
   ========================================== */
/* Tablas de listados y modales con muchas columnas: reduce el texto para que
   la información quepa sin verse apretada. Los campos .form-control-sm de las
   filas editables ya usan 0.875rem, así que el conjunto se ve parejo. */
.table-compacta {
    font-size: 0.85rem;
}
