:root {
    --am-blue: #2448a6;
    --am-blue-dark: #12317f;
    --am-blue-bright: #0b42f0;
    --am-cyan: #59b8ff;
    --am-text: #0d1834;
    --am-border: #dbe2ef;
    --am-header-height: 126px;
}

* { box-sizing: border-box; }

body.am-menu-open { overflow: hidden; }

.am-header {
    position: relative;
    z-index: 1000;
}

.am-navbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--am-header-height);
    background: linear-gradient(110deg, var(--am-blue-dark), var(--am-blue));
    transition: height .22s ease, box-shadow .22s ease;
}

.am-header.is-scrolled .am-navbar {
    height: 92px;
    box-shadow: 0 10px 30px rgba(7, 25, 75, .18);
}

.am-navbar__inner {
    width: min(1300px, calc(100% - 48px));
    height: 100%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
}

.am-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.am-brand img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: width .22s ease, height .22s ease;
}

.am-header.is-scrolled .am-brand img {
    width: 74px;
    height: 74px;
}

.am-desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 34px;
    flex: 1;
}

.am-nav-list {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.am-nav-item { position: relative; }

.am-nav-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
    text-decoration: none;
    padding: 18px 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: opacity .18s ease;
}

.am-nav-link:hover,
.am-nav-link:focus-visible { color: #fff; opacity: .76; }

.am-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.am-dropdown-toggle[aria-expanded="true"] .am-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.am-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translate(-50%, 10px);
    width: 410px;
    padding: 12px;
    border: 1px solid rgba(14, 49, 128, .11);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(10, 24, 60, .22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.am-dropdown::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 18px;
    height: 18px;
    background: #fff;
    border-left: 1px solid rgba(14, 49, 128, .08);
    border-top: 1px solid rgba(14, 49, 128, .08);
    transform: translateX(-50%) rotate(45deg);
}

.am-has-dropdown.is-open .am-dropdown,
.am-has-dropdown:hover .am-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.am-dropdown a {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--am-text);
    text-decoration: none;
    transition: background .16s ease, transform .16s ease;
}

.am-dropdown a:hover,
.am-dropdown a:focus-visible {
    background: #f1f5ff;
    transform: translateX(2px);
}

.am-dropdown strong,
.am-dropdown span { display: block; }
.am-dropdown strong { font-size: 15px; margin-bottom: 3px; }
.am-dropdown span { font-size: 13px; color: #64708a; line-height: 1.4; }

.am-quote-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 28px;
    border-radius: 999px;
    background: #00b6ff;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.01em;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(56, 163, 255, .28);
    transition: transform .18s ease, filter .18s ease;
}

.am-quote-button:hover,
.am-quote-button:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.am-mobile-action { display: none; }

.am-whatsapp {
    position: fixed;
    right: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 950;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.22));
}

.am-whatsapp img { width: 58px; height: 58px; display: block; }

.am-drawer-backdrop,
.am-mobile-drawer { display: none; }

