/* ==========================================================================
   Mega Menu — Frontend stilleri
   Temel görünüm: hover ile açılan tam genişlik dropdown.
   Tema stillerinize göre özelleştirin.
   ========================================================================== */

/* --- Mega menu'yu olan üst öğe --- */
.has-megamenu {
    position: static; /* Dropdown konumlanması için gerekli */
}

/* --- Trigger bağlantısı --- */
.has-megamenu > .megamenu-trigger {
    position: relative;
}

/* Küçük ok işareti */
.has-megamenu > .megamenu-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top:   5px solid currentColor;
    border-right: 4px solid transparent;
    border-left:  4px solid transparent;
    transition: transform 0.2s ease;
}

.has-megamenu.megamenu-open > .megamenu-trigger::after {
    transform: rotate(180deg);
}

/* --- Dropdown kapsayıcı --- */
.megamenu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-top: 2px solid #e5e5e5;
}

/* Menüyü içeren nav'ı relative yap ki dropdown doğru konumlansın */
nav.has-megamenu-nav {
    position: relative;
}

/* --- Dropdown iç içerik alanı --- */
.megamenu-dropdown-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* --- Açık durum (JS ile toggle) --- */
.has-megamenu.megamenu-open > .megamenu-dropdown {
    display: block;
}

/* --- Hover ile aç (JS olmadan da çalışır) --- */
@media (hover: hover) {
    .has-megamenu:hover > .megamenu-dropdown {
        display: block;
    }
}

/* --- Erişilebilirlik: focus-within --- */
.has-megamenu:focus-within > .megamenu-dropdown {
    display: block;
}

/* --- Animasyon --- */
@keyframes megamenu-fadein {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.megamenu-dropdown {
    animation: megamenu-fadein 0.18s ease;
}

/* --- Elementor içeriği sıfırlama --- */
.megamenu-dropdown-inner .elementor-section {
    margin-bottom: 0;
}

/* --- Mobil: dropdown yatay değil dikey akış --- */
@media (max-width: 768px) {
    .megamenu-dropdown {
        position: static;
        box-shadow: none;
        border-top: none;
        border-bottom: 1px solid #e5e5e5;
    }

    .has-megamenu {
        position: relative;
    }
}
