/**
 * Mevcut Ürün Kategorileri Widget'ı Modern Tasarımla Override
 * Referans tasarım ile birebir aynı görünüm
 */

/* Reset */
.widget_product_categories * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Widget başlığı - container içinde entegre */
.widget_product_categories .widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    padding: 16px 16px 12px 16px;
    border-bottom: 2px solid #f4811f;
    background: #fff;
    border-radius: 10px 10px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Widget ana container - category-menu gibi */
.widget_product_categories {
    max-width: 100%;
    width: 100%;
    background: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #edeef5;
}

.widget_product_categories ul.product-categories {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Ana kategori item'ları - menu-item gibi */
.widget_product_categories ul.product-categories > li.cat-item {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    margin: 0;
    padding: 0;
}

.widget_product_categories ul.product-categories > li.cat-item:last-child {
    border-bottom: none;
}

/* Ana kategori link'i - menu-header gibi */
.widget_product_categories ul.product-categories > li.cat-item > a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    color: #2d3748;
    font-size: 15px;
    font-weight: 600;
}

.widget_product_categories ul.product-categories > li.cat-item > a:hover {
    background: #fff8f3;
}

/* Count sayısını gizle */
.widget_product_categories .count {
    display: none;
}

/* Icon kaldırıldı - daha temiz görünüm */

/* Alt kategorisi olan item'lar için ok işareti - menu-arrow gibi */
.widget_product_categories ul.product-categories > li.cat-parent > a::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: auto;
    flex-shrink: 0;
    color: #f4811f;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23f4811f' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s ease;
}

/* Aktif (açık) menü için ok dönüşü - menu-arrow.active gibi */
.widget_product_categories ul.product-categories > li.cat-parent.active > a::after {
    transform: rotate(180deg);
}

/* Alt kategoriler container - KAPALI */
.widget_product_categories ul.children {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease, 
                visibility 0s 0.4s;
    background: #f7fafc;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* AÇIK alt kategoriler - active class'ı olan */
.widget_product_categories li.active > ul.children {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px;
    overflow-y: auto;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease, 
                visibility 0s 0s;
}

/* AKTİF SAYFA - Başlangıçta açık ama kapatılabilir */
.widget_product_categories li.current-cat-parent > ul.children {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px;
    overflow-y: auto;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease, 
                visibility 0s 0s;
}

/* Aktif kategorinin ok işareti dönsün */
.widget_product_categories li.active > a::after,
.widget_product_categories li.current-cat-parent > a::after {
    transform: rotate(180deg);
}

/* Alt kategori item'ları */
.widget_product_categories ul.children li.cat-item {
    margin: 0;
    padding: 0;
}

/* Alt kategori link'leri - subcategory-item modern kart tasarımı */
.widget_product_categories ul.children li.cat-item > a {
    display: flex;
    align-items: center;
    padding: 12px 16px 12px 46px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: 100%;
}

/* AKTİF ALT KATEGORİ - Seçili kategorinin vurgulanması */
.widget_product_categories ul.children li.current-cat > a {
    background: #fff8f3;
    border-color: #f4811f;
    color: #f4811f;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(244, 129, 31, 0.15);
}

.widget_product_categories ul.children li.current-cat > a::after {
    transform: scaleY(1);
}

/* Alt kategori için icon - subcategory-icon gibi - SOL TARAFTA */
.widget_product_categories ul.children li.cat-item > a::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23f4811f' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Alt kategori hover efekti */
.widget_product_categories ul.children li.cat-item > a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(244, 129, 31, 0.15);
    border-color: #f4811f;
    color: #f4811f;
    background: #fff8f3;
}

/* Alt kategori sol border efekti (solda ince çizgi) */
.widget_product_categories ul.children li.cat-item > a::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #f4811f;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.widget_product_categories ul.children li.cat-item > a:hover::after {
    transform: scaleY(1);
}

/* Sağdaki ok işareti kaldırıldı - daha temiz görünüm */

/* Mobil responsive */
@media (max-width: 768px) {
    .widget_product_categories {
        max-width: 100%;
    }
    
    .widget_product_categories .widget-title {
        padding: 14px 14px 10px 14px;
        font-size: 15px;
    }
    
    .widget_product_categories ul.product-categories > li.cat-item > a {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .widget_product_categories ul.children.active {
        padding: 8px 12px;
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Animasyonlar - stagger effect */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active class'ı olanlarda animasyon (tüm kategoriler) */
.widget_product_categories li.active > ul.children li.cat-item {
    animation: slideDown 0.3s ease forwards;
}

.widget_product_categories li.active > ul.children li.cat-item:nth-child(1) { animation-delay: 0.05s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(2) { animation-delay: 0.1s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(3) { animation-delay: 0.15s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(4) { animation-delay: 0.2s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(5) { animation-delay: 0.25s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(6) { animation-delay: 0.3s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(7) { animation-delay: 0.35s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(8) { animation-delay: 0.4s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(9) { animation-delay: 0.45s; }
.widget_product_categories li.active > ul.children li.cat-item:nth-child(10) { animation-delay: 0.5s; }

/* Scrollbar stilleri */
.widget_product_categories ul.children.active::-webkit-scrollbar {
    width: 6px;
}

.widget_product_categories ul.children.active::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.widget_product_categories ul.children.active::-webkit-scrollbar-thumb {
    background: #f4811f;
    border-radius: 10px;
}

.widget_product_categories ul.children.active::-webkit-scrollbar-thumb:hover {
    background: #e67011;
}

/* Uncategorized kategorisini gizle */
.widget_product_categories li.cat-item-uncategorized,
.widget_product_categories li[class*="cat-item"][class*="uncategorized"] {
    display: none;
}