@media (max-width: 991px) {
    :root { --am-header-height: 86px; }

    .am-navbar {
        height: 86px;
        box-shadow: 0 6px 18px rgba(6, 30, 89, .16);
    }

    .am-header.is-scrolled .am-navbar { height: 78px; }

    .am-navbar__inner {
        width: 100%;
        padding-inline: 18px;
        display: grid;
        grid-template-columns: 72px 1fr 72px;
        gap: 8px;
    }

    .am-desktop-nav { display: none; }

    .am-brand { justify-self: center; }
    .am-brand img,
    .am-header.is-scrolled .am-brand img {
        width: 68px;
        height: 68px;
    }

    .am-mobile-action {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 64px;
        min-height: 62px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #fff;
        text-decoration: none;
        cursor: pointer;
    }

    .am-mobile-menu-button { justify-self: start; }
    .am-mobile-call { justify-self: end; }

    .am-mobile-action__label {
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .04em;
    }

    .am-menu-icon {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 28px;
    }

    .am-menu-icon span {
        display: block;
        width: 100%;
        height: 3px;
        border-radius: 4px;
        background: currentColor;
    }

    .am-mobile-call svg {
        width: 27px;
        height: 27px;
        fill: currentColor;
    }

    .am-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(3, 10, 28, .58);
        opacity: 0;
        transition: opacity .24s ease;
    }

    .am-drawer-backdrop.is-visible { opacity: 1; }

    .am-mobile-drawer {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        width: min(90vw, 390px);
        height: 100dvh;
        flex-direction: column;
        background: #fff;
        box-shadow: 20px 0 60px rgba(3, 14, 44, .28);
        transform: translateX(-104%);
        transition: transform .28s cubic-bezier(.22,.75,.3,1);
        visibility: hidden;
    }

    .am-mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .am-drawer__top {
        display: grid;
        grid-template-columns: 60px 78px 1fr;
        align-items: center;
        gap: 12px;
        padding: 20px 18px 18px;
        border-bottom: 1px solid var(--am-border);
    }

    .am-drawer__top img { width: 78px; height: 78px; }

    .am-drawer__top p {
        margin: 0;
        color: var(--am-text);
        font-size: 13px;
        line-height: 1.45;
        font-weight: 700;
    }

    .am-drawer-close {
        width: 54px;
        border: 0;
        background: transparent;
        color: var(--am-blue-dark);
        cursor: pointer;
        padding: 0;
    }

    .am-drawer-close span {
        display: block;
        font-size: 40px;
        line-height: .9;
        font-weight: 250;
    }

    .am-drawer-close small {
        display: block;
        margin-top: 7px;
        font-size: 9px;
        font-weight: 800;
    }

    .am-drawer__scroll {
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px 24px calc(28px + env(safe-area-inset-bottom));
    }

    .am-drawer-link,
    .am-mobile-accordion__button {
        width: 100%;
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        border: 0;
        border-bottom: 1px solid var(--am-border);
        background: transparent;
        color: var(--am-text);
        font: inherit;
        font-size: 15px;
        font-weight: 850;
        text-decoration: none;
        text-align: left;
        cursor: pointer;
    }

    .am-mobile-arrow {
        font-size: 34px;
        line-height: 1;
        font-weight: 300;
        transition: transform .18s ease;
    }

    .am-mobile-accordion__button[aria-expanded="true"] .am-mobile-arrow {
        transform: rotate(90deg);
    }

    .am-mobile-accordion__panel {
        padding: 8px 0 12px 14px;
        border-bottom: 1px solid var(--am-border);
    }

    .am-mobile-accordion__panel a {
        display: block;
        padding: 12px 0;
        color: #44506a;
        font-size: 14px;
        font-weight: 650;
        text-decoration: none;
    }

    .am-drawer-separator {
        height: 16px;
        border-bottom: 1px solid var(--am-border);
    }

    .am-drawer-link--secondary { font-size: 14px; }

    .am-drawer-quote {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 68px;
        margin-top: 24px;
        padding: 0 14px 0 24px;
        border-radius: 16px;
        background: linear-gradient(100deg, #0a1f5a, #2852fb);
        color: #fff;
        text-decoration: none;
        font-size: 20px;
        font-weight: 950;
        letter-spacing: -.015em;
        box-shadow: 0 14px 32px rgba(22, 69, 221, .32);
    }

    .am-drawer-quote__arrow {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        border: 2px solid rgba(255,255,255,.9);
        border-radius: 50%;
        font-size: 30px;
        font-weight: 300;
        line-height: 1;
    }

    .am-drawer-phone {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-top: 16px;
        padding: 18px;
        border: 1px solid #e5eaf4;
        border-radius: 16px;
        background: #fff;
        color: var(--am-text);
        text-decoration: none;
        box-shadow: 0 9px 24px rgba(24, 44, 92, .11);
    }

    .am-drawer-phone__icon {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #1f45be;
        color: #fff;
        flex: 0 0 auto;
    }

    .am-drawer-phone__icon svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }

    .am-drawer-phone strong,
    .am-drawer-phone small { display: block; }
    .am-drawer-phone strong { color: #0c38bb; font-size: 20px; line-height: 1.15; }
    .am-drawer-phone small { margin-top: 4px; color: #25314b; font-size: 13px; }

    .am-whatsapp {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .am-whatsapp img { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    .am-navbar,
    .am-brand img,
    .am-dropdown,
    .am-mobile-drawer,
    .am-drawer-backdrop,
    .am-mobile-arrow,
    .am-quote-button { transition: none !important; }
}
/* ==========================================
   CORRECCIÓN DEL ESPACIO DEBAJO DEL HEADER
   ========================================== */

.home,
.contacto,
.trabaja,
.gracias,
.headerapp,
.headernosotros,
.headerfaqs,
.headerprods {
    margin-top: var(--am-header-height) !important;
}
