/* ================================================================
   Mega Menü - Aida Theme
   Yapı: .has-mega-menu > .mega-menu > .mega-menu-inner
           ├── .mega-menu-nav       (sol — depth-1 kategoriler)
           ├── .mega-menu-content   (orta — depth-2 öğe kartları)
           └── .mega-menu-banners   (sağ — 2 banner)
   ================================================================ */

/* ── Tetikleyici: üst menü öğesi ── */
.main-navigation .nav-menu > li.has-mega-menu {
    position: static;
}

/* ── Mega menü paneli ── */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 12px 40px rgba(11, 3, 26, 0.12);
    border-top: 2px solid var(--primary-color);
    z-index: 999;
    animation: mmFadeIn 0.18s ease;
}

/* Hover köprüsü: nav öğesi ile mega menü arasındaki boşluğu kapatan şeffaf alan */
.mega-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

@keyframes mmFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.has-mega-menu:hover > .mega-menu {
    display: block;
}

/* ── İç konteyner ── */
.mega-menu-inner {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 320px;
}

/* ================================================================
   Sol nav — depth-1 kategoriler
   ================================================================ */
.mega-menu-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    background: #faf9fb;
    border-right: 1px solid var(--gray-color);
    padding: 0px!important;
}

.mega-menu-nav-item {
    display: flex!important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px!important;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--gray-color);
    transition: var(--transition)!important;
    cursor: pointer;
}

.mega-menu-nav-item:last-child {
    border-bottom: none;
}

.mega-menu-nav-item:hover,
.mega-menu-nav-item.active {
    background: #fff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.mega-menu-nav-item svg {
    flex-shrink: 0;
    opacity: 0.4;
    transition: var(--transition);
}

.mega-menu-nav-item.active svg,
.mega-menu-nav-item:hover svg {
    opacity: 1;
    color: var(--primary-color);
}

/* ================================================================
   Orta içerik — depth-2 öğe kartları
   ================================================================ */
.mega-menu-content {
    flex: 1;
    padding: 24px 28px;
    overflow: hidden;
}

.mega-menu-group {
    display: none;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-content: flex-start;
}

.mega-menu-group.active {
    display: flex;
}

/* Öğe kartı */
.mega-menu-item {
    display: flex!important;
    flex-direction: column;
    width: calc(50% - 8px);
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.mega-menu-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    transition: var(--transition);
}

.mega-menu-item:hover .mega-menu-item-title {
    color: var(--primary-color);
}

.mega-menu-item-desc {
    font-size: 14px;
    color: #888;
    line-height: 1.4;
    margin-top: 3px;
}

/* ================================================================
   Sağ panel — Bannerlar (maks. 2)
   ================================================================ */
.mega-menu-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 240px;
    flex-shrink: 0;
    padding: 16px;
    border-left: 1px solid var(--gray-color);
}

.mega-menu-banners a {
    padding: 0 !important;
}

.mega-menu-banner {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    flex: 1;
    transition: var(--transition);
}

.mega-menu-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 55, 114, 0.18);
}

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

.mega-menu-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(11, 3, 26, 0.75));
    padding: 24px 12px 10px;
}

.mega-menu-banner-title {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.mega-menu-banner-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    margin-top: 3px;
}

/* ================================================================
   Mobil — Desktop mega menü gizle, mobile accordion göster
   ================================================================ */

/* Desktop'ta mega-menu-mobile görünmez */
.mega-menu-mobile {
    display: none;
}

@media (max-width: 992px) {

    /* Desktop mega menü panelini tamamen gizle */
    .has-mega-menu > .mega-menu {
        display: none !important;
    }

    /*
     * Mobile accordion — display:block sabit, max-height ile aç/kapat
     * (display:none→block geçişinde transition çalışmaz, sub-menu yaklaşımı kullanılır)
     */
    .has-mega-menu > .mega-menu-mobile {
        display: block !important;
        list-style: none;
        margin: 0;
        padding: 0 0 0 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .has-mega-menu.active > .mega-menu-mobile {
        max-height: 3000px;
    }

    /* ── Depth-1 kategori satırları ── */
    .mm-mobile-cat {
        border-bottom: 1px solid var(--gray-color);
    }

    .mm-mobile-cat:last-child {
        border-bottom: none;
    }

    /* Toggle butonu (çocuğu olan depth-1) */
    .mm-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 13px 0;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font-primary);
        font-size: 16px;
        font-weight: 500;
        color: var(--text-color);
        text-align: left;
    }

    .mm-mobile-toggle:hover {
        color: var(--primary-color);
    }

    .mm-chevron {
        flex-shrink: 0;
        transition: transform 0.25s ease;
    }

    .mm-mobile-cat.open > .mm-mobile-toggle .mm-chevron {
        transform: rotate(180deg);
    }

    /* Direkt link (çocuğu olmayan depth-1) */
    .mm-mobile-link {
        display: block;
        padding: 13px 0;
        font-size: 16px;
        font-weight: 500;
        color: var(--text-color);
        text-decoration: none;
    }

    .mm-mobile-link:hover {
        color: var(--primary-color);
    }

    /* ── Depth-2 sub liste ── */
    .mm-mobile-sub {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0 0 8px 12px;
    }

    .mm-mobile-cat.open > .mm-mobile-sub {
        display: block;
    }

    .mm-mobile-sub li {
        border-bottom: none;
    }

    /* Depth-2 linkler */
    .mm-mobile-item {
        display: block;
        padding: 9px 0;
        font-size: 15px;
        color: #555;
        text-decoration: none;
        border-bottom: 1px solid #f0eef5;
    }

    .mm-mobile-sub li:last-child .mm-mobile-item {
        border-bottom: none;
    }

    .mm-mobile-item:hover {
        color: var(--primary-color);
    }
}

/* ================================================================
   Mobil Navigasyon — Ayrı menü (mega menüden bağımsız)
   ================================================================ */

/* Desktop'ta gizle */
#mobile-navigation {
    display: none;
}

@media (max-width: 992px) {

    /* Desktop mega menüyü mobilde gizle */
    .main-navigation {
        display: none !important;
    }

    /* Mobil nav paneli */
    #mobile-navigation {
        display: none;
        width: 100%;
        background: #fff;
        border-top: 1px solid var(--gray-color);
        padding: 0 20px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    #mobile-navigation.active {
        display: block;
    }

    /* Ana liste */
    .mobile-nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-list > li {
        border-bottom: 1px solid var(--gray-color);
    }

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

    /* Tüm linkler */
    .mobile-nav-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        color: var(--text-color);
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: color 0.2s;
    }

    .mobile-nav-list a:hover {
        color: var(--primary-color);
    }

    /* Chevron — alt menüsü olan öğeler */
    .mobile-nav-list .menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        flex-shrink: 0;
        transition: transform 0.25s ease;
        margin-right: 2px;
    }

    .mobile-nav-list .menu-item-has-children.active > a::after {
        transform: rotate(225deg);
    }

    /* Sub menü */
    .mobile-nav-list .sub-menu {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0 0 8px 16px;
    }

    .mobile-nav-list .menu-item-has-children.active > .sub-menu {
        display: block;
    }

    .mobile-nav-list .sub-menu a {
        font-size: 15px;
        font-weight: 400;
        color: #555;
        padding: 9px 0;
        border-bottom: 1px solid #f0eef5;
    }

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