/* ============================================================
   RISC Header — Model 2 (Ondas e Logo Destaque)
   ============================================================ */

.risc-header-model2,
.risc-header-model2 * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== HEADER WRAPPER ===== */
.risc-header-model2 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-family: inherit;
    pointer-events: none;
    /* Let clicks pass through empty spaces */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    isolation: isolate;
}

body.risc-header-active {
    overflow-x: clip;
}

@supports not (overflow: clip) {
    body.risc-header-active { overflow-x: hidden; }
}

.risc-header-model2.rh-hidden {
    /* Translating by -200px guarantees we hide the header, the waves, and the logo which overhangs */
    transform: translateY(-200px);
}

/* Inner elements should capture pointer events */
.rh2-inner,
.rh2-mobile-panel,
.rh2-bg,
.rh2-wave-shape {
    pointer-events: auto;
}

/* ===== WAVY BACKGROUND ===== */
.rh2-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 86px;
    background-color: var(--rh-bg-rgba, rgba(7, 19, 31, 0.96));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background-color 0.4s ease;
    z-index: 2;
    overflow: hidden;
}

.rh2-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('texture.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0.07;
    pointer-events: none;
}

.rh2-wave-shape {
    position: absolute;
    top: 86px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transition: filter 0.4s ease;
    z-index: 2;
}

.rh2-wave-shape::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('texture.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    opacity: 0.12;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 3;
}

.risc-header-model2.rh-scrolled .rh2-wave-shape {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.rh2-wave-shape svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 48px;
}

.rh2-wave-overlay {
    fill: var(--rh-wave-rgba, rgba(45, 212, 191, 0.28));
    transition: fill 0.3s ease;
}

.rh2-shape-fill {
    fill: var(--rh-bg-rgba, rgba(7, 19, 31, 0.96));
    transition: fill 0.3s ease;
}

/* ===== INNER WRAPPER ===== */
.rh2-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 86px;
    max-width: var(--rh-container-width, 1200px);
    width: 100%;
    margin: 0 auto;
    padding: 0 28px;
    min-width: 0;
}

.rh2-left,
.rh2-right {
    min-width: 0;
}

.rh2-left {
    flex: 0 1 auto;
}

.rh2-right {
    flex: 0 0 auto;
}

/* ===== LEFT - LOGO ===== */
.rh2-left {
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 4;
}

.rh2-logo-link {
    display: block;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
}

.rh2-logo-img {
    height: var(--rh-logo-size, 128px);
    width: auto;
    max-width: min(320px, 42vw);
    object-fit: contain;
    /* Pushes the logo out of the header area */
    transform: translateY(calc(var(--rh-logo-overlap, 56px) / 2));
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
    will-change: transform;
}

.rh2-logo-img:hover {
    transform: translateY(calc(var(--rh-logo-overlap, 56px) / 2 - 6px)) scale(1.04);
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.35));
}

.rh2-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--rh-text-color, #fff);
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    /* Push down for text logo as well */
    display: inline-block;
    transform: translateY(calc(var(--rh-logo-overlap, 56px) / 2));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rh2-logo-text:hover {
    transform: translateY(calc(var(--rh-logo-overlap, 56px) / 2 - 4px)) scale(1.02);
}

/* ===== RIGHT - NAV & CTA ===== */
.rh2-right {
    display: flex;
    align-items: center;
    gap: 36px;
}

/* Nav Sections */
.rh2-nav {
    display: flex;
    align-items: center;
}

.rh2-nav-list {
    list-style: none;
    display: flex;
    gap: 32px;
}

.rh2-nav-link {
    color: var(--rh-text-color, #fff);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 8px 0;
    position: relative;
    opacity: 0.85;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.rh2-nav-link:hover {
    opacity: 1;
    color: var(--rh-btn-bg, #dfda43);
    transform: translateY(-1px);
}

.rh2-nav-link-bar {
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--rh-btn-bg, #dfda43);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.rh2-nav-link:hover .rh2-nav-link-bar {
    width: 100%;
}

/* CTA Button */
.rh2-cta-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--rh-btn-color-1, #55A9D8) 0%, var(--rh-btn-color-2, #2f6d91) 100%);
    border: none;
    border-top-left-radius: 16px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 0;
    text-decoration: none;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        filter 0.35s ease;
    z-index: 1;
}

.rh2-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.22),
            transparent);
    transition: left 0.6s ease;
    z-index: 0;
    pointer-events: none;
}

.rh2-cta-btn:hover {
    color: #fff;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
    filter: brightness(1.05);
    transform: translateY(-2px) scale(1.03);
}

.rh2-cta-btn:hover::before {
    left: 130%;
}

