/* ==============================================================================
   LAESH — header-topbar.css  (2026-10-10, Opción B "Barra superior")
   ------------------------------------------------------------------------------
   • Barra superior fija (#topbar-laesh): horarios, teléfonos (tel + WhatsApp) y
     el acceso "Médicos" (antes "Portal Médicos" dentro de la fila de enlaces).
   • El navbar baja --topbar-h; website.js publica el alto real de la barra
     (cambia al envolver en móvil), aquí sólo hay valores de arranque.
   • Escritorio: los enlaces quedan pegados al slogan (como se ve a ~1503px) y
     el buscador se va a la derecha; sin el botón Médicos la fila ya cabe.
   Se carga DESPUÉS de tablet-samsung-tabs10ultra.css: misma especificidad gana
   por orden, sin !important nuevos (Regla 13). No toca el hero (Regla 25).
   ============================================================================== */

:root {
    --topbar-h: 34px;
    /* Alto real del navbar: website.js lo publica (ResizeObserver). Estos valores
       son solo el arranque, medidos por rango, para evitar saltos antes del JS. */
    --nav-h: 57px;
    /* Opción B «Frescura de marca» (2026-10-10): colores del header */
    --hdr-tinta: #003B85;                 /* azul LAESH oscuro: textos y enlaces */
    --hdr-verde-osc: #2f6b00;             /* verde legible sobre fondos claros */
    --hdr-topbar-bg: linear-gradient(90deg, #003B85 0%, #002252 100%);
    --hdr-nav-bg: linear-gradient(90deg, #CCE7F5 0%, #DCEFF0 55%, #E6F4D7 100%);
}
@media (min-width: 1601px) { :root { --nav-h: 71px; } }
@media (min-width: 1920px) { :root { --nav-h: 100px; } }
@media (max-width: 1024px) { :root { --nav-h: 67px; } }
@media (max-width: 767px)  { :root { --nav-h: 94px; } }

/* ── Barra superior ───────────────────────────────────────────────────────── */
.topbar-laesh {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1051;
    display: flex;
    align-items: center;
    gap: 0.5rem 1.75rem;
    min-height: 34px;
    padding: 0.3rem calc(max(1.5rem, (100vw - (725px + 50vw)) / 2 + 1.5rem)) 0.3rem calc(max(1.25rem, (100vw - (725px + 50vw)) / 2 + 1.25rem));
    background: var(--hdr-topbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.25;
}
.topbar-laesh .tb-ico { width: 14px; height: 14px; flex-shrink: 0; color: #71CA11; }
.topbar-laesh__horario,
.topbar-laesh__contacto { display: flex; align-items: center; gap: 0.45rem 1.25rem; min-width: 0; }
.topbar-laesh__horario  { gap: 0.45rem; }
.topbar-laesh .tb-txt   { display: flex; flex-wrap: wrap; gap: 0.1rem 1.25rem; }
.topbar-laesh .tb-sem,
.topbar-laesh .tb-dom   { white-space: nowrap; font-weight: 700; }
.topbar-laesh .tb-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: inherit; text-decoration: none; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.topbar-laesh .tb-tel   { font-weight: 700; }
.topbar-laesh a.tb-link:hover,
.topbar-laesh a.tb-link:focus-visible { color: #A3C912; text-decoration: underline; text-underline-offset: 3px; }

.topbar-laesh__medicos {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.28rem 0.95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #71CA11 0%, #5aa80c 100%);
    color: #002252;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(113, 202, 17, 0.35);
    /* Solo transform y sombra: animar 'background' entre un degradado y otro valor
       quita la imagen al instante y anima el color desde transparente → destello claro. */
    transition: transform 0.2s, box-shadow 0.2s;
}
.topbar-laesh__medicos:hover,
.topbar-laesh__medicos:focus-visible {
    background-image: linear-gradient(135deg, #7bd615 0%, #61b50e 100%); /* mismo tipo: degradado → degradado, sin hueco */
    box-shadow: 0 3px 10px rgba(113, 202, 17, 0.45);
    transform: translateY(-1px);
}
.topbar-laesh__medicos .tb-ico { color: #002252; opacity: 1; }

/* ── Desplazamientos por la barra ─────────────────────────────────────────── */
.navbar-sticky { top: var(--topbar-h); }
/* 2026-10-10: el espaciador mide exactamente barra + navbar (antes 92 px fijos dejaban
   una franja vacía de ~35 px sobre el hero entre 1181 y 1919 px). */
.landing-nav-spacer { height: calc(var(--topbar-h) + var(--nav-h)); }
.section { scroll-margin-top: calc(var(--topbar-h) + var(--nav-h) + 18px); }
.scroll-sm-top { scroll-margin-top: calc(var(--topbar-h) + var(--nav-h) + 48px); }

/* ── Opción B «Frescura de marca»: navbar ──────────────────────────────────
   Degradado azul claro → verde claro, línea verde de 2 px (::after, no altera
   el alto), enlaces azul LAESH con realce verde. El estado con scroll vive en
   landing.css (.navbar-scrolled) y usa el mismo degradado translúcido. */
.navbar-sticky {
    background: var(--hdr-nav-bg);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.navbar-sticky::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: #71CA11; pointer-events: none;
}
.navbar-sticky .nav-links a { color: var(--hdr-tinta); }
.navbar-sticky .nav-links a::after { background: #71CA11; }
@media (hover: hover) and (pointer: fine) {
    .navbar-sticky .nav-links a:hover,
    .navbar-sticky .nav-links a.active { color: var(--hdr-verde-osc); background: rgba(113, 202, 17, 0.16); }
}
.nav-hamburger span { background: var(--hdr-tinta); }
@media (max-width: 767px) {
    /* La línea verde (::after) sustituye al borde azul de 2 px de landing.css */
    .navbar-sticky { border-bottom: 0; }
}

/* ── Escritorio / laptop: enlaces junto al slogan, buscador a la derecha ──── */
@media (min-width: 1280px) {
    .navbar-sticky .navbar-center-block { margin-right: 0; }
    .navbar-sticky .navbar-tagline { margin-right: 0; flex-shrink: 0; }
    .navbar-sticky .nav-links {
        flex: 1 1 auto;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
        margin-left: 1.75rem;
        margin-right: 0;
    }
    .navbar-sticky .nav-links a:not(.nav-item-multiline):not(.btn-nav-medicos),
    .navbar-sticky .nav-links a.nav-item-multiline { font-size: 1.02rem; padding: 0.38rem 0.5rem; }
    .navbar-sticky .nav-links .header-search-wrap--desktop { margin-left: auto; width: 220px; }
    .navbar-sticky .nav-links .header-search-wrap--desktop .header-search-box:focus-within { width: 100%; }
}
@media (min-width: 1601px) {
    .navbar-sticky .nav-links { gap: 1.25rem; }
    .navbar-sticky .nav-links .header-search-wrap--desktop { width: 260px; }
}
/* Laptops angostos: sin slogan (los enlaces se acercan al logo) */
@media (min-width: 1280px) and (max-width: 1459px) {
    .navbar-sticky .navbar-center-block { display: none; }
}

/* ── 1025–1279: menú hamburguesa (no cabe la fila completa) ───────────────── */
@media (min-width: 1025px) and (max-width: 1279px) {
    .nav-hamburger { display: flex; margin-left: auto; }
    .navbar-sticky > .nav-links { display: none; }
    .navbar-sticky > .nav-links.mobile-open {
        display: flex; flex-direction: column; align-items: flex-start;
        position: absolute; top: 100%; left: 0; right: 0;
        gap: 0.9rem; margin: 0; padding: 1rem 1.5rem;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }
    .navbar-sticky > .nav-links.mobile-open .header-search-wrap--desktop { margin-left: 0; }
}

/* ── 768–1279 (iPad, tablets, laptops angostas): buscador en el header ─────
   Fila: logo | slogan · buscador | hamburguesa. El bloque central crece y el
   buscador se alinea a la derecha, junto a la hamburguesa. */
@media (min-width: 768px) and (max-width: 1279px) {
    .navbar-sticky .navbar-center-block {
        flex: 1 1 auto; flex-direction: row; align-items: center;
        gap: 1rem; margin-right: 1rem; min-width: 0;
    }
    .navbar-sticky .header-search-wrap--mobile {
        display: block; flex: 0 1 280px; width: 280px; max-width: 280px;
        margin: 0 0 0 auto; align-self: center;
    }
    .navbar-sticky .header-search-wrap--mobile .header-search-box {
        height: 36px; padding: 0 4px 0 12px;
    }
    .navbar-sticky .header-search-wrap--mobile .header-search-box input.header-search-input,
    .navbar-sticky .header-search-wrap--mobile .header-search-box input.header-search-input::placeholder { font-size: 0.88rem; }
    .navbar-sticky .header-search-wrap--mobile .header-search-lupa { width: 16px; height: 16px; }
    .navbar-sticky .header-search-wrap--mobile .header-search-go { width: 28px; height: 28px; }
    .navbar-sticky .header-search-wrap--mobile .header-search-go svg { width: 14px; height: 14px; }
    .navbar-sticky .header-search-wrap--mobile .header-search-results { width: 360px; max-width: 92vw; }
}

/* ── Tablet / móvil ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .topbar-laesh { padding: 0.3rem 1.5rem; gap: 0.35rem 1.25rem; font-size: 0.78rem; }
    .topbar-laesh__medicos { font-size: 0.78rem; }
}
/* Horario: texto completo en tablet/escritorio, abreviado en móvil */
.topbar-laesh .tb-corto { display: none; }
/* Médicos dentro del menú hamburguesa: sólo móvil (en el resto vive en la barra) */
.navbar-sticky .nav-links a.nav-medicos-movil { display: none; }
.navbar-sticky .nav-links .nav-sep-movil { display: none; }

@media (max-width: 767px) {
    /* Dos columnas: horario (izq.) y teléfonos (der.), cada una en 2 líneas.
       Médicos sale de la barra y pasa al menú hamburguesa. */
    .topbar-laesh {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: space-between;
        align-items: center;
        gap: 0 0.75rem;
        padding: 0.3rem 0.85rem;
        font-size: 0.74rem;
        line-height: 1.35;
    }
    .topbar-laesh__medicos { display: none; }
    .topbar-laesh .tb-largo { display: none; }
    .topbar-laesh .tb-corto { display: inline; }
    .topbar-laesh__horario  { align-items: flex-start; gap: 0.4rem; }
    .topbar-laesh__horario .tb-ico { margin-top: 2px; }
    .topbar-laesh .tb-txt   { flex-direction: column; gap: 0; }
    .topbar-laesh__contacto { flex-direction: column; align-items: flex-end; gap: 0; }
    .topbar-laesh .tb-link  { gap: 0.35rem; }
    .topbar-laesh .tb-ico   { width: 12px; height: 12px; }
    /* Separador entre "Ubicación" y el acceso Médicos (menú hamburguesa) */
    .navbar-sticky > .nav-links.mobile-open .nav-sep-movil {
        display: block; align-self: center;
        width: 60%; height: 1px; margin: 0.35rem 0 0;
        background: linear-gradient(90deg, transparent, rgba(0, 82, 183, 0.55), transparent);
    }
    .navbar-sticky > .nav-links.mobile-open a.nav-medicos-movil {
        display: inline-flex; align-items: center; align-self: center; gap: 0.45rem;
        margin-top: 0.5rem; padding: 0.45rem 1.25rem;
        border-radius: 999px;
        background: linear-gradient(135deg, #0052B7 0%, #003B85 100%);
        color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none;
        box-shadow: 0 4px 12px rgba(0, 82, 183, 0.28);
    }
    .navbar-sticky > .nav-links.mobile-open a.nav-medicos-movil svg { stroke: currentColor; }
}
@media (max-width: 339px) {
    .topbar-laesh { font-size: 0.68rem; padding: 0.3rem 0.6rem; }
}

/* ── Buscador de estudios: realce (2026-10-10, propuestas 1 y 2) ──────────
   Lupa a la izquierda, botón ➜ circular a la derecha y halo verde de marca.
   El placeholder con ejemplos lo anima website.js (rotatePlaceholders). */
.navbar-sticky .header-search-box { gap: 0.4rem; }
.navbar-sticky .header-search-lupa { width: 17px; height: 17px; flex-shrink: 0; color: #0052B7; }
.navbar-sticky .header-search-go {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 50%;
    background: linear-gradient(135deg, #0052B7 0%, #003B85 100%);
    color: #fff; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 82, 183, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.navbar-sticky .header-search-go svg { width: 15px; height: 15px; }
.navbar-sticky .header-search-go:hover,
.navbar-sticky .header-search-go:focus-visible { transform: translateX(2px); box-shadow: 0 3px 10px rgba(0, 82, 183, 0.45); }
.navbar-sticky .header-search-clear { margin-left: 0; }

.navbar-sticky .header-search-wrap--desktop .header-search-box {
    height: 38px;
    padding: 0 4px 0 12px;
    background: #fff;
    border: 1.5px solid rgba(113, 202, 17, 0.75);
    box-shadow: 0 0 0 3px rgba(113, 202, 17, 0.14), 0 3px 12px rgba(0, 82, 183, 0.12);
}
.navbar-sticky .header-search-wrap--desktop .header-search-box:focus-within {
    border-color: #0052B7;
    box-shadow: 0 0 0 3px rgba(0, 82, 183, 0.18), 0 4px 14px rgba(0, 82, 183, 0.16);
}
.navbar-sticky .header-search-wrap--desktop .header-search-box input.header-search-input::placeholder {
    color: #475569;
}

/* Móvil: caja compacta (25px) → lupa y botón proporcionales */
.navbar-sticky .header-search-wrap--mobile .header-search-box {
    height: 30px;
    padding: 0 3px 0 9px;
    gap: 0.3rem;
    background: #fff;
    border: 1.5px solid rgba(113, 202, 17, 0.75);
    box-shadow: 0 0 0 2px rgba(113, 202, 17, 0.14), 0 2px 8px rgba(0, 82, 183, 0.12);
}
.navbar-sticky .header-search-wrap--mobile .header-search-box:focus-within {
    border-color: #0052B7;
    box-shadow: 0 0 0 3px rgba(0, 82, 183, 0.18);
}
.navbar-sticky .header-search-wrap--mobile .header-search-lupa { width: 14px; height: 14px; }
.navbar-sticky .header-search-wrap--mobile .header-search-go { width: 23px; height: 23px; }
.navbar-sticky .header-search-wrap--mobile .header-search-go svg { width: 12px; height: 12px; }

/* ── Resultados del buscador (2026-10-10, propuestas 3 y 4) ───────────────
   Coincidencia en negritas, tiempo de entrega realzado, clave en gris,
   "Ver detalle →", chips "Más buscados" y estado vacío con WhatsApp. */
.navbar-sticky .header-search-results { width: 340px; }
.navbar-sticky .header-search-item-nombre mark {
    background: none; color: #0052B7; font-weight: 800;
}
.navbar-sticky .header-search-item-meta { flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.navbar-sticky .header-search-item-entrega {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    background: #e6f0fb; color: #003B85;
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.navbar-sticky .header-search-item-entrega::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: #0052B7;
}
.navbar-sticky .header-search-item-entrega.is-hoy { background: #ecf8df; color: #3d7a06; }
.navbar-sticky .header-search-item-entrega.is-hoy::before { background: #71ca11; }
.navbar-sticky .header-search-item-clave {
    background: none; padding: 0;
    color: #64748b; font-weight: 600; font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}
.navbar-sticky .header-search-item-ver {
    margin-left: auto;
    color: #0052B7; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
    opacity: 0.75; transition: opacity 0.15s, transform 0.15s;
}
.navbar-sticky .header-search-item:hover .header-search-item-ver,
.navbar-sticky .header-search-item.is-selected .header-search-item-ver { opacity: 1; transform: translateX(2px); }

/* "Más buscados" */
.navbar-sticky .header-search-top-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 6px 2px 12px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #64748b;
}
.navbar-sticky .header-search-top-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    border: none; border-radius: 50%; background: transparent;
    color: #64748b; font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.navbar-sticky .header-search-top-close:hover,
.navbar-sticky .header-search-top-close:focus-visible { background: #eef2f7; color: #0f172a; }
/* Lista numerada a 2 columnas (orden por columna: 1–5 | 6–10), sin recuadros:
   número verde + nombre azul y divisores finos. Minimalista pero con realce. */
.navbar-sticky .header-search-results.is-top { width: 460px; max-width: 92vw; }
.navbar-sticky .header-search-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(var(--filas, 5), auto);
    grid-auto-flow: column;
    column-gap: 18px;
    padding: 0 14px 8px;
}
.navbar-sticky .header-search-item.header-search-chip {
    display: flex; flex-direction: row; align-items: baseline; gap: 8px;
    padding: 8px 2px;
    border: 0; border-bottom: 1px solid #e8eef5; border-radius: 0;
    background: none;
    color: var(--hdr-tinta); font-size: 0.8rem; font-weight: 600; line-height: 1.3;
    text-align: left; white-space: normal;
}
.navbar-sticky .header-search-item.header-search-chip.hst-fin { border-bottom: 0; }
.navbar-sticky .header-search-chip .hst-num {
    flex-shrink: 0; min-width: 1.2em;
    color: #5aa80c; font-size: 0.74rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.navbar-sticky .header-search-chip .hst-nom {
    text-decoration: underline; text-decoration-color: transparent;
    text-decoration-thickness: 2px; text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.navbar-sticky .header-search-item.header-search-chip:hover,
.navbar-sticky .header-search-item.header-search-chip.is-selected { background: none; color: var(--hdr-verde-osc); }
.navbar-sticky .header-search-chip:hover .hst-nom,
.navbar-sticky .header-search-chip.is-selected .hst-nom { text-decoration-color: #71CA11; }

/* Toque: respuesta inmediata (sin retraso de doble toque) y el scroll de la lista
   no arrastra la página de fondo. La selección es solo por 'click' (website.js). */
.navbar-sticky .header-search-item { touch-action: manipulation; }
.navbar-sticky .header-search-results { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Móvil: la ventana ocupa el ancho completo, pegada bajo el navbar.
   El wrap pasa a static → el bloque contenedor es el propio navbar (fixed). */
@media (max-width: 767px) {
    .navbar-sticky .header-search-wrap--mobile { position: static; }
    .navbar-sticky .header-search-wrap--mobile .header-search-results,
    .navbar-sticky .header-search-wrap--mobile .header-search-results.is-top {
        top: 100%; left: 0; right: 0;
        width: auto; max-width: none;
        max-height: calc(100vh - var(--topbar-h) - var(--nav-h) - 24px);
        max-height: calc(100dvh - var(--topbar-h) - var(--nav-h) - 24px);
        margin: 0; transform: none;
        border-radius: 0 0 14px 14px;
        border-left: 0; border-right: 0;
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
    }
    .navbar-sticky .header-search-chips { column-gap: 14px; padding: 0 12px 8px; }
    .navbar-sticky .header-search-item.header-search-chip { padding: 10px 2px; font-size: 0.82rem; }
    .navbar-sticky .header-search-wrap--mobile .header-search-item { padding: 10px 14px; }
    .navbar-sticky .header-search-wrap--mobile .header-search-item.header-search-chip { padding: 10px 2px; }
}

/* Sin coincidencias: mensaje + botón WhatsApp compacto (texto corto, ícono oficial).
   Selector reforzado (clase doble): en escritorio el buscador vive dentro de .nav-links
   y sus reglas de enlace (.navbar-sticky .nav-links a:not():not()) tienen especificidad 0,4,1. */
.navbar-sticky .header-search-empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 12px;
}
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px 5px 9px; border-radius: 999px;
    background: #fff; color: #128c4b;
    border: 1.5px solid #25d366;
    font-size: 0.76rem; font-weight: 700; line-height: 1.2; margin: 0;
    text-decoration: none; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa svg { width: 15px; height: 15px; flex-shrink: 0; color: #25d366; transition: color 0.15s; }
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa:hover,
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa:focus-visible { background: #25d366; color: #fff; }
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa:hover svg,
.navbar-sticky .header-search-results a.header-search-wa.header-search-wa:focus-visible svg { color: #fff; }
