:root {
    --paynal-yellow: #f59e0b;
    --paynal-red: #dc2626;
    --paynal-green: #22c55e;
    --paynal-gray: #6b7280;
}

/* =========================================
   1. BUSCADOR CLÁSICO SOBRE FONDO AMARILLO
   ========================================= */
.buscador-container {
    background-color: #ffc700;
    padding: 30px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.buscador-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
    display: block;
}

.buscador-form-row {
    display: flex;
    gap: 0;
    max-width: 500px;
}

.buscador-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #111827;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
    background: #ffffff;
}

.buscador-btn {
    background-color: #ffc700;
    color: #111827;
    border: 1px solid #111827;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.buscador-btn:hover {
    background-color: #e6b300;
}

.buscador-legend {
    margin-top: 12px;
    font-size: 0.88rem;
    color: #111827;
}

/* =========================================
   2. LAYOUT GRID A 2 COLUMNAS
   ========================================= */
.rastreo-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .rastreo-grid {
        grid-template-columns: 1fr;
    }
}

.rastreo-card, .timeline-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #f3f4f6;
}

.rastreo-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.icon-box-red {
    width: 32px;
    height: 32px;
    background: var(--paynal-red);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* =========================================
   3. COLUMNA IZQUIERDA Y BARRA DE AVANCE
   ========================================= */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.info-label {
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    font-weight: 600;
    color: #111827;
}

.red-text {
    color: var(--paynal-red);
    font-weight: 700;
}

.estado-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.estado-entregado { background: #dcfce7; color: #15803d; }
.estado-proceso, .estado-transito { background: #fef3c7; color: #b45309; }
.estado-cancelado { background: #fee2e2; color: #b91c1c; }

/* Contenedor de avance */
.avance-row {
    margin-top: 6px;
}

.avance-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 55%;
}

.avance-barra {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
}

.avance-progreso {
    height: 100%;
    border-radius: 50px;
    transition: width 0.6s ease;
}

/* Estado 1: En tránsito/proceso (<100%) -> Gradiente Rojo a Amarillo */
.avance-progreso.avance-proceso {
    background: linear-gradient(90deg, #dc2626 0%, #f59e0b 100%);
}

/* Estado 2: Entregado (100%) -> Verde Puro */
.avance-progreso.avance-entregado {
    background: #22c55e !important;
}

/* Estado 3: Cancelado */
.avance-progreso.avance-cancelado {
    background: #ef4444 !important;
}

.avance-texto {
    font-weight: 700;
    font-size: 0.82rem;
    color: #111827;
}

/* =========================================
   4. DETALLES DE RASTREO (TIMELINE)
   ========================================= */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: stretch;
    gap: 14px;
}

/* Columna de ícono + línea centrada */
.timeline-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 36px;
    flex-shrink: 0;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.icon-default, .icon-documentado, .icon-cedis, .icon-transito, .icon-reparto, .icon-sucursal {
    background: #f59e0b;
    color: #dc2626;
}

.icon-entregado {
    background: #22c55e;
    color: #ffffff;
}

.icon-cancelado {
    background: #dc2626;
    color: #ffffff;
}

/* Línea conectora entre pasos */
.timeline-line {
    width: 2px;
    background-color: #e5e7eb;
    flex-grow: 1;
    margin-top: 4px;
    margin-bottom: -8px;
}

/* Cajas de evento */
.timeline-box {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-time-col {
    min-width: 110px;
}

.time-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: #22c55e;
}

.time-hour {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.timeline-detail-col {
    flex: 1;
}

.detail-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
}

.detail-location {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Mensajes auxiliares */
.mensaje-error {
    padding: 12px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mensaje-cargando {
    padding: 12px;
    color: #4b5563;
    font-size: 0.9rem;
}

/* ==========================================================================
   MÓDULO DE RASTREO (BUSCADOR Y RESULTADOS ALINEADOS)
   ========================================================================== */

/* 1. SECCIONES PADRE (FONDOS): Aseguran padding lateral idéntico */
.seccion-amarilla,
div:has(> #formulario-rastreo) {
    background-color: #ffc700;
    padding: 35px 20px !important;
    width: 100%;
    box-sizing: border-box !important;
}

.seccion-resultados,
#resultado-rastreo {
    padding: 35px 20px !important;
    width: 100%;
    box-sizing: border-box !important;
}

/* 2. TARJETA DEL BUSCADOR (AMARILLO): Forzada al mismo ancho que los resultados */
.paynal-search,
#formulario-rastreo {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 24px 28px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
    
    /* Ancho unificado: ajusta 1140px si tu grid usa otro max-width */
    width: 100% !important;
    max-width: 1140px !important; 
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Unificar el ancho del contenedor de resultados de abajo */
.contenedor-resultados,
.rastreo-grid,
.paynal-results-container {
    width: 100% !important;
    max-width: 1140px !important; /* Debe ser exactamente igual al de arriba */
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* 3. ESTRUCTURA INTERNA DEL BUSCADOR */
.paynal-label {
    display: block !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 10px !important;
}

.paynal-search-box {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    width: 100% !important;
}

/* Input de texto */
.paynal-search-box input#numero-guia,
.paynal-search-box input[type="text"] {
    flex: 1 !important;
    height: 48px !important;
    padding: 0 16px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 0.98rem !important;
    color: #111827 !important;
    background-color: #f9fafb !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.paynal-search-box input:focus {
    border-color: #dc2626 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

/* Botón Rastrear */
.paynal-search-box button#buscar-guia,
.paynal-search-box button[type="submit"] {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: none !important;
    height: 48px !important;
    padding: 0 28px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    box-shadow: none !important;
}

.paynal-search-box button:hover {
    background-color: #b91c1c !important;
}

.paynal-search-box button:active {
    transform: scale(0.98) !important;
}

/* Texto de ayuda inferior */
.paynal-help {
    display: block !important;
    margin-top: 12px !important;
    font-size: 0.82rem !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
}