.rh2-cta-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.rh2-cta-btn:focus,
.rh2-cta-btn:visited {
    color: #fff;
    text-decoration: none;
}

/* ===== MOBILE HAMBURGER ===== */
.rh2-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.rh2-hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.rh2-ham-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--rh-text-color, #fff);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    transform-origin: center;
}

.risc-header-model2.rh-menu-open .rh2-ham-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.risc-header-model2.rh-menu-open .rh2-ham-line:nth-child(2) {
    opacity: 0;
}

.risc-header-model2.rh-menu-open .rh2-ham-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== MOBILE PANEL ===== */
.rh2-mobile-panel {
    position: absolute;
    top: 86px;
    left: 0;
    right: 0;
    width: 100vw;
    background-color: var(--rh-bg-rgba, rgba(7, 19, 31, 0.96));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.risc-header-model2.rh-menu-open .rh2-mobile-panel {
    max-height: 500px;
}

.rh2-mobile-nav-list {
    list-style: none;
    padding: 24px 28px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rh2-mobile-nav-item {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.risc-header-model2.rh-menu-open .rh2-mobile-nav-item {
    opacity: 1;
    transform: translateY(0);
}

/* Add staggered delay for mobile items */
.rh2-mobile-nav-item:nth-child(1) {
    transition-delay: 0.1s;
}

.rh2-mobile-nav-item:nth-child(2) {
    transition-delay: 0.15s;
}

.rh2-mobile-nav-item:nth-child(3) {
    transition-delay: 0.2s;
}

.rh2-mobile-nav-item:nth-child(4) {
    transition-delay: 0.25s;
}

.rh2-mobile-nav-item:nth-child(5) {
    transition-delay: 0.3s;
}

.rh2-mobile-nav-item:nth-child(6) {
    transition-delay: 0.35s;
}

.rh2-mobile-nav-link {
    display: block;
    color: var(--rh-text-color, #fff);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.rh2-mobile-nav-link:hover {
    color: var(--rh-btn-bg, #2dd4bf);
    padding-left: 8px;
}


@media (prefers-reduced-motion: reduce) {
    .risc-header-model2,
    .risc-header-model2 * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .rh2-nav {
        display: none;
    }

    .rh2-hamburger {
        display: flex;
        flex: 0 0 44px;
    }

    .rh2-right {
        gap: 20px;
        margin-left: auto;
    }
}

@media (max-width: 600px) {
    .rh2-inner {
        height: 72px;
        padding: 0 14px;
        gap: 10px;
    }

    .rh2-left {
        flex: 1 1 auto;
        max-width: calc(100% - 52px);
    }

    .rh2-right {
        flex: 0 0 auto;
        gap: 10px;
        margin-left: auto;
    }

    .rh2-bg {
        height: 72px;
    }

    .rh2-wave-shape {
        top: 72px;
    }

    .rh2-wave-shape svg {
        height: 36px;
    }

    .rh2-cta-btn {
        display: none;
    }

    .rh2-hamburger {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .rh2-ham-line {
        width: 18px;
    }

    .rh2-logo-link {
        display: flex;
        align-items: center;
    }

    .rh2-logo-img {
        height: clamp(58px, calc(var(--rh-logo-size, 128px) * 0.62), 86px);
        max-width: min(54vw, 180px);
        transform: translateY(calc(var(--rh-logo-overlap, 56px) * 0.4));
    }

    .rh2-logo-img:hover {
        transform: translateY(calc((var(--rh-logo-overlap, 56px) * 0.4) - 4px)) scale(1.04);
    }

    .rh2-mobile-panel {
        top: 72px;
    }
}

@media (max-width: 380px) {
    .rh2-inner { padding: 0 10px; }
    .rh2-left { max-width: calc(100% - 48px); }
    .rh2-logo-img { max-width: min(50vw, 160px); }
    .rh2-hamburger { width: 38px; height: 38px; flex-basis: 38px; }
}

/* ===== DROPDOWN SUBMENU ===== */
.rh2-nav-item.rh2-has-children {
    position: relative;
}

.rh2-submenu-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: .72em;
    transform: translateY(-1px);
    opacity: .8;
}

.rh2-submenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    min-width: 190px;
    padding: 10px;
    list-style: none;
    background: var(--rh-bg-rgba, rgba(7, 19, 31, 0.96));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,.26);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    pointer-events: none;
    z-index: 20;
}

.rh2-submenu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.rh2-nav-item.rh2-has-children:hover > .rh2-submenu,
.rh2-nav-item.rh2-has-children:focus-within > .rh2-submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.rh2-submenu .rh2-nav-item {
    opacity: 1;
    transform: none;
}

.rh2-submenu .rh2-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    white-space: nowrap;
    font-size: .88rem;
}

.rh2-submenu .rh2-nav-link:hover {
    background: rgba(255,255,255,.08);
}

.rh2-mobile-submenu {
    list-style: none;
    margin: 2px 0 4px 14px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.14);
}

.rh2-mobile-submenu .rh2-mobile-nav-item {
    opacity: 1;
    transform: none;
}

.rh2-mobile-submenu .rh2-mobile-nav-link {
    font-size: .96rem;
    padding: 8px 0;
    opacity: .86;
}

/* ============================================================
   MOBILE MENU UX PATCH — v2.2.2
   Menu rolável, submenus recolhidos e toque mais confortável
   ============================================================ */
@media (max-width: 992px) {
    .risc-header-model2.rh-menu-open {
        transform: none !important;
    }

    .rh2-mobile-panel {
        position: fixed;
        top: 86px;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 0;
        overflow: hidden;
        overscroll-behavior: contain;
        z-index: 9998;
        border-top: 1px solid rgba(255,255,255,.10);
    }

    .risc-header-model2.rh-menu-open .rh2-mobile-panel {
        max-height: min(72vh, calc(100dvh - 96px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rh2-mobile-nav-list {
        padding: 18px 22px max(24px, env(safe-area-inset-bottom));
        gap: 8px;
    }

    .rh2-mobile-nav-item {
        transform: none;
    }

    .rh2-mobile-nav-link,
    .rh2-mobile-submenu-toggle {
        min-height: 46px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: var(--rh-text-color, #fff);
        text-decoration: none;
        font-size: 1rem;
        line-height: 1.25;
        font-weight: 500;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .rh2-mobile-submenu-toggle {
        appearance: none;
        background: transparent;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        cursor: pointer;
        text-align: left;
        font: inherit;
    }

    .rh2-mobile-submenu-toggle .rh2-submenu-arrow {
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: transform .22s ease;
    }

    .rh2-mobile-nav-item.is-submenu-open > .rh2-mobile-submenu-toggle .rh2-submenu-arrow {
        transform: rotate(180deg);
    }

    .rh2-mobile-submenu {
        list-style: none;
        margin: 0;
        padding: 0 0 0 18px;
        max-height: 0;
        overflow: hidden;
        border-left: 1px solid rgba(255,255,255,.16);
        transition: max-height .28s ease, margin .28s ease;
    }

    .rh2-mobile-nav-item.is-submenu-open > .rh2-mobile-submenu {
        max-height: 420px;
        margin: 6px 0 10px;
    }

    .rh2-mobile-submenu-link {
        min-height: 40px;
        display: flex;
        align-items: center;
        color: var(--rh-text-color, #fff);
        text-decoration: none;
        font-size: .93rem;
        line-height: 1.25;
        opacity: .86;
        padding: 8px 0 8px 14px;
        border-bottom: 1px solid rgba(255,255,255,.05);
    }

    .rh2-mobile-nav-link:hover,
    .rh2-mobile-submenu-toggle:hover,
    .rh2-mobile-submenu-link:hover,
    .rh2-mobile-nav-link:focus-visible,
    .rh2-mobile-submenu-toggle:focus-visible,
    .rh2-mobile-submenu-link:focus-visible {
        color: var(--rh-btn-bg, #2dd4bf);
        outline: none;
    }
}

@media (max-width: 600px) {
    .rh2-mobile-panel {
        top: 72px;
    }

    .risc-header-model2.rh-menu-open .rh2-mobile-panel {
        max-height: min(68vh, calc(100dvh - 78px));
    }

    .rh2-mobile-nav-list {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 380px) {
    .risc-header-model2.rh-menu-open .rh2-mobile-panel {
        max-height: min(66vh, calc(100dvh - 76px));
    }

    .rh2-mobile-nav-list {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* ============================================================
   MOBILE MENU PATCH — v2.2.3
   Remove linha do painel fechado e evita alerta aria-hidden
   ============================================================ */

@media (max-width: 992px) {
    .rh2-mobile-panel[aria-hidden="true"] {
        visibility: hidden;
        border-top: 0 !important;
        box-shadow: none !important;
        pointer-events: none;
    }

    .risc-header-model2.rh-menu-open .rh2-mobile-panel {
        visibility: visible;
        pointer-events: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
        box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24) !important;
    }

    .rh2-wave-shape {
        top: 85px;
    }
}

@media (max-width: 600px) {
    .rh2-wave-shape {
        top: 71px;
    }

    .rh2-mobile-panel {
        top: 72px;
    }
}
