/**
 * Modern Navigation Design
 * Clean, modern header with animated underlines and dropdowns
 */

/* Header Container - Sticky with shadow */
.wp-block-group.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 0 !important;
    position: sticky;
    top: 0;
    z-index: 9999 !important;
    transition: all 0.3s ease;
    overflow: visible !important;
}

/* Header Inner Wrapper */
.site-header > .wp-block-group {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    overflow: visible !important;
}

/* Logo Styling */
.site-header .wp-block-site-logo img {
    height: auto !important;
    max-width: 130px !important;
    width: 130px !important;
    transition: all 0.3s ease;
}

/* Navigation Links - Clean spacing */
.site-header .wp-block-navigation-item__content {
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 500;
    padding: 1rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

/* Animated Underline on Hover */
.site-header .wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: #ff6b35;
    transition: transform 0.3s ease;
}

.site-header .wp-block-navigation-item__content:hover {
    color: #ff6b35;
}

.site-header .wp-block-navigation-item__content:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Dropdown Styling - Modern card */
.site-header .wp-block-navigation__submenu-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 220px;
    margin-top: 0.5rem;
}

/* Submenu Items */
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    padding: 0.75rem 1.5rem;
    color: #2c3e50;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after {
    display: none;
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background: #f8f9fa;
    border-left-color: #ff6b35;
    padding-left: 1.75rem;
}

/* Contact Button Style */
.site-header .wp-block-navigation-item:last-child .wp-block-navigation-item__content {
    background: #ff6b35;
    color: #ffffff;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    margin-left: 1rem;
    font-weight: 600;
}

.site-header .wp-block-navigation-item:last-child .wp-block-navigation-item__content::after {
    display: none;
}

.site-header .wp-block-navigation-item:last-child .wp-block-navigation-item__content:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    position: relative;
}

.hamburger-icon .line {
    width: 100%;
    height: 3px;
    background-color: #1a1a1a;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger Animation when Active */
.mobile-menu-toggle.active .hamburger-icon .line:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon .line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon .line:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        max-height: 60px !important;
        height: auto !important;
    }
    
    .site-header > * {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .site-header > .wp-block-group,
    .site-header .wp-block-group {
        padding: 0.5rem 1rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        align-items: center !important;
        margin: 0 !important;
        min-height: auto !important;
        max-height: 60px !important;
        height: auto !important;
    }
    
    /* Override WordPress preset spacing aggressively */
    .site-header .alignwide,
    .site-header [class*="wp-block"],
    .site-header [class*="wp-container"] {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Target the specific flex container with inline styles */
    .site-header .is-layout-flex,
    .site-header .is-content-justification-space-between,
    .site-header [style*="padding-top"],
    .site-header [style*="padding-bottom"] {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .site-header .wp-block-site-logo {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .site-header .wp-block-site-logo img {
        max-width: 120px !important;
        width: 120px !important;
        height: auto !important;
        margin: 0 !important;
        display: block !important;
    }
    
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide navigation by default on mobile */
    .main-navigation {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 60px);
        background: #ffffff;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 9998;
        padding-top: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Show navigation when active */
    .main-navigation.active {
        right: 0;
    }
    
    /* Mobile menu overlay */
    .main-navigation::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
        z-index: -1;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    
    .main-navigation.active::before {
        opacity: 1;
        pointer-events: auto;
        left: -100vw;
    }
    
    /* Stack navigation items vertically */
    .nav-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .nav-item:first-child {
        border-top: 1px solid #e5e7eb;
    }
    
    .nav-item > a {
        display: flex;
        align-items: center;
        padding: 1.125rem 1.5rem;
        color: #1a1a1a;
        font-weight: 500;
        font-size: 15px;
        text-decoration: none;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .nav-item > a:hover,
    .nav-item > a:active {
        background: #f8f9fa;
        color: #ff6b35;
        padding-left: 2rem;
    }
    
    /* Mobile submenu styling */
    .nav-item.has-submenu > a {
        position: relative;
        padding-right: 3.5rem;
    }
    
    .nav-item.has-submenu > a::after {
        content: '▼';
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
        color: #6b7280;
    }
    
    .nav-item.has-submenu.submenu-open > a::after {
        transform: translateY(-50%) rotate(180deg);
        color: #ff6b35;
    }
    
    .nav-item.has-submenu.submenu-open > a {
        background: #f8f9fa;
        color: #ff6b35;
    }
    
    .submenu {
        display: none;
        background: #f1f3f5;
        padding: 0;
        margin: 0;
        list-style: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .submenu.active {
        display: block;
        max-height: 1000px;
    }
    
    .submenu-item {
        border-bottom: 1px solid #dee2e6;
    }
    
    .submenu-item:last-child {
        border-bottom: none;
    }
    
    .submenu-item a {
        display: flex;
        align-items: center;
        padding: 0.875rem 1.5rem 0.875rem 2.5rem;
        color: #495057;
        font-size: 14px;
        text-decoration: none;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .submenu-item a::before {
        content: '•';
        position: absolute;
        left: 1.75rem;
        color: #adb5bd;
        font-size: 18px;
    }
    
    .submenu-item a:hover,
    .submenu-item a:active {
        background: #ffffff;
        color: #ff6b35;
        padding-left: 3rem;
    }
    
    .submenu-item a:hover::before {
        color: #ff6b35;
        left: 2.25rem;
    }
    
    /* Remove hover effects on mobile */
    .site-header .wp-block-navigation-item__content::after {
        display: none;
    }
}

@media (min-width: 769px) {
    /* Hide toggle button on desktop */
    .mobile-menu-toggle {
        display: none !important;
    }
}
