/* =========================================================
   NORTHCITY WOOCOMMERCE 3-COLUMN LAYOUT & SIDEBAR STYLING
   ========================================================= */

/* HOMEPAGE & NON-WOOCOMMERCE PAGES FIX: MUST BE BLOCK / COLUMN */
body.home .site-content .ast-container,
body:not(.woocommerce-page):not(.ast-left-sidebar) .site-content .ast-container {
    display: block !important;
    flex-direction: column !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Site Content Container Flex Layout Fix (3-COLUMN LAYOUT FOR SHOP & CATEGORY PAGES) */
body.woocommerce-page:not(.home) .site-content .ast-container,
body.archive.woocommerce:not(.home) .site-content .ast-container,
body.tax-product_cat:not(.home) .site-content .ast-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    max-width: 1440px !important;
    margin: 30px auto !important;
    padding: 0 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 20px !important;
}

/* Sol Menü (#secondary) - Özellikler, Fiyat, Stok */
#secondary,
.site-content #secondary {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex: 0 0 250px !important;
    order: 1 !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
    display: block !important;
}

/* Orta Alan (#primary) - Ürün Gridi & Hero Card */
#primary,
.site-content #primary {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    order: 2 !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
}

/* Sağ Menü (.nc-right-sidebar) - İlgili Kategoriler Listesi */
#nc-right-sidebar,
.site-content #nc-right-sidebar {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    flex: 0 0 240px !important;
    order: 3 !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
    display: block !important;
}

/* Sol Kenar Çubuğu Kutu Stili */
.nc-filter-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
    font-family: inherit;
}

.nc-filter-main-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nc-filter-main-title .dashicons {
    color: #0066cc;
}

.nc-active-filters-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px dashed #cbd5e1;
}

.nc-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.nc-clear-all-btn {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
}
.nc-clear-all-btn:hover {
    text-decoration: underline;
}

.nc-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nc-tag {
    display: inline-flex;
    align-items: center;
    background: #0066cc;
    color: #ffffff !important;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.2s;
}
.nc-tag:hover {
    background: #0052a3;
}

.nc-filter-group {
    margin-bottom: 22px;
}

.nc-filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    position: relative;
}

.nc-price-form .nc-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nc-price-inputs input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}
.nc-price-inputs input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}

.nc-price-btn {
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.nc-price-btn:hover {
    background: #0052a3;
}

.nc-filter-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 180px;
    overflow-y: auto;
}

.nc-filter-list::-webkit-scrollbar {
    width: 4px;
}
.nc-filter-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.nc-filter-list li {
    margin-bottom: 6px !important;
}

.nc-filter-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
}

.nc-filter-link:hover {
    background: #f1f5f9;
    color: #0066cc !important;
}

.nc-filter-link.is-active {
    font-weight: 600;
    color: #0066cc !important;
    background: #eff6ff;
}

.nc-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}

.nc-filter-link.is-active .nc-checkbox,
.nc-checkbox.checked {
    background: #0066cc;
    border-color: #0066cc;
}

.nc-checkbox.checked::after,
.nc-filter-link.is-active .nc-checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nc-filter-label {
    flex-grow: 1;
}

.nc-count {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ACCORDION STYLING */
.nc-filter-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    cursor: pointer !important;
    user-select: none !important;
    padding: 6px 0 !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: color 0.2s ease !important;
}

.nc-filter-header:hover .nc-filter-title {
    color: #0066cc !important;
}

.nc-filter-header .nc-filter-title {
    margin-bottom: 0 !important;
}

.nc-accordion-icon {
    font-size: 16px !important;
    color: #94a3b8 !important;
    transition: transform 0.25s ease, color 0.25s ease !important;
}

.nc-filter-group.is-collapsed .nc-filter-list,
.nc-filter-group.is-collapsed .nc-price-form {
    display: none !important;
}

.nc-filter-group.is-open .nc-accordion-icon {
    transform: rotate(180deg) !important;
    color: #0066cc !important;
}

/* =========================================================
   CATEGORY HERO CARD STYLING
   ========================================================= */
.nc-category-hero-banner {
    margin-bottom: 30px;
    width: 100%;
}

.nc-category-hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.nc-category-hero-info {
    flex: 1;
    min-width: 0;
}

.nc-category-hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0066cc;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.nc-category-hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.2;
}

.nc-category-hero-desc {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
    max-width: 580px;
}

.nc-category-hero-media {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    position: relative;
}

.nc-category-hero-full-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scale(1.18) !important; /* Kenarlardan 10mm kırpma */
    transition: transform 0.3s ease;
}

