﻿/* Mega Menu Genel Stiller */
.mega-menu {
    position: static !important;
}

.mega-menu-content {
    width: 100%;
    left: 0 !important;
    right: 0 !important;
    padding: 0 !important;
    margin-top: 0 !important;
    border: none !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px !important;
    max-height: 70vh;
    overflow-y: auto;
}

/* Kategori Kolonu */
.category-column {
    background-color: #f8f9fa;
    border-right: 1px solid #eee;
    height: 100%;
}

.category-list {
    padding: 15px 0;
    height: 100%;
}

.category-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

    .category-item:hover, .category-item.active {
        background-color: rgba(13, 110, 253, 0.05);
        border-left: 3px solid #ff7f41;
    }

        .category-item:hover .category-name,
        .category-item.active .category-name {
            color: #ff7f41;
        }

.category-name {
    font-weight: 500;
    color: #333;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 500px;
}

.category-item i {
    font-size: 12px;
    color: #999;
    transition: all 0.2s ease;
}

.category-item.active i {
    color: #ff7f41;
}

/* Alt Kategori Kolonu - Yatay Sürüm */
.subcategory-column {
    background-color: #fff;
    padding: 20px;
}

.subcategory-wrapper {
    height: 100%;
}

.subcategory-container {
    display: none;
    height: 100%;
}

    .subcategory-container.active {
        display: block;
    }

.subcategory-header {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.subcategory-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-right: 10px;
}

.subcategory-item-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 150px; /* sabit genişlik */
    text-align: center;
    padding: 10px;
}

    .subcategory-item-horizontal img {
        width: 100px;
        height: 100px;
        object-fit: contain; /* resimler aynı boyut */
        margin-bottom: 8px;
    }

    .subcategory-item-horizontal span {
        display: block;
        font-size: 14px;
        font-weight: 500;
        word-wrap: break-word;
        white-space: normal; /* uzun isimler alt satıra geçsin */
    }


    .subcategory-item-horizontal:hover {
        background-color: #e9f0ff;
        color: #ff7f41;
        border-color: #ff7f41;
        transform: translateY(-2px);
    }

    .subcategory-item-horizontal span {
        margin-right: 5px;
        font-weight: 500;
    }

    .subcategory-item-horizontal small {
        font-size: 0.8em;
    }

/* Scrollbar Stili */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Sadece mobil bloğa özgü basit kart */
.mobile-subitem {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    width: 46%; /* iki sütun */
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

/* Her sayfada menü üstte kalsın, içerikler menüyü kesmesin */
.navbar {
    position: relative;
    z-index: 1030;
}

    .navbar .dropdown-menu {
        z-index: 1050;
    }

header, .site-header, .navbar, .navbar-nav, .mega-menu-content {
    overflow: visible !important;
}

/* Mobil ürün kartları */
.mobile-subitem {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    width: 46%;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

@media (min-width:576px) {
    .mobile-subitem {
        width: 31%;
    }
}
/* 3 sütun */
.mobile-subitem img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
}

.mobile-subitem span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    min-height: calc(1.2em * 2);
    font-weight: 500;
    font-size: 14px;
}

/* Desktop mega-menu mobilde sorun çıkarmasın */
@media (max-width: 991.98px) {
    .mega-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        inset: auto !important;
        width: 100% !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-top: 0 !important;
    }

    .mega-menu .row.g-0 {
        display: block;
    }

    .mega-menu .category-column,
    .mega-menu .subcategory-column {
        width: 100%;
        border-right: 0;
        padding: 12px 16px;
    }
}
