/* === GENEL === */
* {
    box-sizing: border-box;
}

body {
    background: #f9f9f9;
    color: #333;
    font-family: Arial, sans-serif;
}

.products-list {
    width: 80%;
}

/* Sayfa ana yerleşim */
.content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 20px; /* İki alan arası boşluk */
    flex-wrap: nowrap; /* Yan yana kalsın */
    width: 100%;
}

/* === FİLTRE PANELİ === */
.filter-sidebar {
    width: 250px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-size: 15px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-title {
    font-size: 22px;
    font-weight: 700;
    color: #084793;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.product-count {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 16px;
    user-select: none;
}

.filter-group-title,
.filter-group h5 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    border-bottom: 2px solid #e7e7e7;
    padding-bottom: 6px;
    user-select: none;
}

/* === KATEGORİ AĞACI === */
.category-tree {
    font-size: 14px;
    color: #444;
    max-height: 260px;
    overflow-y: auto;
    padding-left: 8px;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: inset 0 0 5px #e1e5ea;
    user-select: none;
}

.category-item {
    cursor: pointer;
    position: relative;
    line-height: 1.5;
    color: #495057;
    transition: color 0.2s ease;
    display: block;
    user-select: none;
}

    .category-item:hover,
    .category-item.selected {
        color: #084793;
        font-weight: 600;
    }

    .category-item .toggle-icon {
        user-select: none;
        font-weight: 900;
        color: #6c757d;
        cursor: pointer;
        display: inline-block;
        width: 14px;
        text-align: center;
        margin-right: 6px;
        transition: transform 0.3s ease;
    }

    .category-item.has-children > ul {
        margin-left: 16px;
        padding-left: 12px;
        border-left: 2px solid #08479366;
    }

    .category-item.collapsed > .toggle-icon {
        transform: rotate(-90deg);
    }

    .category-item.collapsed > ul {
        display: none;
    }

/* === YAYINEVİ & YAZAR FİLTRE === */
#publisher-filter,
#author-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.facet__search {
    display: flex;
    width: 100%;
    gap: 6px;
    box-sizing: border-box;
}

    .facet__search:focus-within {
        border-color: #084793;
        box-shadow: 0 0 8px #084793aa;
    }

#publisher-filter {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.facet__search-button {
    background-color: #f27a1a; /* Trendyol turuncusu */
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color .2s ease;
}

    .facet__search-button:hover {
        background-color: #ff8800;
    }

    .facet__search-button svg,
    .facet__search-button .icon {
        width: 20px;
        height: 20px;
        fill: #fff;
    }

.facet__search-input {
    flex: 1 1 auto;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.publisher-list,
.author-list {
    display: flex; /* eklendi */
    flex-direction: column;
    max-height: 230px;
    overflow-y: auto;
    gap: 8px;
    transition: max-height 0.3s ease;
}

.publisher-item,
.author-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

    .publisher-item:hover, .author-item:hover {
        background-color: #f0f5ff;
    }

    .publisher-item input, .author-item input {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

    .publisher-item label, .author-item label {
        font-size: 14px;
        color: #333;
        cursor: pointer;
    }

.publisher-more-btn,
#togglePublisherList,
#toggleAuthorList {
    background-color: transparent;
    border: none;
    color: #084793;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
    align-self: flex-start;
    user-select: none;
    transition: color 0.3s ease;
}

    .publisher-more-btn:hover,
    #togglePublisherList:hover,
    #toggleAuthorList:hover {
        color: #062f5a;
    }

/* === FİYAT ARALIĞI === */
.price-range { /* nokta eklendi (class) */
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap; /* satır kırılmasın */
    overflow: hidden; /* taşmayı gizle */
}

    .price-range label {
        font-weight: 600;
        font-size: 14px;
        color: #444;
        min-width: 30px;
    }

    .price-range input[type="number"] {
        width: 60px;
        min-width: 50px;
        max-width: 80px;
        box-sizing: border-box;
    }

        .price-range input[type="number"]:focus {
            border-color: #084793;
            box-shadow: 0 0 8px #084793aa;
        }

/* === ÜRÜN LİSTE === */
.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
 
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
    }

    .product-card img {
        width: 100%;
        max-height: 240px;
        min-height: 180px;
        object-fit: contain;
        border-radius: 4px;
        background-color: #fff;
        display: block;
    }

    .product-card h4 {
        font-size: 16px;
        font-weight: 600;
        margin-top: 10px;
        text-align: center;
        color: #333;
    }

.product-price {
    margin-top: 8px;
    font-weight: bold;
    color: #28a745;
    font-size: 14px;
    text-align: center;
    gap: 8px;
    align-items: center;
    display: flex;
}

    .product-price .old-price {
        color: #d9534f;
        text-decoration: line-through;
      
    }



.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 14px;
    color: #ffc107;
}

    .product-rating .stars {
        font-size: 16px;
    }

.product-favorite {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ff8000;
    margin-top: 4px;
    font-size: 14px;
}

    .product-favorite .icon-heart {
        width: 16px;
        height: 16px;
        fill: #fff;
    }

.add-cart-btn {
    margin-top: auto; /* butonu kartın en altına sabitler */
    padding: 8px 14px;
    background-color: #ff8000;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s ease;
}

    .add-cart-btn:hover {
        background-color: #ff8880;
    }

    .add-cart-btn .icon-cart {
        width: 18px;
        height: 18px;
        fill: white;
    }