.nc-category-hero-card:hover .nc-category-hero-full-img {
    transform: scale(1.22) !important;
}
.nc-hero-toggle { display: none; background: none; border: none; color: #0066cc; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0 0; }
.nc-hero-toggle:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .nc-category-hero-card { flex-direction: row; align-items: center; padding: 14px 16px; gap: 14px; }
    .nc-category-hero-title { font-size: 1.3rem !important; margin-bottom: 6px !important; }
    .nc-category-hero-desc { font-size: 0.85rem !important; line-height: 1.5 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .nc-category-hero-card.is-expanded .nc-category-hero-desc { -webkit-line-clamp: unset; display: block; }
    .nc-category-hero-card.is-expanded .nc-hero-toggle { content: "Daralt"; }
    .nc-hero-toggle { display: inline-block; }
    .nc-category-hero-media { width: 84px !important; height: 84px !important; border-radius: 12px !important; }
    .nc-category-hero-banner { margin-bottom: 16px !important; }
}

/* =========================================================
   SAĞ MENÜ (İLGİLİ KATEGORİLER SIDEBAR) STYLING
   ========================================================= */
.nc-category-sidebar-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 100px;
}

.nc-category-sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nc-category-sidebar-title .dashicons {
    color: #0066cc;
}

.nc-category-sidebar-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.nc-category-sidebar-list li {
    margin-bottom: 8px !important;
}

.nc-category-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.nc-category-sidebar-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0066cc !important;
    transform: translateX(3px);
}

.nc-category-sidebar-link.is-active {
    background: #0066cc;
    border-color: #0066cc;
    color: #ffffff !important;
    font-weight: 700;
}

.nc-category-sidebar-link.is-active .nc-cat-count {
    color: rgba(255, 255, 255, 0.9);
}

.nc-cat-count {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

/* Mobil filtre butonu - masaustunde gizli */
.nc-mobile-filter-btn { display: none; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: #0f172a; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin: 12px 0; }
.nc-mobile-filter-btn .dashicons { font-size: 16px; width: 16px; height: 16px; color: #0066cc; }
.nc-filter-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 10001; backdrop-filter: blur(2px); }
.nc-filter-overlay.is-open { display: block; }
.nc-filter-drawer-close { display: none; }

@media (max-width: 900px) {
    body.woocommerce-page:not(.home) .site-content .ast-container,
    body.archive.woocommerce:not(.home) .site-content .ast-container,
    body.tax-product_cat:not(.home) .site-content .ast-container {
        flex-direction: column !important;
    }
    #secondary,
    .nc-right-sidebar,
    #primary {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    /* Filtre cekmecesi - mobilde gizli, butonla acilir */
    #secondary {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 88% !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #fff !important;
        z-index: 10002 !important;
        overflow-y: auto !important;
        padding: 16px !important;
        margin: 0 !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.18) !important;
        transition: left 0.28s ease !important;
        border-radius: 0 !important;
        display: block !important;
    }
    #secondary.is-open { left: 0 !important; }
    #secondary .nc-filter-sidebar { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
    .nc-mobile-filter-btn { display: inline-flex !important; }
    .nc-filter-drawer-close { display: flex !important; align-items: center; justify-content: center; position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: none; border-radius: 50%; background: #f1f5f9; color: #0f172a; font-size: 18px; cursor: pointer; z-index: 1; }
    body.nc-filter-open { overflow: hidden !important; }
    /* Kategori hero uzerinde filtre butonu icin bosluk */
    .nc-category-hero-banner { order: -1; }
}

/* =========================================================
   CATEGORY HIERARCHY TREE SIDEBAR STYLING
   ========================================================= */
.nc-category-sidebar-tree {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 520px;
    overflow-y: auto;
}

.nc-category-sidebar-tree::-webkit-scrollbar {
    width: 4px;
}
.nc-category-sidebar-tree::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.nc-tree-root-item {
    margin-bottom: 10px !important;
}

.nc-root-link {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    font-weight: 700 !important;
    color: #0066cc !important;
}

.nc-tree-parent-item {
    margin-bottom: 8px !important;
}

.nc-parent-link {
    font-weight: 600;
}

.nc-tree-leaf-list {
    list-style: none !important;
    padding-left: 12px !important;
    margin: 4px 0 8px 0 !important;
    border-left: 2px solid #e2e8f0;
}

.nc-tree-leaf-list li {
    margin-bottom: 4px !important;
}

.nc-leaf-link {
    padding: 5px 10px !important;
    font-size: 0.83rem !important;
    background: transparent !important;
    border: none !important;
}

.nc-leaf-link:hover {
    background: #f1f5f9 !important;
    color: #0066cc !important;
}

.nc-leaf-link.is-active {
    background: #0066cc !important;
    color: #ffffff !important;
    border-radius: 6px;
}
