/* Enhanced Two Column Mega Menu Styles - FIXED POSITIONING WITH ALWAYS VISIBLE ICONS */

/* Header Base - Fixed for positioning */
.bpt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    background-color: #090F1B;
    position: relative;
    z-index: 1000;
}

.bpt-header .bpt-logo img {
    height: 50px;
}

.bpt-header .bpt-nav-menu {
    display: flex;
    list-style: none;
    padding-left: 0;
    margin: 0;
    position: relative;
    z-index: 1001;
}

.bpt-header .bpt-nav-menu li {
    position: relative;
    margin: 0;
}

/* Prevent layout shifts when mega menu appears */
.bpt-header .bpt-nav-menu>li.bpt-has-mega-menu {
    position: relative;
}

.bpt-header .bpt-nav-menu>li.bpt-has-mega-menu:hover {
    z-index: 10001;
}

/* Create invisible bridge between menu item and mega menu */
.bpt-header .bpt-nav-menu>li.bpt-has-mega-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 20px;
    background: transparent;
    z-index: 9998;
    display: none;
}

.bpt-header .bpt-nav-menu>li.bpt-has-mega-menu:hover::after {
    display: block;
}

/* Navigation Links */
.bpt-header .bpt-nav-menu .bpt-nav-link {
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    display: block;
    padding: 10px 10px;
    transition: all 0.3s ease;
    position: relative;
}

.bpt-header .bpt-nav-menu .bpt-nav-link:hover {
    color: #d6b24e;
    background-color: transparent;
}

/* FIXED: Mega Menu Container - Always Center of Screen */
.bpt-mega-menu-container {
    display: none !important;
    position: fixed;
    top: 80px;
    /* Fixed distance from top */
    left: 50%;
    /* FIXED: Always center of viewport regardless of parent position */
    transform: translateX(-50%);
    background-color: #090F1B;
    z-index: 9999;
    border-top: 3px solid #d6b24e;
    opacity: 0;
    /* FIXED: Hanya opacity dan visibility yang berubah untuk animasi */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 1200px;
    /* Custom width - bisa disesuaikan */
    max-width: 95vw;
    pointer-events: none;
    visibility: hidden;
    /* FIXED: Always positioned relative to viewport */
    margin: 0;
}

/* Create invisible hover area above mega menu */
.bpt-mega-menu-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -50px;
    right: -50px;
    height: 20px;
    background: transparent;
    z-index: 9999;
}

/* Force initial hidden state */
.bpt-has-mega-menu .bpt-mega-menu-container {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* FIXED: Visible state - hanya ubah opacity dan visibility */
.bpt-mega-menu-container.bpt-visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Body and page fixes to prevent layout jumps */
body {
    overflow-x: hidden;
}

.bpt-main-nav {
    overflow: visible;
}

/* Prevent horizontal scrollbar from mega menu */
.bpt-mega-menu-container {
    box-sizing: border-box;
}

.bpt-mega-menu-wrapper {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* Two Column Layout for Mega Menu - Fixed */
.bpt-mega-menu-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 400px;
    max-height: 500px;
    width: 100%;
}

/* Left Column - Menu Categories - Fixed */
.bpt-mega-menu-left {
    background-color: #090F1B;
    border-right: 1px solid #D6B24E;
    padding: 0;
    overflow-y: auto;
    max-height: 500px;
}

/* Right Column - Sub Items - Fixed */
.bpt-mega-menu-right {
    background-color: #090F1B;
    padding: 30px;
    overflow-y: auto;
    max-height: 500px;
    position: relative;
}

/* FIXED: Base hover state with conditional icon */
.bpt-mega-menu-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: block;
    padding: 18px 24px;
    transition: all 0.3s ease;
    border-bottom: 1px solid #D6B24E;
    position: relative;
    background: transparent;
    cursor: pointer;
    /* FIXED: Default padding-right, will be adjusted when has submenu */
    padding-right: 24px;
}

/* FIXED: Add padding-right only when has submenu items */
.bpt-mega-menu-column.has-submenu-items .bpt-mega-menu-title {
    padding-right: 50px;
}

