/* ============================================================
   SELLO LLEVO — Estilos Globales
   Paleta: Naranja #FF6B00 (primario) | Azul #0D47A1 | Blanco
   Mobile-first, optimizado para conductores en carretera
   ============================================================ */

/* ── Variables CSS ─────────────────────────────────────────── */
:root {
    --sl-orange:       #FF6B00;
    --sl-orange-dark:  #E05A00;
    --sl-blue:         #0D47A1;
    --sl-blue-light:   #1565C0;
    --sl-green:        #2E7D32;
    --sl-success:      #1B8A4A;
    --sl-hero-from:    #0D47A1;
    --sl-hero-to:      #1565C0;
    --sl-card-radius:  16px;
    --sl-transition:   .2s ease;
    --sl-font-base:    'Segoe UI', system-ui, -apple-system, sans-serif;
    --bs-primary:      #0D47A1;
    --bs-primary-rgb:  13, 71, 161;
    --bs-warning:      #FF6B00;
    --bs-warning-rgb:  255, 107, 0;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--sl-font-base);
    font-size:   16px;
    line-height: 1.6;
    color:       #1a1a2e;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* Accesibilidad: outline visible en focus */
*:focus-visible {
    outline: 3px solid var(--sl-orange);
    outline-offset: 2px;
}

/* ── Bootstrap overrides ───────────────────────────────────── */
.btn-primary {
    background: var(--sl-blue);
    border-color: var(--sl-blue);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--sl-blue-light);
    border-color: var(--sl-blue-light);
}
.btn-warning {
    background: var(--sl-orange);
    border-color: var(--sl-orange);
    color: #fff;
}
.btn-warning:hover {
    background: var(--sl-orange-dark);
    border-color: var(--sl-orange-dark);
    color: #fff;
}

.text-primary { color: var(--sl-blue) !important; }
.text-warning  { color: var(--sl-orange) !important; }
/* Sólidos: usan valor directo */
.bg-primary    { background-color: var(--sl-blue) !important; }
.bg-warning    { background-color: var(--sl-orange) !important; }
/* Soft: opacity vía rgba (no afectadas por los overrides sólidos de arriba) */
.bg-primary-soft { background-color: rgba(13,71,161,.1) !important; }
.bg-warning-soft { background-color: rgba(255,107,0,.1)  !important; }

/* Badges warning: fondo naranja → texto blanco */
.badge.bg-warning,
.badge.bg-warning.text-warning { color: #fff !important; }

/* ── Spacing utilities ─────────────────────────────────────── */
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.min-vh-60 { min-height: 60vh; }
.fs-7 { font-size: .825rem; }
.fs-8 { font-size: .75rem; }
.lh-sm { line-height: 1.25; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
    z-index: 1030;
    min-height: 64px;
}
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -.5px;
}
.nav-link {
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .75rem !important;
    border-radius: 8px;
    transition: background var(--sl-transition);
}
.nav-link:hover { background: rgba(13,71,161,.06); }

/* Avatar pequeño en navbar */
.avatar-sm {
    width:  36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sl-blue);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-md {
    width:  48px;
    height: 48px;
    font-size: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 0;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--sl-hero-from) 0%, var(--sl-hero-to) 60%, #0D47A1 100%);
    z-index: 0;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 70%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,107,0,.18) 0%, transparent 70%);
}
.hero-section .container { z-index: 1; position: relative; }
.hero-section .text-white-75 { color: rgba(255,255,255,.78) !important; }

/* ── CTA Transportadores ───────────────────────────────────── */
.cta-transporters {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
}

/* ── Cards de cargas ───────────────────────────────────────── */
.card-load {
    border-radius: var(--sl-card-radius) !important;
    transition: transform var(--sl-transition), box-shadow var(--sl-transition);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.12) !important;
}

