/* 1. Paksa semua container blok di TT5 untuk tidak mengunci posisi */
header.wp-block-template-part,
.wp-block-template-part-header,
.wp-block-shortcode {
    position: sticky !important;
    top: 0;
    z-index: 999; /* Samakan dengan z-index header */
}

/* 3. Matikan jebakan overflow di tema blok secara global */
.wp-site-blocks, 
.site-canvas,
#page {
    overflow: visible;
}
/* ==========================================================================
   VARIABLES & CORE RESET
   ========================================================================== */
:root {
    --bp-navy: #253A7C;
    --bp-gold: #FFD166;
    --bp-dark-navy: #121b39;
    --bp-white-soft: rgba(255, 255, 255, 0.65);
    --bp-border-white: rgba(255, 255, 255, 0.08);
    --bp-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --bp-transition: 0.25s ease;
}

/* ==========================================================================
   1. HEADER UTAMA
   ========================================================================== */

#header-portal-balaipikir {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: var(--bp-navy);
    width: 100%;
}

#header-portal-balaipikir .header-top-bar {
    padding: 15px 0;
    border-bottom: 1px solid var(--bp-border-white);
}

#header-portal-balaipikir .header-container-1100 {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

#header-portal-balaipikir .header-logo { 
    flex-grow: 1; 
}

#header-portal-balaipikir .header-logo .logo-svg {
    height: 42px;
    width: auto;
    display: block;
}

#header-portal-balaipikir .header-right-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- Buttons --- */
.btn-header {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: var(--bp-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-outline { 
    border: 1.5px solid rgba(255, 255, 255, 0.4); 
    color: #fff !important; 
}

.btn-kirim { 
    background: var(--bp-gold) !important; 
    color: var(--bp-dark-navy) !important; 
    border: 1.5px solid var(--bp-gold); 
}

.btn-outline:hover { background: rgba(255, 255, 255, 0.1); }
.btn-kirim:hover { filter: brightness(0.9); }

.btn-profil {
    align-items: center !important; /* Paksa rata tengah secara vertikal */
    justify-content: center !important;
    gap: 8px !important; /* Jarak antara icon dan teks */
    line-height: 1 !important; /* KUNCI: Biar teks gak punya ruang kosong di atas/bawah */
    vertical-align: middle !important;
}

#header-portal-balaipikir .btn-header.active {
    background-color: var(--bp-gold) !important;
    color: var(--bp-navy) !important;
    border-color: var(--bp-gold) !important;
}

#header-portal-balaipikir .btn-header.active svg { stroke: var(--bp-navy); }

#header-portal-balaipikir button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   2. NAVIGASI KATEGORI
   ========================================================================== */
#header-portal-balaipikir .header-nav-bar {
    background: var(--bp-navy);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

#header-portal-balaipikir .nav-wrapper {
    justify-content: space-between;
    display: flex;
    align-items: center;
}

#header-portal-balaipikir .nav-scroll-area {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    flex-grow: 1;
    scrollbar-width: none;
}

#header-portal-balaipikir .nav-scroll-area::-webkit-scrollbar { display: none; }

#header-portal-balaipikir .nav-scroll-area a {
    color: var(--bp-white-soft);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    padding: 15px 20px 15px 0;
    text-transform: uppercase;
    position: relative;
}

#header-portal-balaipikir .nav-scroll-area a:hover,
#header-portal-balaipikir .nav-scroll-area a.active { color: #fff; }

#header-portal-balaipikir .nav-scroll-area a:hover::after,
#header-portal-balaipikir .nav-scroll-area a.active::after {
    content: ""; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 20px; 
    height: 4px; 
    background: var(--bp-gold);
}

/* ==========================================================================
   3. DROPDOWNS (SEARCH & MOBILE MENU)
   ========================================================================== */
.search-wrapper-relative {
    position: relative;
    display: flex;
    align-items: center;
}

#dropdown-search-bar,
#dropdown-mobile-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    border-radius: 10px;
    box-shadow: var(--bp-shadow);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dropdown-search-bar.active,
#dropdown-mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Search Specific --- */
#dropdown-search-bar { background: #ffffff; padding: 10px; }
#dropdown-search-bar::before {
    content: ""; position: absolute; top: -6px; right: 15px;
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-bottom: 6px solid #ffffff;
}

#dropdown-search-bar form { display: flex; align-items: center; gap: 8px; }
#dropdown-search-bar input {
    flex: 1; border: 1px solid #ddd; border-radius: 6px;
    padding: 8px 12px; font-size: 14px; outline: none; color: #333;
}
#dropdown-search-bar input:focus { border-color: var(--bp-navy); }

#btn-submit-inline { background: var(--bp-navy); color: #fff; padding: 8px; border-radius: 6px; cursor: pointer; }

