/* ============================================================
   header.css — Nav central, dropdown HERRAMIENTAS y hamburguesa
   mobile del header centralizado. Trabaja en conjunto con las
   reglas de .landing-header que viven en landing.css (heredadas
   desde antes de la centralización).
   ============================================================ */

/* Wrapper que agrupa avatar/auth + hamburguesa en la derecha del
   header. En desktop la hamburguesa está oculta así que sólo se
   ve el grupo de auth; en mobile aparecen juntos. */
.header-derecha {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ============================================================
   NAV CENTRAL (DESKTOP)
   ============================================================ */
.nav-central {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.nav-item {
    position: relative;
}

/* Especificidad subida a propósito: hay un .nav-link preexistente en
   styles.css y app.css de otro uso (sidebar del dashboard viejo) que
   pinta crema sobre crema en este header. Acotando con .nav-central
   ancestro (0,2,0) vencemos a la regla suelta (0,1,0). */
.nav-central .nav-link {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
    cursor: pointer;
    padding: 0.5rem 0;
    letter-spacing: 0.04em;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* background-color: transparent es necesario para anular el
   accent-brand que la regla .nav-link:hover de styles.css pinta. */
.nav-central .nav-link:hover,
.nav-central .nav-link.activo {
    color: var(--accent-brand);
    background-color: transparent;
}

.nav-flecha {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-dropdown.abierto .nav-flecha {
    transform: rotate(180deg);
}

/* ============================================================
   DROPDOWN HERRAMIENTAS
   ============================================================ */
.nav-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-light);
    border: 2px solid var(--text-main);
    box-shadow: 4px 4px 0 0 var(--text-main);
    padding: 1.25rem 1.5rem;
    display: none;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 260px;
    z-index: 200;
}

.nav-dropdown.abierto .nav-menu {
    display: flex;
}

.nav-menu-item {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.3rem 0;
    border-bottom: 1px dashed transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nav-menu-item:hover {
    color: var(--accent-brand);
    border-bottom-color: var(--accent-brand);
}

.nav-menu-item-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nav-menu-item-disabled em {
    color: var(--accent-brand);
    font-style: normal;
    font-size: 0.7rem;
    margin-left: 0.4rem;
}

/* Sub-títulos de grupo dentro del dropdown (GESTIÓN DE PDF, etc.).
   Mismo lenguaje visual que .overlay-seccion-titulo del mobile. */
.nav-menu-grupo-titulo {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-brand);
    letter-spacing: 0.08em;
    /* Compactar el espacio que el `gap: 0.85rem` del flex deja arriba */
    margin-bottom: -0.25rem;
}

/* Separador entre grupos: línea horizontal punteada para no romper la
   estética brutalista (los bordes duros viven en las cards, no acá). */
.nav-menu-separador {
    height: 0;
    border-top: 1px dashed var(--ui-border);
    margin: 0.25rem 0;
}

/* ============================================================
   HAMBURGUESA MOBILE
   ============================================================ */
.hamburguesa {
    display: none;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.hamburguesa span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--text-main);
}

/* ============================================================
   OVERLAY MOBILE (panel desplegable a pantalla completa)
   ============================================================ */
.overlay-mobile {
    display: none;
    position: fixed;
    inset: 0;
    background-color: var(--bg-light);
    z-index: 300;
    padding: 5.5rem 2rem 2.5rem;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
}

.overlay-mobile.abierto {
    display: flex;
}

.overlay-cerrar {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: 2px solid var(--text-main);
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1;
}

.overlay-seccion-titulo {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-brand);
    letter-spacing: 0.06em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.overlay-seccion-titulo:first-child,
.overlay-seccion-titulo:first-of-type {
    margin-top: 0;
}

.overlay-link {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--text-main);
    padding: 0.85rem 0;
    border-bottom: 1px dashed var(--ui-border);
    display: block;
}

.overlay-link:hover {
    color: var(--accent-brand);
}