/* Badges de tipo de carga */
.cargo-badge-general    { background: rgba(13,71,161,.1);   color: #0D47A1; }
.cargo-badge-refrigerado{ background: rgba(0,150,220,.1);   color: #0096DC; }
.cargo-badge-liquidos   { background: rgba(3,155,229,.1);   color: #039BE5; }
.cargo-badge-maquinaria { background: rgba(121,85,72,.1);   color: #795548; }
.cargo-badge-animales   { background: rgba(76,175,80,.1);   color: #4CAF50; }
.cargo-badge-quimicos   { background: rgba(244,67,54,.1);   color: #F44336; }
.cargo-badge-otro       { background: rgba(100,100,100,.1); color: #666; }

/* ── Ruta (origen → destino) ───────────────────────────────── */
.route-card { border: 1px solid rgba(13,71,161,.12); }
.border-dashed { border-style: dashed !important; }

/* ── Steps ─────────────────────────────────────────────────── */
.step-badge {
    width:  36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    background: var(--sl-blue);
    color: #fff;
    flex-shrink: 0;
}
.step-badge.completed { background: var(--sl-green); }
.step-badge.active    { background: var(--sl-orange); }
.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    max-width: 80px;
}

/* ── Formularios ───────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e0e0e0;
    padding: .6rem 1rem;
    font-size: .9rem;
    transition: border-color var(--sl-transition), box-shadow var(--sl-transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--sl-blue);
    box-shadow: 0 0 0 3px rgba(13,71,161,.1);
}
.input-group-text {
    border-color: #e0e0e0;
    border-radius: 10px 0 0 10px;
}
.input-group > .form-control:last-child,
.input-group > .btn:last-child { border-radius: 0 10px 10px 0; }

/* Tarjeta auth */
.auth-page .card {
    border-radius: 20px !important;
    box-shadow: 0 8px 40px rgba(0,0,0,.08) !important;
}

/* Selector de rol en registro */
.btn-check:checked + .btn-outline-primary,
.btn-check + .btn-outline-primary:hover {
    background: var(--sl-blue);
    color: #fff !important;
    border-color: var(--sl-blue);
}
.btn-check:checked + .btn-outline-primary small,
.btn-check + .btn-outline-primary:hover small {
    color: #fff !important;
}

/* ── Toast personalizado ───────────────────────────────────── */
#toastContainer {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.sl-toast {
    min-width: 280px;
    border-radius: 12px;
    padding: .75rem 1.2rem;
    font-size: .875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    animation: slideInRight .3s ease;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sl-toast-success { background: #1B8A4A; color: #fff; }
.sl-toast-danger  { background: #C62828; color: #fff; }
.sl-toast-warning { background: #FF6B00; color: #fff; }
.sl-toast-info    { background: #0D47A1; color: #fff; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── PWA Install Banner ────────────────────────────────────── */
#pwaInstallToast { border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.15); }

/* ── Responsive ajustes clave ──────────────────────────────── */
@media (max-width: 575.98px) {
    .hero-section h1 { font-size: 1.7rem; }
    .hero-section .lead { font-size: 1rem; }
    .display-6 { font-size: 1.8rem; }
    .card-body { padding: 1rem; }

    /* Botones grandes para móvil (conductores) */
    .btn-lg {
        padding: .9rem 1.5rem;
        font-size: 1rem;
    }

    /* Touch targets mínimo 44px */
    .nav-link, .btn, .form-control, .form-select {
        min-height: 44px;
    }
}

@media (max-width: 991.98px) {
    .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
}

/* ── Loader ────────────────────────────────────────────────── */
#pageLoader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .3s;
}
#pageLoader.hidden { opacity: 0; pointer-events: none; }

/* ── Object fit utility ────────────────────────────────────── */
.object-fit-cover { object-fit: cover; }

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Card de imagen placeholder ────────────────────────────── */
.card-img-placeholder {
    border-radius: var(--sl-card-radius) var(--sl-card-radius) 0 0;
}

/* ── Notificaciones drawer ─────────────────────────────────── */
.notif-item:hover { background: rgba(13,71,161,.1) !important; }

/* ── Icon box admin ────────────────────────────────────────── */
.icon-box { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; }

/* ── Footer: texto y enlaces en blanco (#fff) ───────────────── */
footer,
footer p,
footer small,
footer span,
footer li,
footer .text-muted {
    color: #ffffff !important;
}
footer a,
footer a:link,
footer a:visited,
footer a:hover,
footer a:active,
footer a:focus,
footer a:focus-visible {
    color: #ffffff !important;
    text-decoration-color: rgba(255, 255, 255, .35);
}
footer a:hover,
footer a:focus {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .7);
}
