/* ==================== NAVBAR ZEN - MOBILE FIXED ==================== */

/* Base Navbar */
.navbar-zen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Transparent navbar untuk hero page (Home & Subpages) */
body:has(.hero-video-section) .navbar-zen,
body:has(.page-hero) .navbar-zen {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

body:has(.hero-video-section) .navbar-zen.scrolled,
body:has(.page-hero) .navbar-zen.scrolled {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* White text untuk navbar di hero */
body:has(.hero-video-section) .navbar-zen:not(.scrolled) .navbar-menu a,
body:has(.hero-video-section) .navbar-zen:not(.scrolled) .nav-link-light,
body:has(.hero-video-section) .navbar-zen:not(.scrolled) .logo-text,
body:has(.page-hero) .navbar-zen:not(.scrolled) .navbar-menu a,
body:has(.page-hero) .navbar-zen:not(.scrolled) .nav-link-light,
body:has(.page-hero) .navbar-zen:not(.scrolled) .logo-text {
    color: white;
}

body:has(.hero-video-section) .navbar-zen:not(.scrolled) .btn-zen-primary,
body:has(.page-hero) .navbar-zen:not(.scrolled) .btn-zen-primary {
    background: white;
    color: var(--primary);
    border-color: white;
}

body:has(.hero-video-section) .navbar-zen:not(.scrolled) .mobile-toggle,
body:has(.page-hero) .navbar-zen:not(.scrolled) .mobile-toggle {
    color: white;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1c1917;
    font-weight: 600;
    z-index: 1001;
}

.navbar-logo img {
    height: 70px;
    width: auto;
    transition: opacity 0.3s ease;
}

/* Default state (for non-hero pages): Show colored logo, hide white logo */
.logo-white { display: none; }
.logo-color { display: block; }

/* Hero Page Initial State (Transparent Navbar) */
/* Show White Logo, Hide Color Logo */
body:has(.hero-video-section) .navbar-zen:not(.scrolled) .logo-white,
body:has(.page-hero) .navbar-zen:not(.scrolled) .logo-white {
    display: block;
}
body:has(.hero-video-section) .navbar-zen:not(.scrolled) .logo-color,
body:has(.page-hero) .navbar-zen:not(.scrolled) .logo-color {
    display: none;
}

/* Hero Page Scrolled State (White Navbar) */
/* Revert to Default: Hide White Logo, Show Color Logo */
body:has(.hero-video-section) .navbar-zen.scrolled .logo-white,
body:has(.page-hero) .navbar-zen.scrolled .logo-white {
    display: none;
}
body:has(.hero-video-section) .navbar-zen.scrolled .logo-color,
body:has(.page-hero) .navbar-zen.scrolled .logo-color {
    display: block;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.3s ease;
}

/* Desktop Menu */
.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu li {
    margin: 0;
}

.navbar-menu a {
    text-decoration: none;
    color: #44403c;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

.navbar-menu a:hover {
    color: var(--primary);
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.25s ease;
}

.navbar-menu a:hover::after {
    width: 100%;
}

/* Desktop Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link-light {
    font-size: 0.875rem;
    color: #78716c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link-light:hover {
    color: var(--primary);
}

.btn-zen-primary {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-zen-primary:hover {
    background: transparent;
    color: var(--primary);
}

/* Mobile Elements */
.mobile-only {
    display: none;
}

/* Mobile Toggle - CRITICAL FIX */
.mobile-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary);
    z-index: 1001;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
    /* CRITICAL: Make sure it's clickable */
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.mobile-toggle:active {
    transform: scale(0.95);
    background: rgba(0, 29, 95, 0.1);
    border-radius: 8px;
}

.mobile-toggle i {
    font-size: 28px;
}

/* Mobile Menu Overlay - FIXED */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3); /* Slightly more transparent */
    z-index: 998;
    backdrop-filter: blur(4px); /* Lighter blur for better performance */
    -webkit-backdrop-filter: blur(4px); /* Safari support */
}

/* Mobile Menu Drawer - FIXED */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background: #ffffff;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /* CRITICAL: Hardware acceleration */
    transform: translateZ(0);
    will-change: transform;
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #78716c;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    /* CRITICAL: Ensure clickability */
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.mobile-close:hover {
    background: #f5f5f4;
    color: var(--primary);
}

.mobile-close:active {
    transform: scale(0.95);
}

.mobile-close i {
    font-size: 24px;
}

/* Mobile Nav Links */
.mobile-nav {
    list-style: none;
    margin: 0;
    padding: 1.5rem 0;
    flex: 1;
}

.mobile-nav li {
    margin: 0;
}

.mobile-nav a {
    display: block;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    color: #1c1917;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    /* CRITICAL: Ensure touch target */
    min-height: 48px;
    display: flex;
    align-items: center;
}

.mobile-nav a:active {
    background: #f8f9fa;
    border-left-color: var(--primary);
    color: var(--primary);
}

/* Mobile Actions */
.mobile-actions {
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fafafa;
}

.mobile-actions .btn-zen-primary {
    width: 100%;
    text-align: center;
    display: block;
    padding: 1rem;
    min-height: 48px;
}

.mobile-actions .nav-link-light {
    text-align: center;
    display: block;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #78716c !important; /* Force color to be visible on white bg */
}

/* Alpine x-cloak */
[x-cloak] {
    display: none !important;
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 769px) {
    .mobile-toggle,
    .mobile-menu-overlay,
    .mobile-menu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
    
    .mobile-toggle {
        display: flex !important;
    }
    
    .navbar-container {
        padding: 0.75rem 1rem;
        height: 70px;
    }
    
    .navbar-logo img {
        height: 48px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 85%;
    }
    
    .navbar-container {
        padding: 0.75rem 0.75rem;
    }
    
    .logo-text {
        display: none;
    }
}

/* iOS Safari fix for touch targets */
@supports (-webkit-touch-callout: none) {
    .mobile-toggle,
    .mobile-close,
    .mobile-nav a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}