/* Custom header search modal styles */
.custom-header-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(20, 20, 20, 0.98);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.custom-header-search-modal.active {
    display: flex;
}

.custom-header-search-modal-content {
    background: none;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 120px;
}

.custom-header-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 48px 0 0;
}

.custom-header-search-form-icon {
    font-size: 2.2rem;
    color: #fff;
    margin-right: 18px;
    margin-left: 18px;
    opacity: 0.8;
}

.custom-header-search-input {
    flex: 1;
    font-size: 2rem;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    padding: 0 0 0 0;
    height: 80px;
    font-weight: 400;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.custom-header-search-input::placeholder {
    color: #aaa;
    opacity: 1;
    font-size: 1.2rem;
}

.custom-header-search-close {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.8;
    z-index: 2;
    padding: 0 8px;
    line-height: 1;
    transition: opacity 0.2s;
}

.custom-header-search-close:hover {
    opacity: 1;
}

/* Remove left padding from menu items for tighter spacing */
ul.header-menu>li {
    padding: 0;
    /* padding: 0 0 0 2.125em; */
}

/* Highlight current active menu item */
.header-nav .header-menu li.current-menu-item>a,
.header-nav .header-menu li.current-menu-ancestor>a {
    background: #f3f3f3 !important;
    color: #181818 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Remove left-side arrows from menu items in custom header */
.header-nav .header-menu li::before,
.header-nav .header-menu li.menu-item::before,
.header-nav .header-menu li.menu-item-type-post_type.menu-item-object-page::before {
    display: none !important;
    content: none !important;
}

/* Dropdown submenu styles: make submenu items fill most of the dropdown container */
.header-nav .header-menu li ul.sub-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    background: #181818;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    /* tighter padding so items can take up more space */
    padding: 12px;
    margin: 0;
    z-index: 999;
    list-style: none;
    /* allow the menu to size based on content but let children stretch */
    width: auto;
}

.header-nav .header-menu li:hover>ul.sub-menu {
    display: block;
}

.header-nav .header-menu li ul.sub-menu li {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Add a small gap between stacked items */
.header-nav .header-menu li ul.sub-menu li+li {
    margin-top: 8px;
}

/* Make anchors use the full available width and look like cards */
.header-nav .header-menu li ul.sub-menu li a {
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 1.00em;
    font-weight: 400;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.18s, color 0.18s, transform 0.12s;
    box-shadow: none;
}

/* Ensure inner text spans take remaining space if present */
.header-nav .header-menu li ul.sub-menu li a .menu-item-text {
    flex: 1 1 auto;
}

.header-nav .header-menu li ul.sub-menu li a:hover {
    background: rgba(0, 255, 255, 0.06);
    color: #00FFFF;
    transform: translateY(-2px);
}

/* Basic header styles for the [header_custom] shortcode */
.header-custom {
    background: #1a1a1a;
    color: #ffffff;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    transition: background 0.2s;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

/* Center the menu, keep icons right */
.header-center-flex {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-icons-container {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: 18px;
}

.header-icon.search-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s;
}

.header-icon.search-trigger svg {
    display: block;
    width: 24px;
    height: 24px;
}

.header-icon.search-trigger:hover {
    background: rgba(0, 255, 255, 0.08);
}

.header-icon.header-button-container {
    display: flex;
    align-items: center;
}

.aiero-button {
    display: inline-flex;
    align-items: center;
    padding: 0.6em 2em;
    border: 2px solid #00FFFF;
    border-radius: 2em;
    background: none;
    color: #fff;
    font-weight: 600;
    font-size: 1.08em;
    text-decoration: none;
    position: relative;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.aiero-button .button-inner {
    display: none;
}

.aiero-button:hover {
    background: rgba(0, 255, 255, 0.08);
    color: #00FFFF;
    box-shadow: 0 2px 12px rgba(0, 255, 255, 0.18);
}

/* Add space for fixed header so content is not hidden */
.header-spacer {
    height: 90px;
    width: 100%;
    display: block;
}

.header-branding .header-logo img {
    max-height: 56px;
    width: auto;
    display: block;
}

.header-site-title {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
}

.header-nav .header-menu {
    list-style: none;
    display: flex;
    gap: 0px;
    /* Reduced from 28px to 16px */
    margin: 0;
    padding: 0;
    align-items: center;
}

.header-nav .header-menu li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45em 1.1em;
    border-radius: 0.7em;
    background: transparent;
    /* remove the always-on subtle shadow */
    box-shadow: none;
    transition: box-shadow 0.3s, background 0.3s, color 0.2s, transform 0.5s cubic-bezier(.68, -0.55, .27, 1.55);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Subtle down arrow for menu items with children */
.header-nav .header-menu li>a .menu-arrow {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 2px;
    vertical-align: middle;
    background: none;
    position: relative;
}

.header-nav .header-menu li>a .menu-arrow::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #aaa;
    border-right: 2px solid #aaa;
    border-radius: 1px;
    transform: rotate(45deg);
    opacity: 0.7;
    transition: transform 0.4s cubic-bezier(.68, -0.55, .27, 1.55), border-color 0.2s;
    margin: 0 auto;
    margin-top: 2px;
}

/* Rolling effect on hover (like a watch hand) */
.header-nav .header-menu li:hover>a .menu-arrow::before,
.header-nav .header-menu li:focus-within>a .menu-arrow::before {
    transform: rotate(225deg) scale(1.2);
    border-color: #00FFFF;
    opacity: 1;
}

.header-mobile-toggle {
    display: none;
    background: none;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile: collapse the menu and show toggle */
@media only screen and (max-width: 900px) {
    .header-mobile-toggle {
        display: inline-block;
    }

    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #111;
        display: none;
        padding: 12px 24px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    }

    .header-nav.open {
        display: block;
    }

    .header-nav .header-menu {
        flex-direction: column;
        gap: 12px;
    }
}



/* 3D box rolling effect for menu item on hover */
.header-nav .header-menu li:hover>a,
.header-nav .header-menu li:focus-within>a {
    transform: rotateY(24deg) scale(1.08);
    background: rgba(0, 255, 255, 0.08);
    box-shadow: 0 6px 24px rgba(0, 255, 255, 0.12);
    color: #00FFFF;
}

.header-nav .header-menu li a:hover {
    opacity: 0.95;
}

/* Utility */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Mega Menu Styles */
.header-nav .header-menu li.has-mega-menu {
    position: relative;
}

.mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 24px 24px 0 24px;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    min-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.header-nav .header-menu li.has-mega-menu:hover .mega-menu-dropdown,
.header-nav .header-menu li.has-mega-menu.mega-menu-open .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
}

.mega-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mega-menu-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.mega-menu-card:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 255, 255, 0.2);
}

