.site-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;

    z-index: 5000;

    font-family: Poppins, "Segoe UI", sans-serif;

    background: transparent;
    border-bottom: 1px solid transparent;

    transition:
            background-color 0.3s ease,
            box-shadow 0.3s ease,
            border-color 0.3s ease;
}

.site-header.header-scroll {
    background: #ffffff;
    border-bottom-color: #e5e7eb;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

/* HEADER TRANSPARENTE */
.site-header:not(.header-scroll) .brand-texto,
.site-header:not(.header-scroll) .main-nav a,
.site-header:not(.header-scroll) .header-user,
.site-header:not(.header-scroll) .header-user > a,
.site-header:not(.header-scroll) .header-login-link,
.site-header:not(.header-scroll) .header-usuario-boton {
    color: #ffffff;
}

.site-header:not(.header-scroll) .header-usuario-icono {
    background: rgba(255, 255, 255, 0.18);
}

.site-header:not(.header-scroll) .header-usuario-icono svg {
    stroke: #ffffff;
}

.site-header:not(.header-scroll) .menu-hamburguesa span {
    background: #ffffff;
}

body.pagina-con-header-fijo {
    padding-top: 103px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-header-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #084298;
    font-size: 22px;
    font-weight: 800;
}

.brand-texto {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    font-family: "Libre Baskerville", serif;
    color: #084298;
    line-height: 1;
}

.brand-texto span:first-child {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.brand-texto span:last-child {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0;
    margin-top: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.main-nav a {
    text-decoration: none;
    color: #084298;
    font-size: 16px;
    font-weight: 600;
}

.main-nav a:hover {
    color: #0d6efd;
}

/* ZONA DE USUARIO */

.header-user {
    display: flex;
    align-items: center;

    color: #084298;

    font-size: 16px;
    font-weight: 600;
}

.header-user > a {
    display: flex;
    align-items: center;

    gap: 8px;

    text-decoration: none;

    color: #084298;
}

.header-user > a:hover {
    color: #0d6efd;
}


/*USUARIO LOGUEADO - DROPDOWN*/

.header-usuario-dropdown {
    position: relative;

    display: flex;
    align-items: center;
}

.header-usuario-boton {
    display: flex;
    align-items: center;

    gap: 7px;

    padding: 5px 7px;

    border: none;
    border-radius: 10px;

    background: transparent;

    color: #084298;

    font-family: inherit;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;
}

.header-usuario-boton:hover {
    background: #f3f6fb;
}


/* Icono redondo */

.header-usuario-icono {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #e7f0ff;
}

.header-usuario-icono svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: #0b4fc4;
    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-login-link {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 5px 7px;

    color: #084298;
    text-decoration: none;

    font-size: 15px;
    font-weight: 700;

    border-radius: 10px;
}

.header-login-link:hover {
    background: #f3f6fb;
    color: #0d6efd;
}


/* Nombre */

.header-usuario-nombre {
    white-space: nowrap;
}


/* Flecha */

.header-flecha {
    width: 15px;
    height: 15px;

    fill: none;

    stroke: currentColor;
    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform .2s ease;
}

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


/*MENU DESPLEGABLE*/

.header-dropdown-menu {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 210px;

    padding: 8px;

    background: white;

    border: 1px solid #dce4ef;
    border-radius: 12px;

    box-shadow:
            0 12px 30px rgba(11, 42, 102, .14);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-6px);

    pointer-events: none;

    transition:
            opacity .18s ease,
            visibility .18s ease,
            transform .18s ease;

    z-index: 5000;
}

.header-usuario-dropdown.abierto .header-dropdown-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
}


/* Items */

.header-dropdown-item {
    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 11px 12px;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #163b70;

    text-decoration: none;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.header-dropdown-item:hover {
    background: #f2f6fc;
    border-radius: 8px;
}

.header-dropdown-item svg {
    width: 18px;
    height: 18px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;

    flex-shrink: 0;
}


/* Separador */

.header-dropdown-separador {
    height: 1px;

    margin: 6px 4px;

    background: #e4e9f0;
}


/* Logout */

.header-dropdown-logout-form {
    margin: 0;
    width: 100%;
}

.header-dropdown-salir {
    color: #d62f2f;
}

.header-dropdown-salir:hover {
    background: #fff0f0;
}

/*MENÚ HAMBURGUESA*/

.menu-hamburguesa {
    display: none;

    width: 44px;
    height: 44px;

    padding: 8px;

    border: none;
    background: transparent;

    cursor: pointer;

    z-index: 1200;
}

.menu-hamburguesa span {
    display: block;

    width: 26px;
    height: 3px;

    margin: 5px auto;

    background: #0b3d91;

    border-radius: 3px;

    transition: transform 0.25s ease,
    opacity 0.25s ease,
    background 0.25s ease;
}


/* Desktop */
.menu-responsive {
    display: flex;
    align-items: center;

    gap: 30px;
}


/* Logo interno del menú oculto en PC */
.menu-logo-mobile {
    display: none;
}


/* Íconos ocultos en PC */
.main-nav a svg {
    display: none;
}

.header-dropdown-logout-form {
    margin: 0;
}

.header-dropdown-logout-form button {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/*RESPONSIVE*/

@media (max-width: 700px) {

    .header-container {
        position: relative;

        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;

        padding: 12px 18px;

        box-sizing: border-box;
    }

    /* Header mobile: logo izquierda, texto centrado, hamburguesa derecha */

    .brand {
        position: static;
        padding: 0;
    }

    .logo-header-img {
        width: 70px;
        height: 70px;
        position: relative;
        z-index: 2;
    }

    .brand-texto {
        position: absolute;

        left: 50%;
        top: 50%;

        transform: translate(-50%, -50%);

        width: max-content;

        align-items: center;
        text-align: center;

        z-index: 1;
    }

    .brand-texto span:first-child {
        font-size: 14px;
    }

    .brand-texto span:last-child {
        font-size: 30px;
    }

    /* Hamburguesa */
    .menu-hamburguesa {
        display: block;
        flex-shrink: 0;
    }

    /* Cuando el menú se abre, el mismo botón queda encima */
    .menu-hamburguesa.activo {
        display: block;
        position: fixed;

        top: 18px;
        right: 18px;

        z-index: 10000;
    }

    .menu-hamburguesa.activo span {
        background: #ffffff;
    }

    .menu-hamburguesa.activo span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-hamburguesa.activo span:nth-child(2) {
        opacity: 0;
    }

    .menu-hamburguesa.activo span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Menú pantalla completa */
    .menu-responsive {
        position: fixed;

        top: 0;
        left: -100%;

        width: 100%;
        height: 100dvh;

        box-sizing: border-box;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 20px;

        padding: 24px 22px;

        background: #06172d;

        box-shadow: 8px 0 25px rgba(0, 0, 0, 0.30);

        z-index: 9999;

        transition: left 0.3s ease;

        overflow-y: auto;
    }


    /* Menú abierto */
    .menu-responsive.activo {
        left: 0;
    }


    /* Logo + botón cerrar */
    .menu-logo-mobile {
        display: flex;
        align-items: center;

        width: 100%;

        box-sizing: border-box;

        gap: 10px;

        margin-bottom: 12px;
    }


    .logo-menu-mobile {
        width: 58px;
        height: 58px;

        object-fit: contain;

        flex-shrink: 0;
    }


    .brand-texto-menu {
        display: flex;
        flex-direction: column;

        min-width: 0;

        font-family: "Libre Baskerville", serif;

        color: white;

        line-height: 1;
    }


    .brand-texto-menu span:first-child {
        font-size: 13px;
        font-weight: 700;

        letter-spacing: 1px;

        text-transform: uppercase;
    }


    .brand-texto-menu span:last-child {
        margin-top: 3px;

        font-size: 25px;
        font-weight: 700;
    }


    /* Navegación */
    .main-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;

        gap: 0;
    }


    .main-nav a {
        display: flex;
        align-items: center;

        gap: 14px;

        width: 100%;

        padding: 15px 4px;

        color: white;

        font-size: 17px;
        font-weight: 600;

        text-decoration: none;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }


    /* Íconos celestes */
    .main-nav a svg,
    .header-user > a svg {
        display: block;

        width: 21px;
        height: 21px;

        fill: none;

        stroke: #63c7f5;
        stroke-width: 2;

        stroke-linecap: round;
        stroke-linejoin: round;

        flex-shrink: 0;
    }


    .main-nav a:hover {
        color: #63c7f5;
    }


    /* Usuario */
    .header-user {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;

        gap: 0;

        padding-top: 0;
    }


    .header-user a {
        display: flex;
        align-items: center;

        gap: 14px;

        width: 100%;

        padding: 15px 4px;

        color: white;

        text-decoration: none;

        font-size: 17px;
        font-weight: 600;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }


    .header-saludo,
    .link-button {
        color: white;
    }


    .logout-form {
        width: 100%;
        margin: 0;
    }


    .link-button {
        width: 100%;

        padding: 15px 4px;

        text-align: left;

        background: transparent;

        border: none;

        color: white;

        font-size: 17px;
        font-weight: 600;

        cursor: pointer;
    }
}

@media (max-width: 700px) {

/*USUARIO EN MENU MOBILE*/

.header-usuario-dropdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}


/* El botón deja de parecer un dropdown */

.header-usuario-boton {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 14px 4px;

    background: transparent;

    color: white;

    border-radius: 0;

    cursor: default;
}


/* Hola, nombre */

.header-usuario-nombre {
    color: #63c7f5;

    font-size: 17px;
    font-weight: 700;
}


/* Ocultamos icono y flecha en mobile */
.header-usuario-boton .header-usuario-icono,
.header-usuario-boton .header-flecha {
   display: none;
}


/* En mobile el menú de usuario SIEMPRE visible */

.header-dropdown-menu {
    position: static;

    display: block !important;

    width: 100%;

    margin: 0;
    padding: 0;

    background: transparent;

    border: none;
    border-radius: 0;

    overflow: hidden;

    box-shadow: none;

    opacity: 1 !important;
    visibility: visible !important;

    transform: none !important;

    pointer-events: auto !important;
}


/* No necesitamos separador */

.header-dropdown-separador {
    display: none;
}


/* Cerrar sesión */

.header-dropdown-logout-form {
    width: 100%;
    margin: 0;
}

.header-dropdown-salir {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 14px 4px;

    background: transparent;

    border: none;
    border-top: 1px solid rgba(255, 255, 255, .08);

    color: white;

    text-align: left;

    font-size: 17px;
    font-weight: 600;

    cursor: pointer;
}

.header-dropdown-salir:hover {
    background: rgba(255,255,255,.05);
    color: #63c7f5;
}

    /* Mi perfil dentro del menú mobile */

    .header-dropdown-menu .header-dropdown-item {
        width: 100%;

        display: flex;
        align-items: center;

        gap: 14px;

        padding: 15px 4px;

        margin: 0;

        background: transparent;

        border: none;
        border-radius: 0;

        color: white;

        font-size: 17px;
        font-weight: 600;

        text-decoration: none;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-dropdown-menu .header-dropdown-item:hover {
        background: transparent;
        color: #63c7f5;
    }

    .header-dropdown-menu .header-dropdown-item svg {
        width: 21px;
        height: 21px;

        display: block;

        fill: none;

        stroke: #63c7f5;
        stroke-width: 2;

        stroke-linecap: round;
        stroke-linejoin: round;

        flex-shrink: 0;
    }


    /* Cerrar sesión */

    .header-dropdown-menu .header-dropdown-salir {
        color: white;

        border-bottom: none;
    }

    .header-dropdown-menu .header-dropdown-salir:hover {
        color: #63c7f5;
    }
}

@media (max-width: 700px) {
    body.pagina-con-header-fijo {
        padding-top: 95px;
    }
}


@media (max-width: 700px) {

    .header-user .header-login-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;

        width: 100%;

        gap: 14px;

        padding: 15px 4px;

        background: transparent !important;

        color: white !important;

        border: none;
        border-radius: 0;

        box-shadow: none;

        font-size: 17px;
        font-weight: 600;

        text-decoration: none;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-user .header-login-link:hover {
        background: transparent !important;
        color: #63c7f5 !important;
    }

    .header-user .header-login-link .header-usuario-icono {
        display: flex;

        width: 21px;
        height: 21px;

        background: transparent;
        border-radius: 0;

        flex-shrink: 0;
    }

    .header-user .header-login-link .header-usuario-icono svg {
        width: 21px;
        height: 21px;

        stroke: #63c7f5;
    }
}