/**
 * Header & Navigation CSS - Consolidated
 * Complete header styling including navigation, search, and mobile menu
 * Version: 2.1.0 - Single Header System (Dark Navigation Bar)
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
    --nav-bg-gradient: linear-gradient(135deg, #1a1a2e, #16213e);
    --nav-dropdown-bg: rgba(0, 0, 0, 0.95);
    --nav-dropdown-hover-bg: linear-gradient(135deg, #667eea, #764ba2);
    --nav-mobile-dropdown-bg: rgba(255, 255, 255, 0.1);
    --nav-text-color: #ffffff;
    --nav-text-hover: rgba(255, 255, 255, 0.9);
    --nav-border-color: rgba(255, 255, 255, 0.1);
    --nav-hover-bg: rgba(255, 255, 255, 0.1);
    --nav-transition: 0.3s ease;
    --nav-transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --nav-border-radius: 12px;
    --nav-border-radius-sm: 8px;
    --nav-border-radius-xs: 5px;
    --nav-dropdown-min-width: 220px;
    --nav-container-width: 1200px;
    --nav-z-index: 100;
}

/* ============================================
   HEADER NAVIGATION CONTAINER (Single Dark Header)
   ============================================ */

.header-navigation {
    background: var(--nav-bg-gradient);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: var(--nav-z-index);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: var(--nav-container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo in navigation */
.nav-container .site-logo,
.nav-container .site-branding a {
    font-size: 28px;
    font-weight: 700;
    color: var(--nav-text-color);
    text-decoration: none;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.nav-container .site-logo:hover,
.nav-container .site-branding a:hover {
    opacity: 0.9;
}

/* ============================================
   NAVIGATION MENU
   ============================================ */

.primary-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu > li {
    position: relative;
    margin: 0;
}

.primary-menu > li > a {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.primary-menu > li > a:hover {
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.1);
    transform: translateY(-1px);
}

/* Active Menu Item */
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-page-ancestor > a {
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.15);
}

/* Dropdown Arrow */
.submenu-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.menu-item-has-children:hover .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenu / Dropdown - FIXED to be hidden by default */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: rgba(22, 27, 34, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 12px;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    list-style: none;
    z-index: 100;
    display: none !important; /* Hidden by default */
}

/* Show submenu on hover */
.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block !important; /* Show on hover */
}

.sub-menu li {
    margin: 0;
    list-style: none;
    display: block;
    width: 100%;
}

.sub-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sub-menu a:hover {
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.1);
    border-left-color: #00ff9d;
    padding-left: 25px;
}

/* Prevent submenu from inheriting flex */
.primary-menu .sub-menu {
    flex-direction: column !important;
}

/* ============================================
   SEARCH BUTTON IN MENU
   ============================================ */

.menu-item-search {
    margin-left: 10px;
}

.zn-header-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.zn-header-search-btn:hover {
    background: linear-gradient(135deg, #00ff9d, #00a2ff);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
}

.zn-header-search-btn svg {
    stroke: #00ff9d;
    transition: stroke 0.3s ease;
}

.zn-header-search-btn:hover svg {
    stroke: #0d1117;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
}

.mobile-nav-toggle span {
    width: 100%;
    height: 3px;
    background: #00ff9d;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when open */
.mobile-nav-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-nav-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Search Toggle Button */
.mobile-search-toggle {
    display: none;
    background: none; /* REMOVED background */
    border: none; /* REMOVED border */
    width: auto; /* REMOVED fixed width */
    height: auto; /* REMOVED fixed height */
    color: var(--nav-text-color);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px; /* Increased icon size */
    padding: 0.5rem;
}

.mobile-search-toggle:hover,
.mobile-search-toggle:active {
    background: none; /* REMOVED hover background */
    border-color: transparent;
    transform: scale(1.1); /* Only scale on hover */
    color: #00d4aa; /* Change color on hover */
}

.mobile-search-toggle i {
    pointer-events: none;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1200px) {
    .header-container {
        padding: 0 25px;
    }
    
    .primary-menu {
        gap: 5px;
    }
    
    .primary-menu > li > a {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    .primary-menu > li > a {
        padding: 10px 12px;
        font-size: 0.88rem;
    }
    
    .sub-menu {
        min-width: 200px;
    }
}

@media (max-width: 900px) {
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Force remove all top spacing */
* {
    margin: 0;
    padding: 0;
}

html {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* UNIVERSAL FIX: Remove body padding on ALL pages */
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* WordPress admin bar adjustments */
body.admin-bar .header-section {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .header-section {
        top: 46px;
    }
}

/* Header Section - sits at absolute top */
.header-section {
    position: fixed;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 255, 157, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 0 !important;
    padding: 0;
}

/* UNIVERSAL SOLUTION: Add padding to main content containers */
.site-main,
#main-content,
.lens-categories-page,
.blog-page,
.cameras-page,
.archive-main {
    padding-top: 70px !important; /* Fixed header height */
}

/* Front page uses hero with built-in padding */
.home .site-main,
.home #main-content,
.front-page .site-main,
.front-page #main-content {
    padding-top: 0 !important;
}

/* Hero sections should have NO top margin */
.blog-hero-section,
.cameras-hero-section,
.archive-hero-section,
.lens-hero-section,
.hero-section,
.front-page-hero-section,
.enhanced-hero {
    margin-top: 0 !important;
}

/* Specific hero padding adjustments */
.blog-hero-section,
.cameras-hero-section,
.archive-hero-section {
    padding-top: 120px !important; /* Internal spacing only */
}

/* Lens page hero */
.lens-hero-section {
    padding-top: 120px !important;
}

/* Front page enhanced hero */
.enhanced-hero {
    padding-top: 220px !important; /* Header (70px) + spacing (150px) */
}

/* Header Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-section {
    animation: slideDown 0.5s ease-out;
}

/* Fix for WordPress menu classes */
.menu-item-has-children .sub-menu,
.menu-item-has-children .children {
    display: none !important; /* Hidden by default */
}

.menu-item-has-children:hover .sub-menu,
.menu-item-has-children:hover .children {
    display: block !important; /* Show on hover */
}

/* Additional submenu styling */
ul.sub-menu,
ul.children {
    flex-direction: column !important;
    align-items: flex-start !important;
}
