/* =========================================================
   NAVBAR.CSS

   Barra de navegación principal
========================================================= */


/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, .96);

    border-bottom: 1px solid #edf2f7;

    backdrop-filter: blur(1rem);
}


/* =========================================================
   CONTENEDOR
========================================================= */

.navbar__container {

    width: min(92%, 95rem);

    min-height: clamp(4.2rem, 7vw, 5.2rem);

    margin-inline: auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 2rem;

}


/* =========================================================
   LOGO
========================================================= */

.navbar__logo {

    flex-shrink: 0;

    display: flex;

    align-items: center;

    text-decoration: none;
}

.navbar__logo img {

    display: block;

    width: clamp(7rem, 7vw, 9.5rem);

    height: auto;

    object-fit: contain;
}


/* =========================================================
   NAVEGACIÓN DESKTOP
========================================================= */

.navbar__nav {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: clamp(1rem, 2.2vw, 2rem);

    margin-inline: auto;
}


.navbar__link {

    position: relative;

    padding-block: .5rem;

    color: #173a70;

    font-size: clamp(.75rem, 1vw, .88rem);

    font-weight: 500;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color .2s ease;
}


/* Línea inferior */

.navbar__link::after {

    content: "";

    position: absolute;

    left: 50%;

    bottom: 0;

    width: 0;

    height: 2px;

    border-radius: 100px;

    background: #087fe8;

    transform: translateX(-50%);

    transition:
        width .25s ease;
}


.navbar__link:hover {

    color: #0875cf;
}


.navbar__link:hover::after,
.navbar__link.is-active::after {

    width: 70%;
}


.navbar__link.is-active {

    color: #0875cf;

    font-weight: 650;
}


/* =========================================================
   ACCIONES
========================================================= */

.navbar__actions {

    display: flex;

    align-items: center;

    gap: clamp(.6rem, 1.2vw, 1rem);

    flex-shrink: 0;
}


/* =========================================================
   INICIAR SESIÓN
========================================================= */

.navbar__login {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 2.5rem;

    padding-inline: .5rem;

    color: #17417b;

    font-size: clamp(.72rem, 1vw, .85rem);

    font-weight: 600;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color .2s ease;
}


.navbar__login:hover {

    color: #087fe8;
}


/* =========================================================
   CTA
========================================================= */

.navbar__cta {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 2.55rem;

    padding-inline:
        clamp(.9rem, 1.5vw, 1.25rem);

    border-radius: .45rem;

    background: #087fe8;

    color: #ffffff;

    font-size: clamp(.68rem, 1vw, .82rem);

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    box-shadow:
        0 .35rem .9rem rgba(8, 127, 232, .16);

    transition:
        background .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


.navbar__cta:hover {

    background: #066ecb;

    transform: translateY(-1px);

    box-shadow:
        0 .5rem 1.1rem rgba(8, 127, 232, .23);
}


/* =========================================================
   BOTÓN HAMBURGUESA
========================================================= */

.navbar__toggle {

    display: none;

    width: 2.7rem;

    aspect-ratio: 1;

    padding: .55rem;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: .28rem;

    border: 0;

    border-radius: .5rem;

    background: #f2f7fc;

    cursor: pointer;
}


.navbar__toggle span {

    display: block;

    width: 1.25rem;

    height: 2px;

    border-radius: 10px;

    background: #123b76;

    transition:
        transform .25s ease,
        opacity .2s ease;
}


/* =========================================================
   MENÚ MÓVIL
========================================================= */

.navbar__mobile {

    display: none;

    width: 100%;

    border-top: 1px solid #edf2f7;

    background: #ffffff;
}


.navbar__mobile-nav {

    width: min(88%, 30rem);

    margin-inline: auto;

    padding-block: 1rem 1.5rem;

    display: flex;

    flex-direction: column;

    gap: .25rem;
}


.navbar__mobile-link {

    display: flex;

    align-items: center;

    min-height: 3rem;

    padding-inline: .8rem;

    border-radius: .5rem;

    color: #173a70;

    font-size: .95rem;

    font-weight: 600;

    text-decoration: none;

    transition:
        background .2s ease,
        color .2s ease;
}


.navbar__mobile-link:hover,
.navbar__mobile-link.is-active {

    background: #f1f7fd;

    color: #087fe8;
}


/* =========================================================
   ACCIONES MÓVILES
========================================================= */

.navbar__mobile-actions {

    display: flex;

    flex-direction: column;

    gap: .65rem;

    margin-top: .75rem;

    padding-top: 1rem;

    border-top: 1px solid #edf2f7;
}


.navbar__mobile-actions .navbar__login {

    width: 100%;

    min-height: 3rem;

    border: 1px solid #d9e5f1;

    border-radius: .5rem;
}


.navbar__mobile-actions .navbar__cta {

    width: 100%;

    min-height: 3rem;
}


/* =========================================================
   MENÚ ABIERTO
========================================================= */

.navbar.is-open .navbar__mobile {

    display: block;
}


.navbar.is-open .navbar__toggle span:nth-child(1) {

    transform:
        translateY(.42rem)
        rotate(45deg);
}


.navbar.is-open .navbar__toggle span:nth-child(2) {

    opacity: 0;
}


.navbar.is-open .navbar__toggle span:nth-child(3) {

    transform:
        translateY(-.42rem)
        rotate(-45deg);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 64rem) {

    .navbar__nav {

        gap: 1rem;
    }

    .navbar__actions {

        gap: .5rem;
    }

    .navbar__login {

        display: none;
    }

}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 48rem) {

    .navbar__container {

        min-height: 4rem;
    }


    .navbar__nav,
    .navbar__actions {

        display: none;
    }


    .navbar__toggle {

        display: flex;
    }


    .navbar__mobile {

        display: none;
    }

}


/* =========================================================
   REDUCIR ANIMACIONES
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .navbar *,
    .navbar *::before,
    .navbar *::after {

        transition: none !important;
    }

}