/* NAVBAR STYLES */

/* ══ Botón lupa — búsqueda global ══════════════════════════════════ */
.btn-busqueda-navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.375rem;
    color: #4b5563;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}
.btn-busqueda-navbar:hover {
    color: #E2001A;
    background-color: #f3f4f6;
}
.btn-busqueda-navbar .material-symbols-outlined {
    font-size: 1.35rem;
}

/* ══ Modal overlay de búsqueda global ══════════════════════════════ */
.busqueda-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6rem;
}
.busqueda-overlay.hidden {
    display: none;
}
.busqueda-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
}
.busqueda-caja {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 1rem;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: busqueda-aparecer 0.18s ease;
}
@keyframes busqueda-aparecer {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1); }
}

/* Input principal */
.busqueda-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.busqueda-icono {
    font-size: 1.5rem;
    color: #9ca3af;
    flex-shrink: 0;
}
.busqueda-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.15rem;
    font-weight: 400;
    color: #111827;
    background: transparent;
    font-family: inherit;
}
.busqueda-input::placeholder { color: #9ca3af; }
.busqueda-cerrar-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.busqueda-cerrar-btn:hover { color: #E2001A; background: #fef2f2; }
.busqueda-cerrar-btn .material-symbols-outlined { font-size: 1rem; }

/* Resultados */
.busqueda-resultados {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.busqueda-resultados.hidden { display: none; }
.busqueda-seccion-titulo {
    padding: 0.4rem 1.25rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 0;
}
.busqueda-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    text-decoration: none;
    color: #374151;
    transition: background 0.12s;
    cursor: pointer;
}
.busqueda-item:hover,
.busqueda-item--activo {
    background: #fef2f2;
    color: #E2001A;
}
.busqueda-item--activo .busqueda-item-flecha { opacity: 1; }
.busqueda-item-icono {
    font-size: 1.1rem;
    color: #6b7280;
    flex-shrink: 0;
}
.busqueda-item:hover .busqueda-item-icono,
.busqueda-item--activo .busqueda-item-icono { color: #E2001A; }
.busqueda-item-texto { flex: 1; min-width: 0; }
.busqueda-item-titulo {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.busqueda-item-sub {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.busqueda-item--activo .busqueda-item-sub { color: #f87171; }
.busqueda-item-flecha {
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.12s;
    flex-shrink: 0;
}
.busqueda-item:hover .busqueda-item-flecha { opacity: 1; }
.busqueda-sin-resultados {
    padding: 1.5rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
}
.busqueda-cargando {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}
.busqueda-cargando .material-symbols-outlined { font-size: 1.1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin-suave { animation: spin 0.8s linear infinite; }

/* Footer de atajos de teclado */
.busqueda-footer {
    display: flex;
    gap: 1.25rem;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.7rem;
    color: #9ca3af;
}
.busqueda-footer kbd {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.65rem;
    font-family: monospace;
    color: #6b7280;
}

/* Responsive: ocultar footer de atajos en móvil */
@media (max-width: 767px) {
    .busqueda-overlay { padding-top: 3rem; }
    .busqueda-footer  { display: none; }
}

nav.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: -1px 4px 15px 0px rgba(0,0,0,0.5);
    -webkit-box-shadow: -1px 4px 15px 0px rgba(0,0,0,0.5);
    -moz-box-shadow: -1px 4px 15px 0px rgba(0,0,0,0.5);
}

.navbar-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

@media (max-width: 767px) {
    .navbar-container {
        padding: 0 1rem;
    }
}

.navbar-logo {
    flex-shrink: 0;
}

.navbar-logo img {
    height: 2rem;
    width: auto;
}

/* Desktop Menu */
.navbar-menu-desktop {
    display: none;
    gap: 1.25rem;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
}

@media (min-width: 768px) {
    .navbar-menu-desktop {
        display: flex;
    }
}

.navbar-menu-desktop a,
.navbar-menu-desktop button {
    color: #4b5563;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.navbar-menu-desktop a:hover,
.navbar-menu-desktop button:hover {
    color: #E2001A;
    background-color: #f3f4f6;
}

.navbar-menu-desktop a:hover .nav-icon,
.navbar-menu-desktop button:hover .nav-icon {
    filter: invert(13%) sepia(96%) saturate(5577%) hue-rotate(349deg) brightness(91%) contrast(103%);
}

.navbar-menu-desktop .theme-toggle {
    padding: 0.25rem;
}

.navbar-menu-desktop .theme-toggle:hover {
    background-color: #f3f4f6;
}

/* Mobile Menu Button */
.navbar-toggle-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.navbar-toggle-mobile:hover {
    background-color: #f3f4f6;
}

@media (min-width: 768px) {
    .navbar-toggle-mobile {
        display: none;
    }
}

.navbar-toggle-mobile .material-symbols-outlined {
    font-size: 1.5rem;
    color: #4b5563;
}

/* Mobile Menu */
.navbar-menu-mobile {
    display: none;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.navbar-menu-mobile.active {
    display: block;
}

@media (min-width: 768px) {
    .navbar-menu-mobile {
        display: none !important;
    }
}

/* ---- Nav links con ícono SVG ---- */
.navbar-menu-desktop .nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ---- Botón acción: Acceder / Cerrar Sesión ---- */
.navbar-menu-desktop .btn-navbar-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #dc2626;
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.navbar-menu-desktop .btn-navbar-action:hover {
    background-color: #b91c1c;
    color: white;
}

.btn-navbar-action .material-symbols-outlined,
.btn-navbar-action-mobile .material-symbols-outlined {
    font-size: 1.125rem;
}

/* ---- Vista pública móvil: botón Acceder directo ---- */
.navbar-mobile-acceder {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background-color: #dc2626;
    color: white;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
    margin-left: 0.75rem;
}

.navbar-mobile-acceder .material-symbols-outlined {
    font-size: 1rem;
}

.navbar-mobile-acceder:hover {
    background-color: #b91c1c;
    color: white;
}

@media (min-width: 768px) {
    .navbar-mobile-acceder {
        display: none;
    }
}

/* ---- Mobile Menu: links con ícono ---- */
.navbar-menu-mobile-content {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.25rem;
}

.nav-link-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link-mobile:hover {
    color: #ffffff;
    background-color: #E2001A;
}

.nav-link-mobile:hover .nav-icon {
    filter: brightness(0) invert(1);
}

.btn-navbar-action-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    margin-top: 0.75rem;
    background-color: #dc2626;
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-navbar-action-mobile:hover {
    background-color: #b91c1c;
}

.navbar-menu-mobile-content a:hover .nav-icon,
.navbar-menu-mobile-content button:hover .nav-icon {
    filter: brightness(0) invert(1);
}

/* tabla-body movido a style.css */
