:root {
    --orange: #ff6a00;
    --orange-dark: #ed5700;
    --black: #151515;
    --white: #ffffff;
    --paper: #f6f6f3;
    --gray: #6c6c6c;
    --container: 1440px;
    --shadow: 0 18px 45px rgba(0,0,0,.13);
    --header-dark: #111111;
    --header-dark-soft: #1c1c1c;
}

/* =========================================================
   HEADER
========================================================= */

.header {
    position: absolute;
    z-index: 1000;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 24px;
    transition: top .3s ease, padding .3s ease;
}

.header.scrolled {
    top: 10px;
}

.header__inner {
    position: relative;
    width: min(100%, 1480px);
    min-height: 75px;
    margin: 0 auto;
    padding: 10px 16px 10px 40px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;

    background: rgba(255,255,255,.96);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.header__logo img {
    display: block;
    width: auto;
    height: 40px;
    max-width: 250px;
}

.header__nav {
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(20px, 2.5vw, 50px);
}

.header__nav a {
    position: relative;
    padding: 8px 0;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 600;
    transform: translateY(0) scale(1);
    transform-origin: center;
    transition:
        color .25s ease,
        transform .25s cubic-bezier(.2,.8,.2,1);
}

.header__nav a:hover,
.header__nav a.active {
    color: var(--orange);
    transform: translateY(-2px) scale(1.04);
}

.header__cta {
    min-height: 35px;
    padding: 0 15px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    color: #fff;
    background: var(--orange);
    border-radius: 4px;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 800;

    transition: background .2s ease, transform .2s ease;
}

.header__cta:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
}

.header__mobile-cta {
    display: none;
}

.header__toggle {
    display: none;
}

/* =========================================================
   COLOR DEL MENÚ
========================================================= */

.header--dark .header__inner {
    color: var(--white);
    background: rgba(17,17,17,.97);
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

.header--dark .header__nav a {
    color: rgba(255,255,255,.88);
}

.header--dark .header__nav a:hover,
.header--dark .header__nav a.active {
    color: var(--orange);
}

.header--light .header__inner {
    color: var(--black);
    background: rgba(255,255,255,.96);
}

/* =========================================================
   TABLET / HAMBURGUESA
========================================================= */

@media (max-width: 1100px) {

    .header {
        padding: 0 20px;
    }

    .header__inner {
        grid-template-columns: auto 1fr auto auto;
        gap: 12px;
    }

    .header__nav {
        position: absolute;
        z-index: 20;
        top: calc(100% + 10px);
        left: 0;
        right: 0;

        display: grid;
        gap: 0;

        padding: 10px 22px 18px;

        color: var(--black);
        background: rgba(255,255,255,.98);
        border-radius: 18px;
        box-shadow: 0 20px 50px rgba(0,0,0,.18);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px) scale(.985);
        transform-origin: top center;

        transition:
            opacity .22s ease,
            visibility .22s ease,
            transform .22s ease;
    }

    .header__nav.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .header__nav a {
        width: 100%;
        padding: 14px 4px;
        border-bottom: 1px solid rgba(0,0,0,.08);
        transform: none;
    }

    .header__nav a:hover,
    .header__nav a.active {
        transform: none;
    }

    .header__nav a:last-child {
        border-bottom: 0;
    }

    .header--dark .header__nav {
        color: var(--white);
        background: rgba(17,17,17,.985);
        box-shadow: 0 20px 50px rgba(0,0,0,.35);
    }

    .header--dark .header__nav a {
        border-bottom-color: rgba(255,255,255,.09);
    }

    .header__cta {
        margin-left: auto;
    }

    .header__toggle {
        width: 48px;
        height: 48px;
        padding: 0;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;

        border: 0;
        border-radius: 12px;
        background: #eee;
        cursor: pointer;

        transition:
            background .2s ease,
            transform .2s ease;
    }

    .header__toggle:hover {
        transform: translateY(-1px);
    }

    .header__toggle span {
        display: block;
        width: 24px;
        height: 2px;
        margin: 0;
        border-radius: 10px;
        background: #111;

        transition:
            transform .25s ease,
            opacity .2s ease;
    }

    .header--dark .header__toggle {
        background: var(--header-dark-soft);
    }

    .header--dark .header__toggle span {
        background: var(--white);
    }

    .header__toggle.is-open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .header__toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .header__toggle.is-open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* =========================================================
   CELULAR
========================================================= */

@media (max-width: 820px) {

    .header {
        top: 10px;
        padding: 0 12px;
    }

    .header.scrolled {
        top: 8px;
    }

    .header__inner {
        min-height: 68px;
        padding: 8px 10px 8px 18px;

        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;

        border-radius: 18px;
    }

    .header__logo img {
        height: 36px;
        max-width: min(210px, 58vw);
    }

    .header__cta {
        display: none;
    }

    .header__nav {
        top: calc(100% + 8px);
        padding: 10px 18px 18px;
        border-radius: 16px;
    }

    .header__nav a {
        padding: 14px 3px;
        font-size: .98rem;
    }

    .header__mobile-cta {
        min-height: 48px;
        margin-top: 10px;
        padding: 0 16px !important;

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

        color: #fff !important;
        background: var(--orange);
        border: 0 !important;
        border-radius: 10px;

        font-weight: 800 !important;
    }

    .header__mobile-cta:hover {
        color: #fff !important;
        background: var(--orange-dark);
    }

    .header__toggle {
        width: 46px;
        height: 46px;
        border-radius: 11px;
    }
}

@media (max-width: 420px) {

    .header {
        padding: 0 8px;
    }

    .header__inner {
        padding-left: 14px;
    }

    .header__logo img {
        height: 33px;
        max-width: 190px;
    }

    .header__toggle {
        width: 44px;
        height: 44px;
    }
}

/* =========================================================
   ACCESIBILIDAD
========================================================= */

.header__toggle:focus-visible,
.header__nav a:focus-visible,
.header__cta:focus-visible {
    outline: 3px solid rgba(255,106,0,.45);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .header,
    .header__nav,
    .header__nav a,
    .header__toggle,
    .header__toggle span,
    .header__cta {
        transition: none !important;
    }
}