.mega-menu-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.mega-menu-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mega-menu-card-title {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    color: #fff;
    font-family: 'Gtek Technology', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0) 100%);
    padding: 12px 12px 10px 12px;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    pointer-events: none;
    text-align: left;
}

.mega-menu-card-highlight {
    background: rgba(107, 70, 193, 0.2);
    border-color: rgba(107, 70, 193, 0.5);
}

.mega-menu-card-highlight:hover {
    background: rgba(107, 70, 193, 0.3);
    border-color: rgba(107, 70, 193, 0.8);
}

.mega-menu-footer {
    text-align: center;
    padding: 0px 0;
    border-top: 1px solid rgba(0, 255, 255, 0.1);
}

.mega-menu-view-all {
    color: #00FFFF;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.mega-menu-view-all:hover {
    opacity: 0.8;
}

/* Responsive mega menu */
@media only screen and (max-width: 900px) {
    .mega-menu-dropdown {
        position: static;
        transform: none;
        min-width: auto;
        width: 100%;
        margin-top: 8px;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .header-nav .header-menu li.has-mega-menu.mega-menu-open .mega-menu-dropdown {
        display: block;
    }

    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media only screen and (max-width: 600px) {
    .mega-menu-grid {
        grid-template-columns: 1fr;
    }
}