/* Reload Pulsa — unified site header (desktop + mobile, dark + light theme) */
:root {
    --rp-header-h: 64px;
    --rp-header-bg: rgba(12, 20, 48, 0.96);
    --rp-header-border: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] {
    --rp-header-bg: rgba(18, 30, 68, 0.98);
    --rp-header-border: rgba(255, 255, 255, 0.12);
}

.rp-theme .header-section {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 1002;
    width: 100%;
    padding: 0 !important;
    background: var(--rp-header-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--rp-header-border) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
    transition: box-shadow 0.25s ease;
}

.rp-theme .header-section.active {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28) !important;
}

.rp-theme .header-section .container {
    max-width: 1140px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.rp-theme .header-section .header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--rp-header-h);
    position: relative;
}

.rp-theme .header-section .logo {
    flex-shrink: 0;
    width: auto !important;
    max-width: 46vw;
    margin: 0;
    z-index: 2;
}

.rp-theme .header-section .logo a {
    display: flex;
    align-items: center;
    line-height: 0;
    padding: 6px 0;
}

.rp-theme .header-section .logo a img {
    width: auto !important;
    max-width: 176px;
    height: auto !important;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
}

.rp-theme .header-section .header-wrapper > nav {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-theme .header-section .rp-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    z-index: 2;
}

.rp-theme .header-section .menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rp-theme .header-section .menu > li > a {
    text-decoration: none !important;
}

.rp-theme .header-section .header-button.light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.42) !important;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rp-theme .header-section .header-button.light:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.65) !important;
}

.rp-theme .header-section .header-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
}

.rp-theme .header-section .header-bar span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff !important;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.rp-theme .header-section .header-bar.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.rp-theme .header-section .header-bar.active span:nth-child(2) {
    opacity: 0;
}

.rp-theme .header-section .header-bar.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-item-has-children > a::after {
    content: "" !important;
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
    font-family: inherit !important;
}

.menu-item-has-children.open > a::after {
    transform: rotate(-135deg) translateY(1px);
}

@media (min-width: 992px) {
    .rp-theme .header-section .header-wrapper {
        display: grid;
        grid-template-columns: minmax(150px, 190px) 1fr auto;
        align-items: center;
        gap: 16px 24px;
    }

    .rp-theme .header-section .header-wrapper > nav {
        justify-self: center;
        width: 100%;
    }

    .rp-theme .header-section .header-wrapper > ul.menu {
        justify-self: center;
        width: 100%;
    }

    .rp-theme .header-section .menu {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }

    .rp-theme .header-section .menu > li {
        position: relative;
        display: flex;
        align-items: center;
    }

    .rp-theme .header-section .menu > li > a {
        display: inline-flex;
        align-items: center;
        padding: 10px 14px;
        font-size: 0.93rem;
        font-weight: 600;
        line-height: 1.2;
        color: rgba(238, 242, 255, 0.9) !important;
        border-radius: 8px;
        white-space: nowrap;
        transition: color 0.15s ease, background 0.15s ease;
    }

    .rp-theme .header-section .menu > li > a:hover,
    .rp-theme .header-section .menu > li > a[aria-current="page"] {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.1);
    }

    html[data-theme="light"] .rp-theme .header-section .menu > li > a {
        color: rgba(238, 242, 255, 0.9) !important;
    }

    html[data-theme="light"] .rp-theme .header-section .menu > li > a:hover,
    html[data-theme="light"] .rp-theme .header-section .menu > li > a[aria-current="page"] {
        color: #fff !important;
    }

    .menu-item-has-children {
        padding-bottom: 0 !important;
    }

    .menu-item-has-children::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 12px;
    }

    .menu-item-has-children:hover > a::after {
        transform: rotate(-135deg) translateY(1px);
    }

    .rp-theme .header-section .submenu {
        display: block !important;
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        min-width: 220px;
        margin: 0;
        padding: 8px 0;
        list-style: none;
        border-radius: 10px;
        background: #1e2f6b !important;
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
        z-index: 100;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    }

    .menu-item-has-children:hover > .submenu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0);
    }

    .rp-theme .header-section .submenu li a {
        display: block;
        padding: 10px 18px;
        font-size: 0.9rem;
        font-weight: 500;
        color: rgba(238, 242, 255, 0.92) !important;
        white-space: nowrap;
        transition: background 0.15s ease;
    }

    .rp-theme .header-section .submenu li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }

    .rp-header-mobile-tools {
        display: none !important;
    }

    .rp-theme .header-section .header-button.d-none.d-lg-inline-block {
        display: inline-flex !important;
    }
}

