/* ================================================
   NAVBAR — CAINCO El Alto  v4 (Professional)
   Transparente sobre hero → Blanco al scroll
   Paleta: navy #003366  ·  naranja #eba436
================================================ */

/* ══ BASE ══════════════════════════════════════ */
.cainco-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: transparent;
    transition:
        background .38s ease,
        box-shadow  .38s ease;
}

/* ══ CONTAINER ══════════════════════════════════ */
.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 36px;
    display: flex;
    align-items: center;
    height: 90px;
    transition: height .35s ease;
}

/* ══ SCROLLED → fondo blanco limpio ══════════════ */
.cainco-navbar.scrolled {
    background: #000020;
    box-shadow: 0 2px 28px rgba(0, 0, 0, .35);
}
.cainco-navbar.scrolled .navbar-container {
    height: 68px;
}

/* ══ LOGO ════════════════════════════════════════ */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: auto;
    z-index: 10001;
}

.navbar-logo img {
    height: 72px;
    width: auto;
    display: block;
    transition: height .35s ease;
}
.cainco-navbar.scrolled .navbar-logo img {
    height: 52px;
}

.navbar-logo-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.15;
    text-shadow: 0 2px 10px rgba(0,0,0,.45);
    transition: color .35s ease, text-shadow .35s ease;
}
.navbar-logo-text span {
    display: block;
    font-size: .6rem;
    font-weight: 700;
    color: rgba(255,255,255,.82);
    letter-spacing: 3.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    transition: color .35s ease, text-shadow .35s ease;
}
.cainco-navbar.scrolled .navbar-logo-text h1 {
    color: #fff;
    text-shadow: none;
}
.cainco-navbar.scrolled .navbar-logo-text span {
    color: #eba436;
    text-shadow: none;
}

/* ══ MENÚ LINKS DESKTOP ══════════════════════════ */
.navbar-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    height: 100%;
    align-items: stretch;
}

.navbar-links > li {
    display: flex;
    align-items: center;
    position: relative;
}

/* Link base */
.navbar-links > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 17px;
    font-family: 'Montserrat', sans-serif;
    font-size: .91rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color .22s ease;
    letter-spacing: .01em;
}

/* Subrayado animado (hover + activo) — NO para el CTA */
.navbar-links > li > a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 17px;
    right: 17px;
    height: 3px;
    background: #eba436;
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .28s cubic-bezier(.34, 1.36, .64, 1);
}
.navbar-links > li > a:not(.nav-cta):hover,
.navbar-links > li.nav-active > a:not(.nav-cta) {
    color: #fff;
}
.navbar-links > li > a:not(.nav-cta):hover::after,
.navbar-links > li.nav-active > a:not(.nav-cta)::after {
    transform: scaleX(1);
}

/* Scrolled: fondo oscuro → links siguen blancos */
.cainco-navbar.scrolled .navbar-links > li > a:not(.nav-cta) {
    color: rgba(255, 255, 255, .88);
}
.cainco-navbar.scrolled .navbar-links > li > a:not(.nav-cta):hover,
.cainco-navbar.scrolled .navbar-links > li.nav-active > a:not(.nav-cta) {
    color: #fff;
}

/* ══ CTA "ÚNETE" — pill naranja ══════════════════ */
.nav-cta {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: auto !important;
    margin-left: 10px;
    padding: .58rem 1.4rem !important;
    background: #eba436;
    color: #fff !important;
    border-radius: 50px;
    font-weight: 700 !important;
    font-size: .88rem !important;
    letter-spacing: .02em !important;
    box-shadow: 0 4px 18px rgba(255, 122, 61, .38);
    transition:
        background .25s ease,
        transform   .25s ease,
        box-shadow  .25s ease !important;
}
.nav-cta:hover {
    background: #e8601a !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 122, 61, .55) !important;
}
.nav-cta::after { display: none !important; }
.nav-cta .dropdown-icon { color: rgba(255,255,255,.8); }

/* ══ DROPDOWN DESKTOP ════════════════════════════ */
.nav-dropdown { position: relative; }

.dropdown-icon {
    font-size: .63rem;
    opacity: .8;
    transition: transform .3s ease;
    margin-top: 1px;
    flex-shrink: 0;
}
.nav-dropdown:hover .dropdown-icon { transform: rotate(180deg); }

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-top: 3px solid #eba436;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .13);
    min-width: 240px;
    padding: 6px 0 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition:
        opacity    .24s ease,
        transform  .24s ease,
        visibility .24s ease;
    pointer-events: none;
}
.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-content li { list-style: none; }

.dropdown-content a {
    display: flex;
    align-items: center;
    padding: 11px 22px;
    font-family: 'Montserrat', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    text-shadow: none;
    transition: background .2s ease, color .2s ease, padding-left .2s ease;
}
.dropdown-content a:hover {
    background: #fff5ef;
    color: #eba436;
    padding-left: 28px;
}

/* CTA con dropdown: alineado */
.nav-cta ~ .dropdown-content { left: 10px; }

