/* ================================================
   Modern Header Menu - Nested Dropdown Tasarımı
   ================================================ */

/* Ana Menu Container */
.header-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

/* Menu Item - Ana Seviye */
.header-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.header-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #4e4d4d;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.header-menu > li > a:hover {
    color: #e7921a;
    background: #fafafa;
}



.header-menu li.menu-item-has-children:hover > a::after {
    opacity: 1;
    transform: translateY(2px);
}

/* Alt Menu (Dropdown) - 1. Seviye */
.header-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
    list-style: none;
    margin: 0;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.header-menu li:hover > .sub-menu,
.header-menu li .sub-menu:hover {
    margin:0!important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

/* Ana Menu Item için hover köprüsü - GÜNCELLE */
.header-menu > li.menu-item-has-children::after {
    content: '';
    position: absolute;
    bottom: -20px; /* Margin kadar artır */
    left: -10px;
    right: -10px;
    height: 20px; /* Margin kadar yükseklik */
    background: transparent;
    z-index: 999;
}

/* Alt Menu (Dropdown) - GÜNCELLE */
.header-menu .sub-menu {
    position: absolute;
    top: calc(100% + 12px); /* İstediğin margin kadar boşluk */
    left: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
    list-style: none;
    margin: 0;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Hover state - aynı kalsın */
.header-menu li:hover > .sub-menu,
.header-menu li .sub-menu:hover {
    margin: 0 !important; /* Bu kalabilir */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

/* Submenu'dan çıkarken delay ekle - ama çok kısa */
.header-menu .sub-menu {
    transition-delay: 0.15s;
}

.header-menu li:hover > .sub-menu {
    transition-delay: 0s;
}

/* Hover alanını genişlet - dropdown kapanmasın */
.header-menu > li.menu-item-has-children::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: -10px;
    right: -10px;
    height: 12px;
    background: transparent;
}

/* Alt Menu Item Styling */
.header-menu .sub-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.header-menu .sub-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: #666666;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.header-menu .sub-menu li a:hover {
    background: #fef7f0;
    color: #e52a20;
    padding-left: 18px;
}

/* Alt Menu için Bullet */
.header-menu .sub-menu li a::before {
    content: '•';
    color: #e7921a;
    margin-right: 8px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.2s ease;
}

.header-menu .sub-menu li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* İç İçe Alt Menu (2. ve 3. Seviye) */
.header-menu .sub-menu .sub-menu {
    top: -8px;
    left: calc(100% + 4px);
    margin: 0;
}

/* Sol tarafa açılım - sağ taraftan taşma durumunda */
.header-menu .sub-menu .sub-menu.open-left {
    left: auto;
    right: calc(100% + 4px);
    margin: 0;
}

/* Nested hover alanını GENİŞLET - Dropdown kapanmasın */
.header-menu .sub-menu li.menu-item-has-children {
    position: relative;
}

/* SAĞ tarafa açılım için hover köprüsü */
.header-menu .sub-menu li.menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    bottom: 0;
    width: 12px;
    background: transparent;
    z-index: 999;
}

/* SOL tarafa açılım için hover köprüsü */
.header-menu .sub-menu li.menu-item-has-children.has-left-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -12px;
    bottom: 0;
    width: 16px;
    background: transparent;
    z-index: 999;
}

/* Tüm seviyeler için hover koruması */
.header-menu .sub-menu li.menu-item-has-children:hover::after,
.header-menu .sub-menu li.menu-item-has-children:hover::before {
    background: transparent;
}



.header-menu .sub-menu li.menu-item-has-children:hover > a::after {
    opacity: 1;
    transform: translateX(3px);
}

/* Hover Vurgusu */
.header-menu .sub-menu li.menu-item-has-children > a {
    position: relative;
}

