/* ============================================
   MEGA MENU - Premium Dropdown Experience
   ============================================ */

/* Base: Mega Drop Container - POSITION FIX */
.nav-item.mega-drop {
    position: relative !important;
    /* DÜZELTME: static yerine relative */
}

/* Nav Link içindeki hover alanını genişlet */
.nav-item.mega-drop>.nav-link {
    position: relative;
    z-index: 1001;
    padding-bottom: 15px;
    /* Daha geniş tıklanabilir alan */
    margin-bottom: -10px;
    /* Görsel düzeltme */
}

/* Görünmez Köprü - Link ile Menü Arasındaki Boşluğu Kapatan */
.nav-item.mega-drop::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    /* Sadece menü alanı kadar */
    height: 25px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
}

.nav-item.mega-drop:hover::before {
    pointer-events: auto;
    opacity: 1;
}

/* Mega Menu Wrapper - Ana Panel */
.mega-menu-wrapper {
    position: absolute;
    top: calc(100% + 10px);
    /* Navbar altından başla */
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    width: 95vw;
    max-width: 1200px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 86, 179, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 86, 179, 0.08);
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    padding: 30px;
    /* Kapanma gecikmesi - UX için önemli */
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.08s;
    /* Kapanmada küçük gecikme */
}

/* Mega menu üst ok işareti */
.mega-menu-wrapper::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 50%, transparent 50%);
    border-left: 1px solid rgba(0, 86, 179, 0.08);
    border-top: 1px solid rgba(0, 86, 179, 0.08);
    transform: translateX(-50%) rotate(45deg);
    z-index: 1;
}

/* Accent bar at bottom */
.mega-menu-wrapper::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(90deg, #0056b3, #00a8ff, #0056b3);
    border-radius: 0 0 16px 16px;
}

/* ============================================
   HOVER STATES
   ============================================ */

/* Hover Trigger - Açılma */
.nav-item.mega-drop:hover .mega-menu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
    /* Açılmada gecikme yok */
}

/* Standard Bootstrap Dropdown için de iyileştirme */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown>.nav-link {
    padding-bottom: 15px;
    margin-bottom: -10px;
}

.nav-item.dropdown::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
    pointer-events: none;
}

.nav-item.dropdown:hover::before {
    pointer-events: auto;
}

.nav-item.dropdown .dropdown-menu {
    margin-top: 10px;
    border: none;
    border-radius: 12px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.05s;
    display: block !important;
    /* Bootstrap override */
    pointer-events: none;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
    pointer-events: auto;
}

/* ============================================
   CATEGORIES LIST (Left Side)
   ============================================ */
.mega-cat-list {
    border-right: 1px solid rgba(0, 86, 179, 0.08);
    padding-right: 25px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 86, 179, 0.02) 100%);
    border-radius: 12px;
    padding: 15px;
}

.mega-cat-list h6 {
    color: #0056b3;
    letter-spacing: 1px;
    font-size: 0.7rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 86, 179, 0.1);
}

.mega-cat-item {
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
    /* Biraz daha büyük ve okunaklı */
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: 1px solid transparent;
    /* Sınır çizgisini hazırla */
}

/* Hover effect glow */
.mega-cat-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #0056b3, #00a8ff);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 3px 3px 0;
}

.mega-cat-item:hover,
.mega-cat-item.active {
    background: #fff;
    color: #0056b3;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.08);
    /* Hafif gölge */
    border-color: rgba(0, 86, 179, 0.1);
}

.mega-cat-item:hover::before,
.mega-cat-item.active::before {
    transform: scaleY(1);
}

.mega-cat-item i {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: #00a8ff;
}

.mega-cat-item:hover i,
.mega-cat-item.active i {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   PRODUCTS PANEL (Right Side)
   ============================================ */
.mega-products-panel {
    padding-left: 30px;
    display: none;
}

.mega-products-panel h6 {
    color: #0056b3;
    letter-spacing: 1px;
    font-size: 0.7rem;
}

.mega-products-panel.active {
    display: block;
    animation: megaFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes megaFadeIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   PRODUCT CARDS - Premium Style
   ============================================ */
.mega-product-card {
    text-align: center;
    padding: 20px 15px;
    border-radius: 16px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: block;
    background: transparent;
    border: 1px solid transparent;
    position: relative;
}

.mega-product-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.03) 0%, rgba(0, 168, 255, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mega-product-card:hover {
    background: white;
    border-color: rgba(0, 86, 179, 0.1);
    transform: translateY(-8px);
    box-shadow:
        0 15px 35px rgba(0, 86, 179, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.05);
}

.mega-product-card:hover::before {
    opacity: 1;
}

.mega-product-img {
    height: 110px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.mega-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    /* İstenen radius */
}

.mega-product-card:hover .mega-product-img img {
    transform: scale(1.08);
}

.mega-product-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.mega-product-price {
    font-size: 0.8rem;
    color: #0056b3;
    font-weight: 700;
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, #0056b3, #00a8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   SCROLLBAR - Premium
   ============================================ */
.mega-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 10px;
}

.mega-scroll::-webkit-scrollbar {
    width: 5px;
}

.mega-scroll::-webkit-scrollbar-track {
    background: rgba(0, 86, 179, 0.05);
    border-radius: 10px;
}

.mega-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0056b3, #00a8ff);
    border-radius: 10px;
}

.mega-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #003d80, #0056b3);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {

    .nav-item.mega-drop::before,
    .nav-item.dropdown::before {
        display: none;
    }

    .nav-item.mega-drop>.nav-link,
    .nav-item.dropdown>.nav-link {
        padding-bottom: 8px;
        margin-bottom: 0;
    }

    .mega-menu-wrapper {
        position: static;
        width: 100%;
        max-width: 100%;
        transform: none;
        border-radius: 0;
        box-shadow: none;
        padding: 15px;
        opacity: 1;
        visibility: visible;
        display: none;
        background: rgba(33, 37, 41, 0.98);
    }

    .nav-item.mega-drop:hover .mega-menu-wrapper {
        transform: none;
    }

    .mega-menu-wrapper::before,
    .mega-menu-wrapper::after {
        display: none;
    }

    .mega-cat-list {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px;
        margin-bottom: 15px;
        background: transparent;
    }

    .mega-cat-list h6,
    .mega-products-panel h6 {
        color: rgba(255, 255, 255, 0.6);
    }

    .mega-cat-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 10px 15px;
    }

    .mega-cat-item:hover,
    .mega-cat-item.active {
        background: rgba(255, 255, 255, 0.1);
        color: #00a8ff;
        transform: none;
    }

    .mega-products-panel {
        padding-left: 0;
    }

    .mega-product-card {
        padding: 10px;
    }

    .mega-product-card:hover {
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
    }

    .mega-product-name {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.8rem;
    }

    .mega-product-img {
        height: 80px;
    }

    .nav-item.dropdown .dropdown-menu {
        display: none !important;
        /* Hide by default on mobile */
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        background: rgba(45, 45, 45, 0.95);
        /* Slightly lighter for contrast */
        border-radius: 0;
        box-shadow: none;
        margin-top: 0;
    }

    .nav-item.dropdown .dropdown-menu.show {
        display: block !important;
        /* Show when Bootstrap adds 'show' class */
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.mega-products-panel .text-muted {
    color: #6c757d !important;
}

.mega-products-panel .opacity-25 {
    color: rgba(0, 86, 179, 0.25);
}