/* Primary hover state */
.bpt-mega-menu-title:hover {
    background-color: #d6b24e !important;
    color: #fff !important;
    padding-left: 30px !important;
}

/* FIXED: Maintain padding-right on hover only when has submenu */
.bpt-mega-menu-column.has-submenu-items .bpt-mega-menu-title:hover {
    padding-right: 45px !important;
}

/* Ensure hover works even when parent has classes */
.bpt-mega-menu-column:hover>.bpt-mega-menu-title {
    background-color: #d6b24e !important;
    color: #fff !important;
    padding-left: 30px !important;
}

/* FIXED: Maintain padding-right on hover only when has submenu */
.bpt-mega-menu-column.has-submenu-items:hover>.bpt-mega-menu-title {
    padding-right: 45px !important;
}

/* Active state controlled by JavaScript - lower priority */
.bpt-mega-menu-column.active .bpt-mega-menu-title {
    background-color: #d6b24e;
    color: #fff;
    padding-left: 30px;
}

/* FIXED: Maintain padding-right on active only when has submenu */
.bpt-mega-menu-column.active.has-submenu-items .bpt-mega-menu-title {
    padding-right: 45px;
}

/* Hover always overrides active */
.bpt-mega-menu-column.active .bpt-mega-menu-title:hover {
    background-color: #d6b24e !important;
    color: #fff !important;
    padding-left: 30px !important;
}

/* FIXED: Maintain padding-right on hover only when has submenu */
.bpt-mega-menu-column.active.has-submenu-items .bpt-mega-menu-title:hover {
    padding-right: 45px !important;
}

/* FIXED: Arrow states - CONDITIONAL VISIBILITY based on submenu items */
.bpt-mega-menu-title::after {
    font-family: 'tabler-icons';
    content: "\ea61";
    /* chevron-right icon */
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    /* FIXED: Default hidden - only show when has submenu items */
    opacity: 0;
    transition: all 0.3s ease;
    color: #D6B24E;
    /* FIXED: Use brand color for better visibility */
    font-size: 16px;
}

/* FIXED: Show icon ONLY when parent has submenu items */
.bpt-mega-menu-column.has-submenu-items .bpt-mega-menu-title::after {
    opacity: 1;
}

/* FIXED: Arrow on hover - only show when has submenu items */
.bpt-mega-menu-column.has-submenu-items .bpt-mega-menu-title:hover::after {
    opacity: 1 !important;
    right: 15px !important;
    color: #fff !important;
    /* White on hover for contrast */
}

/* FIXED: Arrow on column hover - only show when has submenu items */
.bpt-mega-menu-column.has-submenu-items:hover>.bpt-mega-menu-title::after {
    opacity: 1 !important;
    right: 15px !important;
    color: #fff !important;
}

/* FIXED: Arrow on active state - only show when has submenu items */
.bpt-mega-menu-column.active.has-submenu-items .bpt-mega-menu-title::after {
    opacity: 1;
    right: 15px;
    color: #fff;
}

/* FIXED: Arrow hover overrides active - only when has submenu items */
.bpt-mega-menu-column.active.has-submenu-items .bpt-mega-menu-title:hover::after {
    opacity: 1 !important;
    right: 15px !important;
    color: #fff !important;
}

/* Mega Menu Categories Container - Support hover */
.bpt-mega-menu-column {
    position: relative;
    display: block;
    width: 100%;
    cursor: pointer;
}

.bpt-mega-menu-column:hover {
    z-index: 1;
}

/* Sub-menu Container (Right Side) */
.bpt-submenu {
    display: none;
    width: 100%;
}

.bpt-submenu.active {
    display: block;
    animation: fadeInRight 0.3s ease;
}

/* Featured Image Preview */
.bpt-featured-image-preview {
    width: 50%;
    margin-bottom: 20px;
    overflow: hidden;
    background: #090F1B;
    border: 1px solid #D6B24E;
    transition: all 0.3s ease;
    pointer-events: none; /* Fix scroll issue - allow scroll events to pass through */
}

.bpt-featured-image-preview .bpt-submenu-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 0;
    pointer-events: none; /* Ensure scroll events pass through */
}

