/**
 * Header Styles - Consistent Dark Theme & No Gap Fix
 * MADIAD V2 Theme
 */

/* =========================================
   SOLID BLACK HEADER
   ========================================= */

body {
    padding-top: 0;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #0a0a0a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Header when scrolled */
.site-header.scrolled {
    background: #0a0a0a;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

/* Main Header */
.main-header {
    background: transparent;
    transition: all 0.3s ease;
    padding: 20px 0;
}

.scrolled .main-header {
    padding: 15px 0;
}

/* Header Inner Container */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

/* Logo Styles - Force left */
.site-branding {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.site-branding a {
    display: inline-flex;
    align-items: center;
}

.site-branding img,
.custom-logo {
    transition: all 0.3s ease;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.scrolled .site-branding img,
.scrolled .custom-logo {
    max-height: 40px;
    width: auto;
}

/* =========================================
   HEADER ACTIONS - FORCE HAMBURGER RIGHT
   ========================================= */

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto !important;
    flex: 0 0 auto;
}

/* Force layout on all screen sizes */
@media screen and (min-width: 320px) {
    .header-inner {
        display: flex !important;
        justify-content: space-between !important;
    }
    
    .site-branding {
        order: 1 !important;
        margin-right: auto !important;
    }
    
    .header-actions {
        order: 2 !important;
        margin-left: auto !important;
    }
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: flex !important;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 12px;
    position: relative;
    z-index: 10002;
    -webkit-tap-highlight-color: transparent;
}

/* Subtle hover effect */
.menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.menu-toggle:hover::before {
    opacity: 1;
}

/* Hamburger Container */
.hamburger {
    width: 24px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Hamburger Lines */
.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #ffffff;
    border-radius: 1px;
    opacity: 1;
    left: 0;
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2) {
    top: 7px;
}

.hamburger span:nth-child(3) {
    top: 14px;
}

/* Hamburger Animation to X */
.menu-toggle.active .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   NO VISIBLE OVERLAY
   ========================================= */

.mobile-menu-overlay {
    display: none !important;
}

/* =========================================
   SLIDE MENU - PURE DARK THEME
   ========================================= */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85vw;
    max-width: 400px;
    height: 100vh;
    background: #111418; /* Pure dark background */
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100001;
    overflow: hidden;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    right: 0;
}

/* Menu Inner Container */
.mobile-menu-inner {
    padding: 80px 30px 40px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Close Button */
.mobile-menu-close {
    position: absolute;
    top: 26px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Close button X icon */
.mobile-menu-close span {
    position: absolute;
    display: block;
    height: 2px;
    width: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-close span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-close span:last-child {
    transform: rotate(-45deg);
}

.mobile-menu-close:hover span {
    background: rgba(255, 255, 255, 0.8);
}

/* =========================================
   SEARCH SECTION - DARK THEME
   ========================================= */

.menu-search-section {
    margin-bottom: 30px;
}

.search-input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-search-field {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 45px 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.menu-search-field::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.menu-search-field:focus {
    outline: none;
}

.menu-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-search-submit:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

/* =========================================
   NAVIGATION MENU - PURE DARK STYLE
   ========================================= */

.mobile-navigation {
    flex: 1;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block !important;
}

.mobile-nav-menu > li {
    margin-bottom: 2px;
}

/* Parent Menu Links - Dark Minimal Style */
.mobile-nav-menu > li > a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 400;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-menu > li > a:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 24px;
}

/* Current menu item - subtle accent */
.mobile-nav-menu > li.current-menu-item > a {
    color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

/* Submenu indicator REMOVED - Using .submenu-toggle button instead (see main.css) */
/* Old ::after method conflicts with JavaScript-generated button */

/* =========================================
   SUBMENU - DARK HIERARCHY
   ========================================= */

.mobile-nav-menu .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.mobile-nav-menu .menu-item-has-children.active .sub-menu {
    max-height: 500px;
    margin: 8px 0;
}

.mobile-nav-menu .sub-menu li {
    padding-left: 20px;
}

.mobile-nav-menu .sub-menu a {
    font-size: 0.85rem;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.mobile-nav-menu .sub-menu a:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.03);
}

/* =========================================
   MENU FOOTER - MINIMAL SOCIAL
   ========================================= */

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.menu-social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    transition: all 0.3s ease;
}

.menu-social-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* =========================================
   PAGE CONTENT SPACING - FIX GAP
   ========================================= */

/* Default padding for regular pages */
.site-content {
    padding-top: 90px;
}

/* Remove padding for pages with hero sections */
.home .site-content,
.page-template-front-page .site-content,
.page-template-services .site-content,
.blog .site-content,
.archive .site-content,
.single .site-content {
    padding-top: 0;
}

/* Hero sections should account for header height */
.hero-section,
.hero,
.page-hero,
.blog-header,
.archive-header,
.search-header,
.single-post-header {
    padding-top: 20px; /* Same as header height */
    min-height: 50vh;
    display: flex;
    align-items: center;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Desktop - smaller menu */
@media (min-width: 769px) {
    .mobile-menu {
        width: 360px;
        max-width: 360px;
        right: -360px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Adjust header height */
    .main-header {
        padding: 15px 0;
    }
    
    .site-header {
        min-height: 70px;
    }
    
    /* Adjust content spacing for mobile */
    .site-content {
        padding-top: 70px;
    }
    
    /* Hero sections on mobile */
    .home .site-content,
    .page-template-front-page .site-content {
        padding-top: 0;
    }
    
    .hero-section,
    .hero,
    .page-hero {
        padding-top: 70px; /* Match mobile header height */
        min-height: 100vh;
    }
    
    /* Logo size */
    .site-branding img,
    .custom-logo {
        max-height: 40px;
    }
    
    .scrolled .site-branding img,
    .scrolled .custom-logo {
        max-height: 35px;
    }
    
    /* Mobile menu */
    .mobile-menu {
        width: 100%;
        max-width: 100%;
        right: -100%;
        background: rgba(17, 20, 24, 0.98);
    }
    
    .mobile-menu-inner {
        padding: 70px 20px 30px;
    }
    
    /* Menu items */
    .mobile-nav-menu > li > a {
        font-size: 1.1rem;
        padding: 18px 20px;
    }
    
    .mobile-nav-menu .sub-menu a {
        font-size: 0.95rem;
    }
    
    /* Hamburger size */
    .hamburger {
        width: 22px;
        height: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mobile-nav-menu > li > a {
        font-size: 1rem;
    }
    
    .mobile-nav-menu .sub-menu a {
        font-size: 0.9rem;
    }
}

/* Body scroll lock when menu is active */
body.mobile-menu-active {
    overflow: hidden;
    /* Position and top will be set by JavaScript dynamically */
}

/* WordPress overrides */
.mobile-menu .menu,
.mobile-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide traditional navigation */
.main-navigation {
    display: none !important;
}

/* Print Styles */
@media print {
    .site-header,
    .mobile-menu {
        display: none;
    }
}
/* Header Container Protection */
.site-header .container,
.main-header .container,
.top-bar .container {
    /* Force header container styles */
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

/* Prevent service page overrides */
.service-page .site-header .container {
    /* Use same styles as above */
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}
/* =========================================
   HORIZONTAL SCROLL PREVENTION
   ========================================= */

/* Prevent body overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Ensure site wrapper doesn't overflow */
#page,
.site {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Header shouldn't cause overflow */
.site-header,
.main-header,
.header-inner {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Container responsive adjustments */
@media (max-width: 991px) {
    .site-header .container,
    .main-header .container {
        max-width: 100% !important;
        padding: 0 15px !important;
    }
}

@media (max-width: 768px) {
    .site-header .container,
    .main-header .container {
        padding: 0 10px !important;
    }
}

/* Mobile menu shouldn't cause page width issues */
.mobile-menu.active {
    position: fixed;
}

/* Prevent menu from affecting page width when closed */
body:not(.mobile-menu-active) {
    overflow-x: hidden;
}