/**
 * Site Header Styles
 * Full-width sticky header with responsive mobile menu
 */

:root {
    --header-height: 70px;
    --header-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   HEADER CONTAINER
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--header-bg);
    z-index: 9999;
    transition: var(--header-transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    height: var(--header-height);
}

body.has-site-header {
    padding-top: var(--header-height);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 15px;
    max-width: var(--container-max, 1140px);
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* ========================================
   LOGO
   ======================================== */

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 50px !important;
    width: auto;
    max-width: 180px !important;
    object-fit: contain;
    transition: var(--header-transition);
}

.logo-text {
    color: var(--header-text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ========================================
   DESKTOP NAVIGATION
   ======================================== */

.header-nav.desktop-nav {
    display: none;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
    margin: 0 20px;
}

.header-nav .primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.header-nav .primary-menu > li {
    position: relative;
}

.header-nav .primary-menu > li > a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav .primary-menu > li > a:hover,
.header-nav .primary-menu > li.current-menu-item > a {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menus */
.header-nav .primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--header-bg);
    padding: 10px 0;
    margin-top: 10px;
    min-width: 200px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.header-nav .primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-nav .primary-menu .sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.header-nav .primary-menu .sub-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
}

/* ========================================
   HEADER ACTIONS
   ======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ========================================
   MOBILE MENU TOGGLE (Hamburger)
   ======================================== */

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-box {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--header-text);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hamburger → X animation */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   MOBILE NAVIGATION
   Expands behind the header bar using max-height.
   The header-container has z-index:10, so it stays on top.
   ======================================== */

.mobile-nav {
    max-height: 0;
    height: 0;
    overflow: hidden;
    width: 100%;
    background-color: var(--header-bg);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-nav .mobile-menu {
    list-style: none;
    margin: 0;
    padding: calc(var(--header-height) + 10px) 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-nav .mobile-menu > li {
    border-bottom: none;
}

.mobile-nav .mobile-menu > li:last-child {
    border-bottom: none;
}

.mobile-nav .mobile-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav .mobile-menu > li > a:hover,
.mobile-nav .mobile-menu > li.current-menu-item > a {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--accent, #ffffff);
}

/* Mobile Submenu */
.mobile-nav .mobile-menu .sub-menu {
    list-style: none;
    padding: 0 0 8px 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav .mobile-menu li.menu-item-has-children.open > .sub-menu {
    max-height: 500px;
}

.mobile-nav .mobile-menu .sub-menu li a {
    display: block;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.mobile-nav .mobile-menu .sub-menu li a:hover {
    color: var(--header-text);
}

/* Mobile Language Selector */
.mobile-nav .jmt-mobile-lang {
    padding: 24px 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: center;
}

/* Mobile Social Links */
.mobile-social-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 24px 30px 0;
}

.mobile-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 30px 30px;
}

.mobile-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-social-link:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Desktop */
@media screen and (min-width: 1025px) {
    .header-nav.desktop-nav {
        display: flex;
    }

    .mobile-only {
        display: none !important;
    }

    .mobile-nav {
        display: none !important;
    }
}

/* Mobile/Tablet */
@media screen and (max-width: 1024px) {
    .header-nav.desktop-nav {
        display: none !important;
    }

    .menu-toggle.mobile-only {
        display: flex;
    }

    .mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: auto;
    }

    /* Hide desktop language selector — shown inside mobile menu */
    .header-actions .jmt-lang-selector {
        display: none;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .header-container {
        padding: 0 15px 0 10px;
    }

    .header-actions {
        gap: 10px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .mobile-nav .mobile-menu {
        padding-left: 24px;
        padding-right: 24px;
    }

    .mobile-nav .mobile-menu > li > a {
        font-size: 17px;
        padding: 16px 0;
    }

    .mobile-nav .jmt-mobile-lang {
        padding: 20px 24px 0;
    }

    .mobile-social-label {
        padding: 20px 24px 0;
    }

    .mobile-social {
        padding: 10px 24px 24px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.header-nav a:focus,
.menu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .logo-image,
    .hamburger-line,
    .mobile-nav,
    .primary-menu .sub-menu {
        transition: none;
    }
}