/* ══ HAMBURGUESA — CSS puro ══════════════════════ */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 20, 0.55);  /* fondo oscuro siempre visible */
    border: 1.5px solid rgba(255, 255, 255, .45);
    border-radius: 10px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10001;
    position: relative;
    transition: background .2s ease, border-color .2s ease;
    padding: 0;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.navbar-hamburger:hover {
    background: rgba(0, 0, 20, 0.80);
    border-color: rgba(255, 255, 255, .7);
}

/* Las 3 barras — más gruesas y visibles */
.hb-bar {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #fff;
    border-radius: 3px;
    transition: transform .32s cubic-bezier(.34,1.36,.64,1),
                opacity   .22s ease,
                width     .22s ease;
}

/* Animación → X al abrir */
.navbar-hamburger.open .hb-bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.navbar-hamburger.open .hb-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
.navbar-hamburger.open .hb-bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Hamburguesa cuando el navbar está scrolleado (fondo navy) */
.cainco-navbar.scrolled .navbar-hamburger {
    background: rgba(255, 122, 61, .15);
    border-color: rgba(255, 122, 61, .5);
}
.cainco-navbar.scrolled .navbar-hamburger:hover {
    background: rgba(255, 122, 61, .3);
    border-color: #eba436;
}
.cainco-navbar.scrolled .hb-bar { background: #fff; }

/* ══ OVERLAY MÓVIL ═══════════════════════════════ */
.navbar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.navbar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — TABLET  ≤ 1140px
════════════════════════════════════════════════ */
@media (max-width: 1140px) {
    .navbar-container { padding: 0 24px; }
    .navbar-links > li > a { padding: 0 13px; font-size: .86rem; }
    .navbar-links > li > a::after { left: 13px; right: 13px; }
    .nav-cta { padding: .55rem 1.1rem !important; }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — MÓVIL  ≤ 992px
════════════════════════════════════════════════ */
@media (max-width: 992px) {

    .navbar-hamburger { display: flex; }

    .navbar-container { height: 76px; padding: 0 20px; }
    .cainco-navbar.scrolled .navbar-container { height: 64px; }

    /* Panel lateral deslizante */
    .navbar-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: linear-gradient(175deg, #000020 0%, #000020 100%);
        flex-direction: column;
        align-items: flex-start;
        overflow-y: auto;
        padding: 88px 0 32px;
        gap: 0;
        transition: right .42s cubic-bezier(.68, -.55, .265, 1.55);
        box-shadow: -6px 0 36px rgba(0, 0, 0, .35);
        z-index: 10000;
    }
    .navbar-links.active { right: 0; }

    .navbar-links > li {
        width: 100%;
        height: auto;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }

    .navbar-links > li > a {
        width: 100%;
        height: auto;
        padding: 16px 24px;
        color: rgba(255, 255, 255, .9) !important;
        font-size: .95rem;
        border-radius: 0;
    }
    .navbar-links > li > a::after { display: none !important; }

    .navbar-links > li > a:hover {
        background: rgba(255, 255, 255, .07);
        color: #fff !important;
    }

    /* CTA pill → bloque en móvil */
    .nav-cta {
        display: flex !important;
        margin: 16px 20px 0 !important;
        padding: .78rem 1.4rem !important;
        border-radius: 10px !important;
        width: calc(100% - 40px);
        justify-content: center;
        box-shadow: none;
        font-size: .92rem !important;
    }
    .nav-cta:hover { transform: none !important; }

    /* Dropdown → colapso por altura */
    .dropdown-content {
        position: static;
        background: rgba(0, 0, 0, .22);
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
        transition: max-height .38s ease;
    }
    .nav-dropdown.active .dropdown-content {
        max-height: 400px;
        padding: 4px 0;
    }
    .nav-dropdown.active .dropdown-icon { transform: rotate(180deg); }

    .dropdown-content a {
        padding: 13px 24px 13px 44px;
        color: rgba(255, 255, 255, .78) !important;
        font-size: .875rem;
    }
    .dropdown-content a:hover {
        background: rgba(255, 255, 255, .1) !important;
        color: #fff !important;
        padding-left: 44px !important;
    }
}

/* ════════════════════════════════════════════════
   MÓVIL  ≤ 700px
════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .navbar-container { height: 68px; padding: 0 14px; }
    .cainco-navbar.scrolled .navbar-container { height: 58px; }
    .navbar-logo img { height: 42px; }
    .cainco-navbar.scrolled .navbar-logo img { height: 36px; }
    .navbar-logo-text { display: none; }
    .navbar-links { width: 85%; }
    .navbar-hamburger { width: 44px; height: 44px; flex-shrink: 0; }
}

/* ════════════════════════════════════════════════
   MÓVIL  ≤ 480px
════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .navbar-container { height: 62px; padding: 0 12px; }
    .navbar-logo img { height: 38px; }
    .navbar-hamburger { width: 42px; height: 42px; }
}