/* --- Mobile Menu Specific --- */
#dropdown-mobile-menu {
    background: var(--bp-navy);
    padding: 15px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--bp-gold) rgba(255, 255, 255, 0.05);
}

#dropdown-mobile-menu::-webkit-scrollbar { width: 4px; display: block; }
#dropdown-mobile-menu::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
#dropdown-mobile-menu::-webkit-scrollbar-thumb { background: var(--bp-gold); border-radius: 10px; }

#dropdown-mobile-menu::before {
    content: ""; position: absolute; top: -6px; right: 15px;
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-bottom: 6px solid var(--bp-navy);
}

#dropdown-mobile-menu .sidebar-nav {display: flex;flex-direction: column;gap: 10px;}
#dropdown-mobile-menu .sidebar-nav a {
    display: block; color: #ffffff; text-decoration: none; 
    font-size: 15px; font-weight: 600; padding: 14px 18px; 
    border-radius: 10px; background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid transparent; transition: 0.3s all ease;
}

#dropdown-mobile-menu .sidebar-nav a:hover { 
    background: rgba(255, 255, 255, 0.12); color: var(--bp-gold); 
    border-left: 4px solid var(--bp-gold); padding-left: 22px; 
}

/* --- Socials & Credits --- */
.sidebar-social { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.social-flex { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; }
.social-flex a {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08); color: #ffffff;
    text-decoration: none; transition: all 0.3s ease;
}
.social-flex a:hover { 
    background-color: var(--bp-gold); color: var(--bp-navy); 
    transform: translateY(-3px); box-shadow: 0 5px 15px rgba(255, 209, 102, 0.2); 
}

.sidebar-footer-credit { margin-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 20px; }
.sidebar-footer-credit p { font-size: 11px; color: #fff; text-transform: uppercase; font-weight: 500; margin: 0; }
.sidebar-footer-credit strong { color: var(--bp-gold); font-weight: 700; display: block; font-size: 13px; margin-bottom: 4px; }

/* ==========================================================================
   4. TWEAKS & UTILITIES
   ========================================================================== */
.btn-hamburger.active .icon-hamburger { display: none !important; }
.btn-hamburger.active .icon-close { display: block !important; }

@media (min-width: 769px) {
    .mobile-only-items { display: none !important; }
}

.desktop-only-flex { display: flex !important; }
.mobile-only-flex { display: none !important; }

/* ==========================================================================
   5. MEDIA QUERIES
   ========================================================================== */
@media(max-width: 768px) {
    .desktop-only, .desktop-only-flex { display: none !important; }
    .mobile-only-flex { display: flex !important; }
    #header-portal-balaipikir .header-logo .logo-svg { height: 32px; }
    #header-portal-balaipikir .nav-scroll-area { padding: 0 15px; }
	#header-portal-balaipikir .header-container-1100 { padding: 0 15px; }
    
    #dropdown-search-bar {
        position: fixed;
        top: 72px;
        left: 15px;
        right: 15px;
        width: auto;
    }
}

/* ==========================================================================
   6. IKLAN INTERNAL (Mobile Reveal)
   ========================================================================== */
@media (min-width: 769px) {
    #bp-ad-container, #bp-ad-fixed-wrap, .mobile-only-ad { display: none !important; }
}

@media (max-width: 768px) {
    :root {
        --bp-ad-bg: #121b39;
        --bp-ad-text: rgba(255,255,255,0.8);
    }

    #bp-ad-container {
        position: relative; width: 100%;
        height: calc(100vw * (200 / 600) + 32px); 
        background: var(--bp-ad-bg); overflow: hidden; z-index: 1;
    }

    #bp-ad-fixed-wrap {
        position: fixed; top: 0; left: 0; width: 100%; height: inherit;
        z-index: 1; display: flex; flex-direction: column; will-change: transform;
    }

    .bp-ad-header {
        position: relative; width: 100%; height: 32px;
        display: flex; justify-content: space-between; align-items: center;
        padding: 0 15px; background: var(--bp-ad-bg); z-index: 3;
    }

    .bp-ad-body { width: 100%; flex: 1; display: flex; align-items: flex-start; }
    .bp-ad-body img { width: 100%; height: auto; display: block; }

    #wrapper, .site-container, #main-content { position: relative; z-index: 10; background-color: #fff; }

    .bp-ad-label { font-size: 10px; color: var(--bp-ad-text); text-transform: uppercase; font-weight: 600; }

    button#bp-ad-close {
        background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3);
        color: #fff; border-radius: 50%; width: 24px; height: 24px;
        font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    }
}

/* ==========================================================================
   7. PROGRESS BAR
   ========================================================================== */
.bp-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.bp-progress-bar {
    height: 100%;
    background: var(--bp-gold);
    width: 0%;
    transition: width 0.1s ease-out;
    will-change: width;
}