.overlay-link-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.overlay-link-disabled em {
    color: var(--accent-brand);
    font-style: normal;
    font-size: 0.78rem;
    margin-left: 0.4rem;
}

/* ============================================================
   BREAKPOINT MOBILE (< 900px)
   El nav central se oculta y aparece la hamburguesa. El grupo
   de auth (avatar o botones login) se mantiene visible.
   Override del flex-direction: column heredado de landing.css.
   ============================================================ */
@media (max-width: 900px) {
    .landing-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 1rem 1.5rem !important;
    }

    .nav-central {
        display: none;
    }

    .hamburguesa {
        display: flex;
    }

    .header-acciones {
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important;
    }
}

/* Breakpoint ultra-mobile: reducir padding del overlay */
@media (max-width: 480px) {
    .landing-header {
        padding: 0.85rem 1rem !important;
    }
    .overlay-mobile {
        padding: 5rem 1.5rem 2rem;
    }
    .overlay-link {
        font-size: 1rem;
    }
}

/* En mobile el texto "HOLA, NOMBRE | X DISPAROS ▼" no entra al lado
   del logo y la hamburguesa. Lo ocultamos y dejamos solo el avatar
   circular como botón. El nombre, plan y disparos siguen accesibles
   dentro del dropdown personal que se abre al tocarlo. */
@media (max-width: 600px) {
    .header-trigger-texto {
        display: none;
    }
}

/* ============================================================
   CAMPANITA DE AVISOS (trabajos en segundo plano)
   Vive en .header-derecha, a la izquierda del avatar/auth. La
   monta js/avisos-trabajos.js. Solo se ve si hay trabajos vigentes
   (el JS le pone/saca .oculto). Estilo neo-brutalista del proyecto.
   ============================================================ */
.campanita {
    position: relative;
    display: flex;
    align-items: center;
}

.campanita__boton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-main);
    border: 2px solid var(--text-main);
    box-shadow: 4px 4px 0px 0px var(--text-main);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.campanita__boton:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px var(--text-main);
}
.campanita__boton:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0px 0px var(--text-main);
}

/* Punto/numerito rojo con la cantidad de avisos sin ver. */
.campanita__badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-brand);
    color: #fff;
    border: 2px solid var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

/* Panel desplegable con la lista de trabajos. */
.campanita__panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-width: 86vw;
    background-color: var(--bg-light);
    border: 2px solid var(--text-main);
    box-shadow: 4px 4px 0px 0px var(--text-main);
    z-index: 120;
    text-align: left;
}

.campanita__panel-titulo {
    padding: 0.9rem 1rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-main);
    border-bottom: 2px solid var(--text-main);
}

.campanita__lista {
    max-height: 60vh;
    overflow-y: auto;
}

.campanita__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(26, 28, 30, 0.18);
}
.campanita__item:last-child { border-bottom: none; }

.campanita__item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.campanita__item-herr {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent-brand);
}
.campanita__item-titulo {
    font-size: 0.85rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campanita__item-accion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.campanita__estado {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
}
.campanita__estado--proc { color: var(--text-main); opacity: 0.6; }
.campanita__estado--error { color: var(--accent-brand); }

.campanita__descargar {
    padding: 0.4rem 0.7rem;
    background-color: var(--accent-brand);
    color: #fff;
    border: 2px solid var(--text-main);
    box-shadow: 3px 3px 0px 0px var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.campanita__descargar:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px 0px var(--text-main);
}

.campanita__descartar {
    width: 26px;
    height: 26px;
    padding: 0;
    background: none;
    border: 1px solid rgba(26, 28, 30, 0.3);
    color: var(--text-main);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.1s ease;
}
.campanita__descartar:hover { opacity: 1; border-color: var(--text-main); }

/* En mobile la campanita queda igual de visible; el panel se ancla a la
   derecha y se limita con max-width para no desbordar la pantalla. */
@media (max-width: 600px) {
    .campanita__boton { width: 38px; height: 38px; }
}