.bpt-featured-image-preview .bpt-submenu-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    pointer-events: none; /* Ensure scroll events pass through */
}

.bpt-featured-image-preview:hover .bpt-submenu-image {
    transform: scale(1.05);
}

/* Ensure submenu grid can be scrolled properly */
.bpt-submenu-grid {
    position: relative;
    z-index: 1;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sub-menu Items Grid */
.bpt-submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

/* Sub-menu Item Cards */
.bpt-submenu-item {
    background: #090F1B;
    padding: 20px;
    border: 1px solid #D6B24E;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bpt-submenu-item:hover {
    transform: translateY(-2px);
    border-color: #d6b24e;
}

/* Submenu Image Container */
.bpt-submenu-image-container {
    width: 100%;
    height: 150px;
    overflow: hidden;
    margin-bottom: 5px;
}

.bpt-submenu-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bpt-submenu-item:hover .bpt-submenu-image {
    transform: scale(1.05);
}

/* Submenu Content Container */
.bpt-submenu-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.bpt-submenu-link {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    position: relative;
}

.bpt-submenu-link:hover {
    color: #d6b24e;
}

/* Icon for submenu items that have children */
.bpt-submenu-icon {
    font-size: 14px;
    color: #d6b24e;
    margin-left: 8px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.bpt-submenu-item.has-child-items .bpt-submenu-link:hover .bpt-submenu-icon {
    opacity: 1;
    transform: translateX(3px);
    color: #d6b24e;
}

/* Ensure submenu items with children have proper spacing */
.bpt-submenu-item.has-child-items {
    border-left: 1px solid #d6b24e;
    transition: border-color 0.3s ease;
}

.bpt-submenu-item.has-child-items:hover {
    border-left-color: #d6b24e;
}

/* Active state when child menu is open */
.bpt-submenu-item.child-menu-active {
    border-left-color: #d6b24e;
}

.bpt-submenu-item.child-menu-active .bpt-submenu-icon {
    opacity: 1;
    transform: rotate(90deg);
    color: #d6b24e;
}

.bpt-submenu-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.bpt-submenu-cta {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.bpt-submenu-cta:hover {
    color: #d6b24e;
    gap: 8px;
}

.bpt-submenu-cta::after {
    font-family: 'tabler-icons';
    content: "\ea61";
    transition: transform 0.3s ease;
    font-size: 12px;
}

.bpt-submenu-cta:hover::after {
    transform: translateX(3px);
}

/* Child Menu Container */
.bpt-child-menu-container {
    display: none;
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #D6B24E;
    padding: 15px;
}

.bpt-child-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bpt-child-menu-column {
    background: #090F1B;
    padding: 15px;
    border: 1px solid #D6B24E;
    transition: all 0.3s ease;
}

.bpt-child-menu-column:hover {
    border-color: #d6b24e;
}

.bpt-child-menu-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.bpt-child-menu-title:hover {
    color: #d6b24e;
}

.bpt-child-menu-description {
    color: #999;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.bpt-child-menu-link {
    color: #666;
    font-size: 13px;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.bpt-child-menu-link:hover {
    color: #d6b24e;
}

/* Child Menu CTA Styling - matches submenu CTA */
.bpt-child-menu-cta {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.bpt-child-menu-cta:hover {
    color: #d6b24e;
    gap: 8px;
}

.bpt-child-menu-cta::after {
    font-family: 'tabler-icons';
    content: "\ea61";
    transition: transform 0.3s ease;
    font-size: 10px;
}

.bpt-child-menu-cta:hover::after {
    transform: translateX(3px);
}

/* FIXED: Show Mega Menu on Hover - Desktop - Always Center */
@media (min-width: 769px) {

    /* FIXED: CSS backup untuk immediate hover response - always center */
    .bpt-header .bpt-nav-menu .bpt-has-mega-menu:hover .bpt-mega-menu-container,
    .bpt-header .bpt-nav-menu .bpt-has-mega-menu.bpt-hover-ready:hover .bpt-mega-menu-container {
        display: block !important;
        opacity: 1 !important;
        /* FIXED: Always center regardless of which menu item */
        transform: translateX(-50%) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    /* Ensure mega menu stays open when hovering over it - always center */
    .bpt-mega-menu-container:hover {
        display: block !important;
        opacity: 1 !important;
        /* FIXED: Always center */
        transform: translateX(-50%) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    /* Remove default first item active - let JavaScript handle this */
    .bpt-mega-menu-left .bpt-mega-menu-column:first-child .bpt-mega-menu-title {
        background-color: transparent;
        color: #fff;
        padding-left: 24px;
        /* FIXED: Only add icon space if has submenu items */
        padding-right: 24px;
    }

    /* FIXED: Add padding for first item only if has submenu items */
    .bpt-mega-menu-left .bpt-mega-menu-column:first-child.has-submenu-items .bpt-mega-menu-title {
        padding-right: 50px;
    }

    .bpt-mega-menu-left .bpt-mega-menu-column:first-child .bpt-mega-menu-title::after {
        opacity: 0;
        /* Hidden by default */
        right: 20px;
        color: #D6B24E;
    }

    /* FIXED: Show icon on first item only if has submenu items */
    .bpt-mega-menu-left .bpt-mega-menu-column:first-child.has-submenu-items .bpt-mega-menu-title::after {
        opacity: 1;
    }

    /* Remove default first submenu display */
    .bpt-mega-menu-right .bpt-submenu:first-child {
        display: none;
    }

    /* Only show submenu when it has active class */
    .bpt-mega-menu-right .bpt-submenu.active {
        display: block;
        animation: fadeInRight 0.3s ease;
    }

    /* Prevent menu items from overlapping */
    .bpt-header .bpt-nav-menu>li {
        position: relative;
        z-index: 1;
    }

    .bpt-header .bpt-nav-menu>li.bpt-has-mega-menu {
        z-index: 10000;
    }

    .bpt-header .bpt-nav-menu>li.bpt-has-mega-menu:hover {
        z-index: 10001;
    }

    /* Ensure immediate hover response */
    .bpt-has-mega-menu.bpt-hover-ready {
        position: relative;
    }

    .bpt-has-mega-menu.bpt-hover-ready .bpt-mega-menu-container {
        /* FIXED: Hanya opacity dan visibility yang bertransisi */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* Force override any conflicting styles */
    .bpt-has-mega-menu.bpt-hover-ready:hover .bpt-mega-menu-container {
        display: block !important;
        visibility: visible !important;
        /* FIXED: Transform tetap */
        transform: translateX(-50%) !important;
    }
}

/* Hamburger Menu */
.bpt-hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    padding: 5px;
}

/* Menu item wrapper for mobile */
.bpt-menu-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Mega Menu toggle button */
.bpt-mega-menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    display: none;
    transition: color 0.3s ease;
}

.bpt-mega-menu-toggle:hover {
    color: #d6b24e;
}

.bpt-mega-menu-toggle .bpt-dropdown-icon {
    color: #fff;
    transition: transform 0.3s ease;
}

/* Active state for mobile */
.bpt-active .bpt-dropdown-icon {
    transform: rotate(180deg);
}

/* Mobile Styles - Disable hover effects on mobile and adjust icons */
@media (max-width: 768px) {
    .bpt-hamburger-menu {
        display: block;
    }

    .bpt-main-nav {
        display: none;
        position: absolute;
        top: 90px;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #090F1B;
        flex-direction: column;
        z-index: 999;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }

    .bpt-main-nav.bpt-active {
        display: none;
        padding: 20px;
    }

    .bpt-header .bpt-nav-menu {
        flex-direction: column;
        width: 100%;
        margin: 0;
    }

    .bpt-header .bpt-nav-menu li {
        width: 100%;
    }

    .bpt-header .bpt-nav-menu .bpt-nav-link {
        padding: 15px 0;
        text-align: left;
        flex: 1;
    }

    /* Mobile Mega Menu */
    .bpt-mega-menu-toggle {
        display: block;
    }

    .bpt-mega-menu-container {
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 10px;
        opacity: 1;
        transform: none;
        max-width: 100%;
    }

    .bpt-mega-menu-content {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: none;
    }

    .bpt-mega-menu-left {
        background-color: #f8f9fa;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .bpt-mega-menu-title {
        color: #fff;
        font-size: 16px;
        padding: 15px 20px;
        /* FIXED: Restore normal padding on mobile */
        padding-right: 20px;
    }

    /* FIXED: Hide icons on mobile or keep them visible */
    .bpt-mega-menu-title::after {
        display: none;
        /* Hide icons on mobile */
    }

    /* ALTERNATIVE: Keep icons visible on mobile with adjusted styling */
    /*
    .bpt-mega-menu-title::after {
        right: 15px;
        opacity: 1;
        color: #D6B24E;
        font-size: 14px;
    }
    */

    /* Disable hover effects on mobile */
    .bpt-mega-menu-title:hover {
        background-color: transparent !important;
        color: #fff !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .bpt-mega-menu-right {
        padding: 20px;
    }

    .bpt-submenu-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bpt-submenu-item {
        padding: 15px;
    }

    /* Remove hover effects on mobile */
    .bpt-header .bpt-nav-menu .bpt-has-mega-menu:hover .bpt-mega-menu-container {
        display: none;
    }

    /* Show mega menu when active class is added */
    .bpt-header .bpt-nav-menu .bpt-has-mega-menu.bpt-active .bpt-mega-menu-container {
        display: block;
    }

    /* Mobile submenu visibility */
    .bpt-submenu {
        display: block !important;
    }
}

/* Desktop Specific - FIXED Positioning */
@media (min-width: 769px) {
    .bpt-hamburger-menu {
        display: none;
    }

    .bpt-mega-menu-toggle {
        display: block;
    }

    /* Fixed mega menu positioning */
    .bpt-nav-item.bpt-has-mega-menu {
        position: relative;
    }

    /* FIXED: Remove dynamic positioning - always center on screen */
    .bpt-mega-menu-container {
        /* FIXED: Always center of viewport */
        position: fixed;
        top: 80px;
        /* Adjust based on header height */
        left: 50%;
        /* FIXED: Always center regardless of menu item position */
        transform: translateX(-50%);
        width: 1200px;
        /* Custom width */
        max-width: 95vw;
        margin: 0;
    }

    /* Ensure proper header layout */
    .bpt-header {
        position: relative;
        z-index: 1000;
    }

    .bpt-header .bpt-nav-menu {
        position: relative;
        z-index: 1001;
    }

    /* Fix navigation item spacing */
    .bpt-header .bpt-nav-menu>li {
        margin: 0;
        position: static;
    }

    /* Mega menu specific positioning */
    .bpt-header .bpt-nav-menu>li.bpt-has-mega-menu {
        position: relative;
    }

    /* FIXED: Ensure mega menu always center of screen */
    .bpt-mega-menu-container {
        position: fixed;
        top: 80px;
        left: 50%;
        /* FIXED: Always center of viewport */
        transform: translateX(-50%);
        margin: 0;
        z-index: 9999;
    }

    /* Prevent content jumping */
    .bpt-main-nav {
        overflow: visible;
    }
}

/* Language and CTA Styles */
.bpt-lang.bpt-cta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bpt-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

/* Focus states for accessibility */
.bpt-nav-link:focus,
.bpt-mega-menu-title:focus,
.bpt-submenu-link:focus,
.bpt-submenu-cta:focus {
    outline: 2px solid #d6b24e;
    outline-offset: 2px;
}

/* CUSTOM: Utility classes for different mega menu sizes */
.bpt-mega-menu-container.bpt-size-small {
    width: 800px;
}

.bpt-mega-menu-container.bpt-size-medium {
    width: 1000px;
}

.bpt-mega-menu-container.bpt-size-large {
    width: 1200px;
}

.bpt-mega-menu-container.bpt-size-extra-large {
    width: 1400px;
}

/* CUSTOM: Adjust top position based on header height */
.bpt-header.bpt-header-small+* .bpt-mega-menu-container {
    top: 60px;
}

.bpt-header.bpt-header-medium+* .bpt-mega-menu-container {
    top: 80px;
}

.bpt-header.bpt-header-large+* .bpt-mega-menu-container {
    top: 100px;
}