@media (max-width: 991px) {
    :root {
        --rp-header-h: 56px;
    }

    .rp-theme .header-section .header-wrapper > nav,
    .rp-theme .header-section .header-wrapper > ul.menu {
        position: static;
    }

    .rp-theme .header-section .menu {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 6px 0 10px;
        background: #162447 !important;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-top: none;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
        visibility: hidden;
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top center;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1001;
        max-height: calc(100dvh - var(--rp-header-h));
        overflow-y: auto;
    }

    .rp-theme .header-section .menu.active {
        visibility: visible !important;
        opacity: 1 !important;
        transform: scaleY(1) !important;
    }

    .rp-theme .header-section .menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px;
        min-height: 46px;
        font-size: 0.95rem;
        font-weight: 600;
        color: #fff !important;
    }

    .rp-theme .header-section .menu li .submenu {
        display: none;
        margin: 0;
        padding: 0 0 6px;
        list-style: none;
        background: rgba(0, 0, 0, 0.18);
    }

    .rp-theme .header-section .menu li.open > .submenu {
        display: block !important;
    }

    .rp-theme .header-section .menu li .submenu li a {
        display: flex;
        align-items: center;
        padding: 10px 18px 10px 30px !important;
        min-height: 42px;
        font-size: 0.9rem;
        font-weight: 500;
        color: rgba(238, 242, 255, 0.88) !important;
    }

    .rp-header-mobile-tools {
        display: flex !important;
        align-items: center;
    }

    .rp-theme .header-section .header-button.d-none.d-lg-inline-block {
        display: none !important;
    }

    body.rp-menu-open {
        overflow: hidden;
    }
}

.rp-theme.rp-home .rp-hero {
    padding-top: calc(var(--rp-header-h) + 48px) !important;
}

.rp-theme.rp-inner .rp-page-hero,
.rp-theme.rp-inner .rp-page-hero.rp-price-hero,
.rp-theme.rp-inner .rp-blog-hero {
    padding-top: calc(var(--rp-header-h) + 28px) !important;
}

.d-none {
    display: none !important;
}

.d-lg-none {
    display: block !important;
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }

    .d-none.d-lg-inline-block {
        display: inline-flex !important;
    }
}

/* Override legacy inline light-theme header rules — keep navy bar for logo contrast */
html[data-theme="light"] .rp-theme .header-section,
html[data-theme="light"] .rp-theme .header-section.active {
    background: rgba(18, 30, 68, 0.98) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="light"] .rp-theme .header-section .menu > li > a,
html[data-theme="light"] .rp-theme .header-section .header-button.light {
    color: #fff !important;
}

html[data-theme="light"] .rp-theme .header-section .header-button.light {
    border-color: rgba(255, 255, 255, 0.42) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="light"] .rp-theme .header-section .header-bar span {
    background-color: #fff !important;
}

/* Submenu links — must beat legacy inline `.menu li a` on pages like index.html */
html[data-theme="light"] .rp-theme .header-section .submenu li a,
html:not([data-theme="light"]) .rp-theme .header-section .submenu li a {
    color: rgba(238, 242, 255, 0.92) !important;
}

html[data-theme="light"] .rp-theme .header-section .submenu li a:hover,
html:not([data-theme="light"]) .rp-theme .header-section .submenu li a:hover {
    color: #fff !important;
}

html[data-theme="light"] .rp-theme .header-section .menu > li > a {
    color: rgba(238, 242, 255, 0.9) !important;
}