.header-menu .sub-menu li.menu-item-has-children > a:hover {
    background: linear-gradient(to right, #fef7f0 0%, #ffffff 100%);
}

/* 3. Seviye Nested Menu */
.header-menu .sub-menu .sub-menu .sub-menu {
    background: #fafafa;
    top: -8px;
}

.header-menu .sub-menu .sub-menu .sub-menu li a {
    font-size: 12px;
    padding: 8px 12px;
}

/* 4. ve daha derin seviyeler */
.header-menu .sub-menu .sub-menu .sub-menu .sub-menu {
    background: #f5f5f5;
}

.header-menu .sub-menu .sub-menu .sub-menu .sub-menu li a {
    font-size: 11px;
    padding: 7px 10px;
    font-weight: 400;
}

/* Dropdown Ok İşareti */
.header-menu > li > .sub-menu::before {
   display: none!important;
}



/* Active / Current Menu Item */
.header-menu .current-menu-item > a,
.header-menu .current-menu-ancestor > a,
.header-menu .current-menu-parent > a {
    color: #e7921a;
    background: #fef7f0;
}

.header-menu .sub-menu .current-menu-item > a {
    background: #fef7f0;
    color: #e52a20;
    font-weight: 600;
}

/* Animasyon - Stagger Effect */
.header-menu li:hover > .sub-menu li {
    animation: slideInMenu 0.2s ease forwards;
    opacity: 0;
}

.header-menu li:hover > .sub-menu li:nth-child(1) { animation-delay: 0.03s; }
.header-menu li:hover > .sub-menu li:nth-child(2) { animation-delay: 0.05s; }
.header-menu li:hover > .sub-menu li:nth-child(3) { animation-delay: 0.07s; }
.header-menu li:hover > .sub-menu li:nth-child(4) { animation-delay: 0.09s; }
.header-menu li:hover > .sub-menu li:nth-child(5) { animation-delay: 0.11s; }
.header-menu li:hover > .sub-menu li:nth-child(n+6) { animation-delay: 0.13s; }

@keyframes slideInMenu {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mega Menu Desteği (Geniş Dropdown) */
.header-menu > li.mega-menu > .sub-menu {
    min-width: 600px;
    max-width: 800px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.header-menu > li.mega-menu .sub-menu li {
    margin-bottom: 4px;
}

/* Separator (Ayırıcı Çizgi) */
.header-menu .sub-menu li.menu-separator {
    height: 1px;
    background: #e5e5e5;
    margin: 8px 0;
    padding: 0;
}

.header-menu .sub-menu li.menu-separator a {
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .header-menu > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .header-menu .sub-menu {
        min-width: 220px;
    }
}

@media screen and (max-width: 768px) {
    /* Mobile'da hamburger menu kullanıldığı için bu stiller gizlenir */
    .header-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .header-menu > li {
        width: 100%;
    }
    
    .header-menu > li > a {
        padding: 12px 16px;
        border-radius: 0;
    }
    
    .header-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f8f8;
        margin: 0;
        padding: 0 0 0 20px;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        pointer-events: auto;
    }
    
    .header-menu li.menu-item-has-children.mobile-open > .sub-menu {
        max-height: 2000px;
        padding: 8px 0 8px 20px;
    }
    
    .header-menu .sub-menu .sub-menu {
        left: 0;
        margin: 0;
        padding-left: 16px;
        background: #f0f0f0;
    }
    
    .header-menu .sub-menu::before {
        display: none;
    }
    
    /* Remove pseudo elements on mobile */
    .header-menu > li.menu-item-has-children::after,
    .header-menu .sub-menu li.menu-item-has-children::after {
        display: none;
    }

    
    .header-menu li.menu-item-has-children.mobile-open > a::after {
        transform: rotate(180deg);
    }
}

/* Accessibility - Klavye Navigasyonu */
.header-menu a:focus {
    outline: 2px solid #e7921a;
    outline-offset: 2px;
}

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

/* Ana menü - Normal header için */
.header-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #273044; /* Body font rengi ile aynı */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.header-menu > li > a:hover {
    color: #E7921A; /* Turuncu hover */
    background: #fafafa;
}

/* Active Menu Item */
.header-menu .current-menu-item > a,
.header-menu .current-menu-ancestor > a,
.header-menu .current-menu-parent > a {
    color: #E7921A; /* Active state turuncu */
    background: #fef7f0;
}

/* ================================================
   TRANSPARENT HEADER DESTEĞI
   ================================================ */

.transparent_header .header-menu > li > a {
    color: #ffffff !important; /* Beyaz metin */
}

.transparent_header .header-menu > li > a:hover {
    color: #E7921A !important; /* Turuncu hover */
    background: rgba(255, 255, 255, 0.15);
}

.transparent_header .header-menu .current-menu-item > a,
.transparent_header .header-menu .current-menu-ancestor > a,
.transparent_header .header-menu .current-menu-parent > a {
    color: #E7921A !important;
    background: rgba(255, 255, 255, 0.2);
}
/* Print */
@media print {
    .header-menu .sub-menu {
        display: none;
    }
}

/* Ana menü - Normal header için */
.header-menu > li > a {
    color:#273044!important;
}

.header-menu > li > a:hover {
    color: #E7921A!important;
    background: transparent; /* Arka plan yok */
}

/* Active Menu Item */
.header-menu .current-menu-item > a,
.header-menu .current-menu-ancestor > a,
.header-menu .current-menu-parent > a {
    color: #E7921A;
    background: transparent;
}
/* ================================================
   TRANSPARENT HEADER DESTEĞI
   ================================================ */

/* Transparent Header - Sadece ana menü beyaz olsun */
.transparent_header .header-menu > li > a {
    color: #ffffff !important; /* Beyaz metin */
}

.transparent_header .header-menu > li > a:hover {
    color: #E7921A !important; /* Turuncu hover */
    background: transparent !important; /* Arka plan yok */
}

/* Transparent Header - Active Menu Item */
.transparent_header .header-menu .current-menu-item > a,
.transparent_header .header-menu .current-menu-ancestor > a,
.transparent_header .header-menu .current-menu-parent > a {
    color: #E7921A !important;
    background: transparent !important; /* Arka plan yok */
}

/* Dropdown arrow beyaz olsun transparent'ta */
.transparent_header .header-menu li.menu-item-has-children > a::after {
    border-top-color: #ffffff !important;
}

/* Dropdown'lar her zaman beyaz kalsın */
.transparent_header .header-menu .sub-menu {
    background: #ffffff !important;
}

.transparent_header .header-menu .sub-menu li a {
    color: #666666 !important; /* Dropdown içi koyu */
}
/* Smooth Scrolling için */
.header-menu a {
    scroll-behavior: smooth;
}

/* Özel İkonlar için Alan */
.header-menu .menu-item-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e7921a;
}

.header-menu .sub-menu .menu-item-icon {
    width: 16px;
    height: 16px;
}

