/* ============================= */
/* NAVBAR - SM RACING */
/* ============================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    z-index: 3000;

    background: transparent;
    overflow: visible;

    transition:
            background 0.35s ease,
            box-shadow 0.35s ease,
            backdrop-filter 0.35s ease;
}

/* Fondo del navbar al hacer scroll */
.navbar.navbar-scrolled {
    background: linear-gradient(
            to bottom,
            rgba(255, 49, 49, 0.95) 0%,
            rgba(93, 93, 93, 0.95) 100%
    );

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

/* ============================= */
/* LÍNEAS BLANCAS EN NAVBAR */
/* ============================= */

.navbar .global-racing-lines {
    position: absolute;
    top: 0;
    left: 0;

    width: 50%;
    height: 100vh;

    pointer-events: none;
    z-index: 1;

    overflow: hidden;
}

.navbar .global-racing-lines .global-line {
    position: absolute;
    top: 0;

    width: 120px;
    height: 40vh;

    background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.9) 10%,
            rgba(255, 255, 255, 0.6) 40%,
            rgba(255, 255, 255, 0.2) 70%,
            rgba(255, 255, 255, 0) 100%
    );

    transform: skewX(-25deg);
    transform-origin: top center;

    opacity: 0.65;
}

.navbar .global-line-1 {
    left: 14%;
}

.navbar .global-line-2 {
    left: 24%;
}

/* ============================= */
/* CONTENEDOR */
/* ============================= */

.nav-container {
    position: relative;
    z-index: 30;

    width: 100%;
    max-width: 1400px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 70px;
    min-height: 72px;
}

/* ============================= */
/* LOGO */
/* ============================= */

.logo-link {
    position: relative;
    z-index: 60;

    display: flex;
    align-items: center;

    text-decoration: none;
}

.logo {
    position: relative;
    z-index: 60;

    height: 62px;
    width: auto;
    display: block;
}

/* ============================= */
/* MENÚ DESKTOP */
/* ============================= */

.nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    z-index: 40;

    display: flex;
    align-items: center;
    gap: 34px;
}

.nav-menu a {
    position: relative;

    color: #ffffff;
    text-decoration: none;

    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.4px;

    opacity: 0.95;

    transition:
            color 0.25s ease,
            opacity 0.25s ease,
            transform 0.25s ease;
}

.nav-menu a:hover {
    opacity: 1;
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-menu a.active,
.nav-menu a:hover {
    font-weight: 700;
}

.nav-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;

    width: 0;
    height: 2px;

    background: #ffffff;
    transition: width 0.25s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* ============================= */
/* HAMBURGUESA */
/* ============================= */

.menu-toggle {
    display: none;
}

.menu-icon {
    display: none;

    position: relative;
    z-index: 70;

    width: 36px;
    height: 30px;

    cursor: pointer;
}

.menu-icon span {
    position: absolute;
    left: 0;

    width: 32px;
    height: 3px;

    background: #ffffff;
    border-radius: 20px;

    transition:
            transform 0.3s ease,
            opacity 0.3s ease,
            top 0.3s ease;
}

.menu-icon span:nth-child(1) {
    top: 4px;
}

.menu-icon span:nth-child(2) {
    top: 13px;
}

.menu-icon span:nth-child(3) {
    top: 22px;
}

/* ============================= */
/* TABLET */
/* ============================= */

@media (max-width: 1024px) {
    .nav-container {
        padding: 0 42px;
        min-height: 70px;
    }

    .logo {
        height: 58px;
    }

    .nav-menu {
        gap: 26px;
    }

    .nav-menu a {
        font-size: 0.92rem;
    }

    .navbar .global-racing-lines {
        width: 50vw;
    }

    .navbar .global-racing-lines .global-line {
        width: 95px;
        height: 35%;
    }

    .navbar .global-line-1 {
        left: 11%;
    }

    .navbar .global-line-2 {
        left: 21%;
    }
}

/* ============================= */
/* MOBILE */
/* ============================= */

@media (max-width: 768px) {
    .navbar {
        background: transparent;
    }

    .navbar.navbar-scrolled {
        background: linear-gradient(
                to bottom,
                rgba(255, 49, 49, 0.96) 0%,
                rgba(93, 93, 93, 0.96) 100%
        );
    }

    .nav-container {
        padding: 0 28px;
        min-height: 74px;
    }

    .logo {
        height: 52px;
    }

    .logo-link {
        transform: translateX(12px);
    }

    .menu-icon {
        display: block;
    }

    .navbar .global-racing-lines {
        width: 230px;
    }

    .navbar .global-racing-lines .global-line {
        width: 85px;
        height: 35%;
    }

    .navbar .global-line-1 {
        left: 18%;
    }

    .navbar .global-line-2 {
        left: 45%;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;

        transform: translateX(100%);

        width: 78%;
        max-width: 320px;
        height: 100vh;

        z-index: 50;

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        gap: 28px;

        padding: 90px 36px;

        background: linear-gradient(
                to bottom,
                rgba(255, 49, 49, 0.98) 0%,
                rgba(35, 35, 35, 0.98) 100%
        );

        box-shadow: -18px 0 40px rgba(0, 0, 0, 0.45);

        opacity: 0;
        pointer-events: none;

        transition:
                transform 0.35s ease,
                opacity 0.35s ease;
    }

    .nav-menu a {
        font-size: 1.25rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        opacity: 1;
    }

    .menu-toggle:checked ~ .nav-menu {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .menu-toggle:checked + .menu-icon span:nth-child(1) {
        top: 13px;
        transform: rotate(45deg);
    }

    .menu-toggle:checked + .menu-icon span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle:checked + .menu-icon span:nth-child(3) {
        top: 13px;
        transform: rotate(-45deg);
    }
}

/* ============================= */
/* MOBILE SMALL */
/* ============================= */

@media (max-width: 480px) {
    .nav-container {
        padding: 0 24px;
        min-height: 70px;
    }

    .logo {
        height: 48px;
    }

    .logo-link {
        transform: translateX(12px);
    }

    .menu-icon span {
        width: 30px;
        height: 3px;
    }

    .navbar .global-racing-lines {
        width: 190px;
    }

    .navbar .global-racing-lines .global-line {
        width: 75px;
    }

    .navbar .global-line-1 {
        left: 18%;
    }

    .navbar .global-line-2 {
        left: 48%;
    }

    .nav-menu {
        width: 82%;
        padding: 85px 32px;
    }

    .nav-menu a {
        font-size: 1.1rem;
    }
}

/* ============================= */
/* MOBILE VERY SMALL */
/* ============================= */

@media (max-width: 360px) {
    .nav-container {
        padding: 0 20px;
    }

    .logo {
        height: 44px;
    }

    .logo-link {
        transform: translateX(10px);
    }

    .menu-icon {
        width: 34px;
        height: 28px;
    }

    .menu-icon span {
        width: 28px;
    }

    .navbar .global-racing-lines {
        width: 170px;
    }

    .navbar .global-racing-lines .global-line {
        width: 68px;
    }

    .navbar .global-line-1 {
        left: 18%;
    }

    .navbar .global-line-2 {
        left: 48%;
    }

    .nav-menu {
        width: 84%;
        padding: 80px 28px;
    }

    .nav-menu a {
        font-size: 1rem;
    }
}