/* WordPress Responsive Header Styles */

/* Reset and Base Styles */
.site-header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header Container */
.site-header {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
    position: relative;
}

/* Logo Styles */
.header-left.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-left.logo .custom-logo-link {
    display: flex;
    align-items: center;
}

.header-left.logo .custom-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

/* Logo Fallback Styles */
.logo-fallback {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.logo-icon span {
    color: white;
    font-weight: bold;
    font-size: 20px;
}

.logo-text a {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
    text-decoration: none;
}

.logo-text a:hover {
    color: #3b82f6;
}

/* Desktop Navigation */
.header-center.navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.desktop-nav {
    display: flex;
}

.main-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

.dropdown-icon {
    transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    width: 192px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 8px 0;
}

.dropdown:hover .dropdown-menu,
.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Header Right Icons */
.header-right {
    display: flex;
    align-items: center;
    position: relative;
}

.desktop-icons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    padding: 8px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 16px;
}

.search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Form Styles */
.search-form {
    position: relative;
    width: 100%;
}

.search-input-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Icons */
.mobile-icons {
    display: none;
    align-items: center;
    gap: 12px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.mobile-menu-btn:hover {
    background-color: #f3f4f6;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background-color: #374151;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background: white;
    border-top: 1px solid #e5e7eb;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    max-height: 500px;
    opacity: 1;
}

/* Mobile Search */
.mobile-search {
    padding: 0 16px 16px;
}

/* Mobile Navigation */
.mobile-navigation {
    padding: 0 16px;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    margin-bottom: 8px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: #374151;
    font-weight: 500;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

.mobile-dropdown-icon {
    transition: transform 0.2s ease;
}

.mobile-dropdown-icon.rotated {
    transform: rotate(180deg);
}

/* Mobile Submenu */
.mobile-submenu {
    margin-left: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.mobile-submenu.active {
    max-height: 300px;
    opacity: 1;
    margin-top: 4px;
}

.mobile-submenu-item {
    display: block;
    padding: 8px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.mobile-submenu-item:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Debug styles - remove after testing */
.mobile-submenu {
    border-left: 2px solid #e5e7eb;
}

.mobile-submenu.active {
    border-left-color: #3b82f6;
}

/* WordPress Menu Classes */
.menu-item-has-children > .nav-link::after {
    content: none;
}

.current-menu-item > .nav-link,
.current-menu-ancestor > .nav-link {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .desktop-icons {
        display: none;
    }

    .mobile-icons {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }
}

@media (max-width: 640px) {
    .header-wrapper {
        padding: 0 12px;
    }

    .logo-text {
        display: none;
    }

    .logo-icon {
        margin-right: 0;
    }

    .search-dropdown {
        width: 280px;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.icon-btn:focus,
.mobile-menu-btn:focus,
.mobile-nav-link:focus,
.search-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .site-header {
        border-bottom: 2px solid #000;
    }

    .nav-link:hover,
    .icon-btn:hover {
        background-color: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .site-header * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
