/* =========================================================
   RASTREO.CSS - Diseño de la pantalla de seguimiento
========================================================= */

body {
    background-color: var(--bg-main);
    margin: 0;
}

/* --- ENCABEZADO OSCURO CURVO --- */
.tracking-header {
    background-color: #0b1120; /* Azul muy oscuro casi negro */
    padding: 40px 20px 100px 20px; /* Mucho espacio abajo para que monte la tarjeta */
    border-radius: 0 0 50px 50px; /* Bordes redondeados inferiores */
    text-align: center;
    color: white;
}

.tracking-header img {
    max-height: 60px;
    margin-bottom: 20px;
}

.tracking-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

/* --- BUSCADOR TIPO PÍLDORA (PILL) --- */
.search-pill-container {
    background: white;
    max-width: 550px;
    margin: 0 auto;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.search-pill-container input {
    flex: 1;
    background-color: #f1f5f9; /* Fondo gris claro/celeste */
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 1rem;
    color: var(--text-slate-800);
    outline: none;
}

.search-pill-container button {
    background-color: var(--brand-orange);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.3s;
}

.search-pill-container button:hover {
    background-color: var(--brand-orange-dark);
}

/* --- TARJETA DE RESULTADOS (OVERLAP) --- */
.tracking-container {
    max-width: 700px;
    margin: -60px auto 50px auto; /* El margen negativo hace que "suba" sobre el fondo oscuro */
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.result-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Cabecera de la tarjeta */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
}

.result-header span.label {
    color: var(--text-slate-400);
    font-size: 0.85rem;
}

.result-header h3 {
    font-size: 1.5rem;
    color: var(--text-slate-800);
    margin-top: 4px;
}

/* Badges Dinámicos */
.status-badge-tracking {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
}
.badge-entregado { background: #dcfce7; color: #15803d; }
.badge-camino { background: #dbeafe; color: #1d4ed8; }
.badge-almacen { background: #f1f5f9; color: #64748b; }
.badge-fallido { background: #fee2e2; color: #b91c1c; }

/* --- CUADRÍCULA DE REMITENTE Y DESTINATARIO --- */
.info-grid {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.info-col h4 {
    font-size: 0.85rem;
    color: var(--sidebar-bg);
    margin-bottom: 4px;
    font-weight: bold;
}

.info-col .name {
    color: var(--text-slate-500);
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.info-col .address {
    font-size: 0.85rem;
    color: var(--text-slate-500);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* --- LÍNEA DE TIEMPO VERTICAL --- */
.vertical-timeline {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    padding-left: 10px;
}

/* La línea gris que une los círculos */
.vertical-timeline::before {
    content: '';
    position: absolute;
    left: 20px; /* Alineado al centro de los iconos */
    top: 5px;
    bottom: 10px;
    width: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.timeline-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid #cbd5e1;
    flex-shrink: 0;
    transition: all 0.3s;
}

/* Estado: Activo/Completado (El verde de tu imagen) */
.timeline-step.active .timeline-icon {
    background: #22c55e; /* Relleno verde */
    border: 3px solid #22c55e;
    box-shadow: 0 0 0 3px #bbf7d0; /* Halo verde claro exterior */
}

/* Estado: Error */
.timeline-step.error .timeline-icon {
    background: #ef4444;
    border: 3px solid #ef4444;
    box-shadow: 0 0 0 3px #fecaca;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-slate-800);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-slate-400);
}

/* Diseño Móvil */
@media screen and (max-width: 600px) {
    .search-pill-container {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
    }
    .search-pill-container input {
        width: 100%;
        margin-bottom: 10px;
    }
    .search-pill-container button {
        width: 100%;
        margin-left: 0;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
}