/**
 * Header alt menü — sade panel, ikon ve hover
 */

/* ── Menü link yapısı ── */
.header-menu-list .menu-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
}

.header-menu-list .menu-link__content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.header-menu-list .menu-link__text {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Ana menü ikonları */
.header-menu-list > li.nav-depth-0 > a.menu-link .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    flex-shrink: 0;
    color: var(--accent-primary);
    opacity: 0.9;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.header-menu-list > li.nav-depth-0 > a.menu-link .menu-icon svg {
    width: 1.0625rem;
    height: 1.0625rem;
}

.header-menu-list > li.nav-depth-0 > a.menu-link:hover .menu-icon,
.header-menu-list > li.nav-depth-0.dropdown-open > a.menu-link .menu-icon {
    opacity: 1;
    color: var(--accent-primary);
}

/* ── 1. seviye alt menü paneli ── */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu {
    min-width: 252px;
    max-width: 300px;
    padding: 0.4rem;
    border-radius: 14px;
    background: var(--content-bg) !important;
    border: 1px solid var(--border-color-light) !important;
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.1),
        0 4px 14px rgba(15, 23, 42, 0.05) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu {
    background: var(--bg-secondary, var(--header-bg)) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li {
    margin: 0.1rem 0;
}

/* Alt menü satırları */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a.menu-link,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.65rem !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: none !important;
    box-shadow: none !important;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a::before,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a::after {
    display: none !important;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link__content {
    flex: 1;
    min-width: 0;
    gap: 0.55rem;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* İkonlar — düz stroke */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a.menu-link .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu li a.menu-link .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a .menu-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.125rem !important;
    height: 1.125rem !important;
    min-width: 1.125rem !important;
    min-height: 1.125rem !important;
    flex-shrink: 0;
    padding: 0;
    border: none !important;
    border-radius: 0 !important;
    background: none !important;
    color: var(--text-muted) !important;
    opacity: 1 !important;
    box-shadow: none !important;
    transition: color 0.18s ease;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a.menu-link .menu-icon svg,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu li a.menu-link .menu-icon svg,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a .menu-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    stroke: currentColor;
    fill: none;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link__content:not(:has(.menu-icon))::before {
    content: '';
    display: inline-block;
    width: 0.35rem;
    height: 0.35rem;
    min-width: 0.35rem;
    margin-right: 0.15rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-primary) 45%, var(--text-muted));
    opacity: 0.65;
}

/* Hover */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link:hover,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a:hover,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.menu-item-has-children.submenu-open > .menu-link,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li:has(.sub-menu).submenu-open > .menu-link,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.submenu-open > a {
    color: var(--accent-primary) !important;
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--content-bg)) !important;
    border-color: color-mix(in srgb, var(--accent-primary) 18%, transparent) !important;
    transform: none !important;
    box-shadow: none !important;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link:hover .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a:hover .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.submenu-open > .menu-link .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.menu-item-has-children.submenu-open .menu-link .menu-icon {
    color: var(--accent-primary) !important;
    background: none !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link:hover,
[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a:hover,
[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.submenu-open > .menu-link {
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent) !important;
    border-color: color-mix(in srgb, var(--accent-primary) 22%, transparent) !important;
}

/* Chevron */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.35;
    color: var(--text-muted);
    transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link__chevron svg {
    width: 0.75rem;
    height: 0.75rem;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu .menu-link:hover .menu-link__chevron,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.submenu-open .menu-link__chevron {
    opacity: 0.85;
    color: var(--accent-primary);
    transform: translateX(1px);
}

/* Aktif öğe */
.header-menu-list .sub-menu .current-menu-item > .menu-link,
.header-menu-list .sub-menu .current-menu-ancestor > .menu-link,
.header-menu-list .sub-menu .current-menu-item > a,
.header-menu-list .sub-menu .current-menu-ancestor > a {
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
    background: color-mix(in srgb, var(--accent-primary) 10%, var(--content-bg)) !important;
    border-color: color-mix(in srgb, var(--accent-primary) 22%, transparent) !important;
}

.header-menu-list .sub-menu .current-menu-item > .menu-link .menu-icon,
.header-menu-list .sub-menu .current-menu-ancestor > .menu-link .menu-icon,
.header-menu-list .sub-menu .current-menu-item > a .menu-icon,
.header-menu-list .sub-menu .current-menu-ancestor > a .menu-icon {
    color: var(--accent-primary) !important;
}

/* ── 2. seviye panel ── */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > ul.sub-menu {
    min-width: 232px;
    max-width: 280px;
    padding: 0.35rem;
    border-radius: 12px;
    background: var(--content-bg) !important;
    border: 1px solid var(--border-color-light) !important;
    box-shadow:
        0 12px 36px rgba(15, 23, 42, 0.1),
        0 4px 12px rgba(15, 23, 42, 0.05) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu,
[data-theme="dark"] .header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > ul.sub-menu {
    background: var(--bg-secondary, var(--header-bg)) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.32),
        0 4px 12px rgba(0, 0, 0, 0.18) !important;
}

/* 2. seviye satırlar */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li.menu-item-has-children > .sub-menu li a,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li:has(.sub-menu) > .sub-menu li a,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > ul.sub-menu li a,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu li a.menu-link {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.8125rem !important;
    border-radius: 9px !important;
    border: 1px solid transparent !important;
    transform: none !important;
}

.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > .sub-menu li a:hover,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu > li > ul.sub-menu li a:hover {
    color: var(--accent-primary) !important;
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--content-bg)) !important;
    border-color: color-mix(in srgb, var(--accent-primary) 18%, transparent) !important;
    font-weight: 500 !important;
}

/* header.css ikon scale override */
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a .menu-icon,
.header-menu-list > li:not(.mega-menu):not([data-mega="true"]) > .sub-menu li a:hover .menu-icon {
    transform: none !important;
    opacity: 1 !important;
}