/* === BUTONLAR / Üst Kontroller === */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Filtre açma butonu (tek tanım) */
.filter-open-btn {
    display: none; /* desktop'ta gizli */
    background-color: #f27a1a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

    .filter-open-btn:hover {
        background-color: #d26900;
    }
@media (max-width: 768px) {
    .filter-open-btn {
        display: block !important;
    }
}
/* Sıralama */
.sort-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 16px 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #084793;
}

    .sort-container label {
        margin-right: 0.5rem;
        font-weight: 600;
        color: #222;
    }

    .sort-container select {
        padding: 0.3rem 0.6rem;
        border-radius: 4px;
        border: 1px solid #ccc;
        cursor: pointer;
    }

#sortSelect {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    color: #333;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    #sortSelect:hover {
        border-color: #f27a1a;
        box-shadow: 0 0 0 3px rgba(242, 122, 26, 0.15);
    }

    #sortSelect:focus {
        border-color: #f27a1a;
        outline: none;
        box-shadow: 0 0 0 3px rgba(242, 122, 26, 0.25);
    }

/* Uygulanan filtreler */
.applied-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
}

.filter-tag {
    background-color: #f2f2f2;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 14px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .filter-tag button.remove-filter-btn {
        background: none;
        border: none;
        color: #999;
        font-size: 16px;
        cursor: pointer;
        line-height: 1;
        padding: 0;
    }

        .filter-tag button.remove-filter-btn:hover {
            color: #f27a1a;
        }

.clear-all-btn {
    background-color: #f27a1a;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .clear-all-btn:hover {
        background-color: #d05e00;
    }

/* Yayıncı satır stilleri (detay) */
.publisher-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 6px 10px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

    .publisher-item:hover {
        background-color: #f9f9f9;
        border-color: #f27a1a;
    }

    .publisher-item input[type="checkbox"] {
        accent-color: #f27a1a;
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

    .publisher-item label {
        font-size: 14px;
        color: #333;
        cursor: pointer;
        user-select: none;
    }

/* Facet search ikon yedeği */
.facet__search-button .icon {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

/* Author alanı */
#authorSearch {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

    #authorSearch:focus {
        border-color: #084793;
        box-shadow: 0 0 8px #084793aa;
    }

.author-list {
    margin-top: 8px;
}

.author-item:hover {
    background-color: #f0f5ff;
}

.author-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.author-item label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

#toggleAuthorList {
    background: none;
    border: none;
    color: #084793;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
    align-self: flex-start;
    user-select: none;
    transition: color 0.3s ease;
}

    #toggleAuthorList:hover {
        color: #062f5a;
    }

/* Diğer filtre kapsayıcı */
.other-filter-list {
    display: flex;
    flex-direction: column;
    max-height: 230px;
    overflow-y: auto;
    gap: 8px;
    transition: max-height 0.3s ease;
    margin-top: 8px;
}

.other-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

    .other-filter-item:hover {
        background-color: #f0f5ff;
    }

    .other-filter-item input[type="checkbox"] {
        cursor: pointer;
        width: 18px;
        height: 18px;
    }

    .other-filter-item label {
        font-size: 14px;
        color: #333;
        cursor: pointer;
    }

.toggle-other-list-btn {
    background: none;
    border: none;
    color: #084793;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
    align-self: flex-start;
    user-select: none;
    transition: color 0.3s ease;
}

    .toggle-other-list-btn:hover {
        color: #062f5a;
    }

/* Diğer filtreler (örn. Ön Sipariş, Kredili vb.) */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

    .filter-options input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #084793;
    }

    .filter-options label {
        font-size: 14px;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .filter-options label:hover {
            color: #084793;
        }

    .filter-options .filter-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 8px;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.15s ease;
        user-select: none;
    }

        .filter-options .filter-item:hover {
            background-color: #f0f5ff;
        }


/* Kategori başlık satırı */
.category-level {
    list-style: none;
    padding-left: 12px;
    margin: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
}

    .category-header span {
        font-size: 14px;
    }

.category-item.collapsed > ul {
    display: none;
}

.icon {
    width: 16px;
    height: 16px;
    stroke: #084793;
    transition: transform 0.3s ease;
}

    .icon.rotated {
        transform: rotate(90deg);
    }

/* Ürün meta */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.rating-bar {
    font-size: 16px;
    font-weight: bold;
    position: relative;
    display: inline-block;
    background: linear-gradient(to right, #FFD700 var(--rating), #ccc var(--rating));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rating-value {
    margin-left: 4px;
    color: #555;
    font-size: 14px;
    -webkit-text-fill-color: initial;
}

.prd-fav-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #e20714;
    font-size: 14px;
    font-weight: 600;
}

/* Ürünleri Göster Butonu */
#showProductsBtn {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    margin: 20px auto;
    background-color: #f27a1a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(242, 122, 26, 0.4);
    transition: background-color 0.3s ease;
    z-index: 10;
    position: relative;
}

    #showProductsBtn:hover {
        background-color: #d26900;
    }

/* === BACKDROP === */
.backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 998;
}

    .backdrop.active {
        display: block;
    }

#ssr-products {
    position: absolute;
    left: -9999px;
}