/* ==========================================================================
   DEFINICIONES GLOBALES
   ========================================================================== */

/* =====================
HEADER
===================== */
* {
    margin: 0px;
    padding: 0px;
}

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

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
}

.login-menu {
    right: 0;
    left: auto;
    transform: none;
}

.nav {
    height: 122px;
    max-width: 100%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 150px;
    gap: 20px;
    position: relative;
}

.nav a:hover:not(.btn-login) {
    font-weight: 700;
    color: #3a99c8;
}

.nav-left,
.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    max-width: 40%;
}

.nav a {
    font-size: 20px;
    font-weight: 500;
    color: #002c42;
    text-decoration: none;
    font-family: var(--primaria, Kufam);
    font-style: normal;
    font-variant: small-caps;
    white-space: nowrap;
}

.logo {
    padding: 0px 50px;
    flex: none;
    display: flex;
    justify-content: center;
    min-width: 20%;
}

.logo img {
    width: 82px;
    height: auto;
    object-fit: contain;
}

.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.burger span {
    display: block;
    width: 40px;
    height: 4px;
    background: #002c42;
    margin: 8px 0;
}

/* =====================
   MENU MOVIL (DESPLEGABLE)
===================== */

.mobile-menu {
    display: none;
}

/*==========================
DROPDOWNS
==========================*/

.dropdown {
    position: relative;
}

.dropdown-toggle {
    font-family: kufam;
    display: block;
}

.dropdown-menu {
    font-family: kufam;
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
}

.dropdown-menu input {
    font-family: "kufam";
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.dropdown.active .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    display: flex;
}

.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.schools-menu,
.groups-menu {
    width: 340px;
    background: #0c6b95;
    border-radius: 8px;
    padding: 20px 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.schools-menu {
    left: 120px;
}

.groups-menu {
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-menu a {
    visibility: visible;
}

.schools-menu a,
.groups-menu a {
    color: #fff;
    text-align: center;
    padding: 13px 20px;
    font-size: 19px;
    font-weight: 400;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: normal;
    line-height: 1.25;
    text-transform: uppercase;
    display: block;
}

.schools-menu a:hover {
    background: rgba(255, 255, 255, .08);
    color: #8fd9ff;
}

.dropdown-menu.login-menu {
    left: -40px;
    width: 300px;
    background: #0c6b95;
    border-radius: 8px;
    padding: 25px;
}

.dropdown:hover .dropdown-menu.login-menu {
    opacity: 1;
    visibility: visible;
    display: unset;
}

.login-menu h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.2;
    font-size: 20px;
}

.login-menu input {
    FONT-FAMILY: 'Kufam';
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 18px;
    font-size: 18px;
}

.btn-login,
.nav a.btn-login {
    font-family: 'Kufam', sans-serif;
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #8fd9ff, #bdeaff);
    color: #003e61;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-variant: normal;
    box-sizing: border-box;
}

.btn-login:hover,
.nav a.btn-login:hover {
    color: #003e61;
    font-weight: 700;
    filter: brightness(1.04);
}

.dropdown.open .dropdown-menu {
    display: flex;
}


/* ==========================================================================
   MEDIA QUERIES (ORGANIZADAS DE MAYOR A MENOR RESOLUCIÓN)
   ========================================================================== */

/* --------------------------------------------------------------------------
   MEDIA QUERY: max-width: 1600px
   -------------------------------------------------------------------------- */
@media (max-width: 1600px) {
    .groups-menu {
        width: 300px;
    }

    .btn-login {
        font-size: 22px;
    }

    .nav-left,
    .nav-right {
        max-width: 40%;
    }

    .logo {
        padding: 0px 30px;
        min-width: 20%;
    }

    .nav {
        padding: 20px 80px;
        gap: 0px;
        position: relative;
    }
}

/* --------------------------------------------------------------------------
   MEDIA QUERY: max-width: 992px
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .nav-left,
    .nav-right {
        display: none;
    }

    .nav {
        justify-content: space-between;
        padding: 20px 30px;
        height: auto;
        min-height: 85px;
    }

    .logo {
        padding: 0px 10px;
        flex: none;
    }

    .burger {
        position: relative;
        z-index: 120;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 46px;
        height: 46px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 6px;
        z-index: 110;
        border-radius: 8px;
        transition: background 0.25s ease;
    }

    .burger:hover {
        background: rgba(0, 44, 66, 0.08);
    }

    .burger span {
        display: block;
        width: 30px;
        height: 3px;
        background: #002c42;
        margin: 3.5px 0;
        border-radius: 2px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.2s ease,
            background 0.3s ease;
    }

    /* Animación del icono hamburguesa a X */
    body.menu-open .burger span,
    .header.menu-open .burger span {
        background: #ffffff !important;
    }

    body.menu-open .burger span:nth-child(1),
    .header.menu-open .burger span:nth-child(1) {
        transform: translateY(10px) rotate(45deg) !important;
    }

    body.menu-open .burger span:nth-child(2),
    .header.menu-open .burger span:nth-child(2) {
        opacity: 0 !important;
        transform: scaleX(0) !important;
    }

    body.menu-open .burger span:nth-child(3),
    .header.menu-open .burger span:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg) !important;
    }

    /* Despliegue del menú móvil centrado en pantalla horizontal y verticalmente */
    .mobile-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 50%;
        left: 50%;
        border-radius: 8px;
        width: 85%;
        max-width: 360px;

        background: #0c6b95;
        padding: 20px 16px;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        z-index: 105;
    }

    body.menu-open .mobile-menu,
    .header.menu-open .mobile-menu {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    .mobile-menu a {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        padding: 16px 20px;
        color: #FFFFFF;
        font-family: var(--primaria, 'Kufam', sans-serif);
        font-size: 18px;
        font-weight: 600;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        border-radius: 8px;

    }

    .mobile-menu a:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-menu a:hover,
    .mobile-menu a:active {
        background: rgba(255, 255, 255, 0.15);
        color: #8fd9ff;
        transform: scale(1.02);
    }

    .mobile-menu a[href*="mi-viaje"],
    .mobile-menu a:last-child {
        color: #8fd9ff;
        font-weight: 700;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-top: 15px;
    }
}

/* --------------------------------------------------------------------------
   MEDIA QUERY: max-width: 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .logo img {
        width: 50px;
    }
}

/* Gana a comun.css: el panel solo aparece al pasar el ratón o al abrirlo. */
.header .schools-menu,
.header .groups-menu {
    display: none;
}

.header .dropdown:hover > .schools-menu,
.header .dropdown:hover > .groups-menu,
.header .dropdown.open > .schools-menu,
.header .dropdown.open > .groups-menu,
.header .dropdown.active > .schools-menu,
.header .dropdown.active > .groups-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.header .groups-menu a:hover {
    background: rgba(255, 255, 255, .08);
    color: #8fd9ff;
}
