/* PuntoKitap Katalog Sayfası Stilleri */

/* ES Facet Filter */
.es-facet-link { cursor: pointer; color: inherit; text-decoration: none; transition: background 0.15s; }
.es-facet-link:hover { background-color: #f0f0f0; }
.es-facet-active { background-color: #e8f0fe; color: #1a73e8; font-weight: 600; }
.es-facet-check { color: #1a73e8; }
.es-facet-clear { color: #999; font-size: 0.9em; }
.es-facet-clear:hover { color: #333; background-color: #f5f5f5; }

/* Aktif filtre etiketleri (toolbar) */
.pk-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px 0;
    margin-bottom: 8px;
}
.pk-active-filters-label {
    font-size: 0.82rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 2px;
}
.pk-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #c5d9f8;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.pk-active-filter-tag:hover {
    background: #d0e3ff;
}
.pk-active-filter-tag span {
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
}
.pk-active-filter-clear {
    background: none;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    transition: background 0.15s;
}
.pk-active-filter-clear:hover {
    background: #f0f0f0;
    color: #333;
}

/* Filtre kartları */
.product-filter .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
    /*text-transform: uppercase;*/
    letter-spacing: 0.03em;
    color: #333;
}
.product-filter .card {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}
.product-filter .card-body {
    max-height: 250px;
    overflow-y: auto;
}
.product-filter .card-body::-webkit-scrollbar {
    width: 4px;
}
.product-filter .card-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

/* Facet search input: scroll içinde sabit kalsın
   Not: Brand/Collection facetlerinde scroll'u .pk-facet-scroll yönetir. */
.es-brand-filter .card-body,
.es-collection-filter .card-body {
    max-height: none;
    overflow: visible;
}

.pk-facet-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.pk-facet-search {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding-bottom: 8px;
}

/* Sayfalama */
.pagination {
    flex-wrap: wrap;
}
.pagination .page-item {
    margin: 0 0 5px 0;
}
.pagination .page-link {
    color: #000;
    font-weight: 500;
    background-color: #f8f9fa;
    cursor: pointer;
}
.pagination .currentpage.page-item .page-link {
    pointer-events: none;
    color: #fff;
    background-color: #0E606C;
    border-color: #0E606C;
}
.pagination .page-item:not(.currentpage):hover .page-link {
    color: #fff;
    background-color: #1FB0C7;
    border-color: #1FB0C7;
}

/* Sıralama ve görünüm kontrolleri */
.sort-container {
    display: inline-flex;
    align-items: center;
}

/* Wide desktop (wd) row columns helpers */
@media (min-width: 1500px) {
    .row-cols-wd-5 > * {
        flex: 0 0 20%;
        max-width: 20%;
    }
}
.sort-container:not(:last-child) {
    margin: 0 10px 0 0;
}
.sort-container .col-form-label {
    margin: 0 5px 0 0;
    font-weight: 500;
    white-space: nowrap;
}
.item-statistics {
    font-weight: 500;
}
.item-statistics .items-per-page span,
.item-statistics .items-separator {
    margin: 0 5px 0 0;
}
.viewmode-icon {
    cursor: pointer;
}
.viewmode-icon .list-icon {
    margin: 0 0 0 20px;
}

/* Sol sidebar */
.generalLeftSide .block ul {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding-left: 0;
    list-style-type: none;
}
.pk-category-nav-scroll {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px; /* scrollbar space */
}
.pk-category-nav-scroll::-webkit-scrollbar { width: 4px; }
.pk-category-nav-scroll::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 4px; }

.generalLeftSide .pk-nav-list {
    display: block;
    padding-left: 0;
    margin: 0;
    list-style: none;
}
.generalLeftSide li a {
    position: relative;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    padding-bottom: 10px;
}
.generalLeftSide li.active.last > a {
    color: #0E606C;
}
.generalLeftSide .block-category-navigation li.active .sublist > li.last > a {
    color: #0E606C;
    font-weight: 500;
}

@media (max-width: 575px) {
    .sort-container, .sort-container:not(:last-child) {
        width: 100%;
        margin: 0 0 10px 0;
    }
    .sort-container.change-view {
        justify-content: flex-end;
        margin: 10px 10px 0 0;
    }

    /* Ürün grid mobil düzeltme - kırpılma sorunu */
    #TwoColumns {
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden;
    }
    .generalSideRight {
        padding-left: 8px !important;
        padding-right: 8px !important;
        overflow-x: hidden;
    }
    .product-grid .form-row,
    .product-grid .row {
        margin-left: -4px !important;
        margin-right: -4px !important;
    }
    .product-grid .product-container {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .product-box .card-title a {
        font-size: 0.78rem;
        line-height: 1.2;
    }
    .product-box .actual-price {
        font-size: 0.85rem;
    }
    .product-box .card-body {
        padding: 4px 2px;
    }
    .product-box .card-footer {
        padding: 4px 2px;
    }
    .product-box .btn-group .btn {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
}

/* Dark mode */
[dark-theme="true"] .pagination .page-link {
    color: #fff;
    border-color: #555;
    background-color: #2d3133;
}
[dark-theme="true"] .product-filter .card-header {
    background-color: #2d3133;
    color: #eee;
}
[dark-theme="true"] .product-filter .card {
    border-color: #444;
}
[dark-theme="true"] .es-facet-link:hover {
    background-color: #3a3f42;
}
[dark-theme="true"] .es-facet-active {
    background-color: #1a3a5c;
    color: #7ab3f5;
}
[dark-theme="true"] .es-facet-check {
    color: #7ab3f5;
}

[dark-theme="true"] .main-category-card {
    background-color: #1f2326;
    border-color: #3a3f42;
}
[dark-theme="true"] .main-category-name { color: #eee; }
[dark-theme="true"] .main-category-description { color: #b7bdc2; }
[dark-theme="true"] .pk-category-tree-link { color: #d5d9dd; }
[dark-theme="true"] .pk-category-tree-summary:hover { background: #2a2f33; }
[dark-theme="true"] .pk-category-tree .pk-category-tree { border-left-color: #4a4f53; }
[dark-theme="true"] .pk-category-tree-caret { border-right-color: #f3b4b4; border-bottom-color: #f3b4b4; }

/* ===== Arama sonucu yok ===== */
.pk-no-results {
    text-align: center;
    padding: 60px 20px;
}
.pk-no-results svg {
    display: block;
    margin: 0 auto 20px;
}
.pk-no-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}
.pk-no-results-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 24px;
}
.pk-no-results-btn {
    display: inline-block;
    background: #0E606C;
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
}
.pk-no-results-btn:hover {
    background: #0a4a54;
    color: #fff !important;
    text-decoration: none;
}

/* ===== Sepet order-summary progress bar override ===== */
.cart-page-body .order-summary .free-shipping-progress {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
}
.cart-page-body .order-summary .free-shipping-bar-wrap {
    height: 6px;
    margin-bottom: 8px;
}
.cart-page-body .order-summary .free-shipping-text {
    font-size: 0.82rem;
    color: #555;
}
.cart-page-body .order-summary .free-shipping-text strong {
    color: #B91C1C;
}
.cart-page-body .order-summary .free-shipping-achieved {
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ===== BrandAll (Markalar) ===== */
.publishers-page { padding: 2rem 0 3rem; }
.publishers-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.publishers-page .page-title { font-size: 2rem; font-weight: 700; color: #111827; }
.publishers-page .page-subtitle { color: #6B7280; font-size: 1rem; margin-top: 0.25rem; }
.featured-publishers {
    background: linear-gradient(135deg, #FEE2E2, #fff5f5);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.featured-title { font-size: 1.6rem; color: #B91C1C; margin-bottom: 1rem; text-align: center; }
.featured-subtitle {
    color: #1F2937;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.publishers-content {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
}
.publishers-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.publishers-count { font-size: 0.9rem; color: #6B7280; }
.publishers-count strong { color: #B91C1C; }

/* BrandAll: masaüstünde sarmalayıcı layout’a karışmaz; mobilde arama+indeks birlikte yapışır */
.brandall-controls-wrap {
    display: contents;
}

/* Alfabetik indeks (BrandAll) */
.brand-index-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.65rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(to bottom, #fff 70%, rgba(255,255,255,0.92));
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.brand-index-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #B91C1C;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.brand-index-link:hover:not(.is-disabled) {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #991B1B;
}
.brand-index-link.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
    color: #9CA3AF;
}
.brandall-grouped { margin-bottom: 0; }
.brand-letter-section {
    scroll-margin-top: 5.5rem;
    margin-bottom: 2rem;
}
.brand-letter-section:last-child { margin-bottom: 0; }
.brand-letter-heading {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #FEE2E2;
    letter-spacing: 0.02em;
}

.publishers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 0;
}
.brand-letter-section .publishers-grid { margin-bottom: 0; }
.brandall-grouped > .brand-letter-section:last-child .publishers-grid { margin-bottom: 0; }
.publisher-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
}
.publisher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(185,28,28,0.1);
    border-color: #FEE2E2;
}
.publisher-header {
    padding: 1.5rem;
    background-color: #FEE2E2;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #E5E7EB;
}
.publisher-logo {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B91C1C;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
    overflow: hidden;
}
.publisher-logo img { width: 100%; height: 100%; object-fit: contain; }
.publisher-info { flex: 1; min-width: 0; }
.publisher-name { font-weight: 700; font-size: 1.1rem; color: #111827; margin-bottom: 0.25rem; }
.publisher-name a { color: inherit; text-decoration: none; transition: color 0.3s; }
.publisher-name a:hover { color: #B91C1C; }
.publisher-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.publisher-description {
    color: #374151;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.publisher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #B91C1C;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 0.3s;
    width: 100%;
}
.publisher-btn:hover { background-color: #991B1B; color: white; }
.brand-all-pagination { margin-top: 1rem; }

/* ===== CategoryAll (Kategoriler) ===== */
.categories-page { padding: 2rem 0 3rem; }
.categories-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.categories-page .page-title { font-size: 2rem; font-weight: 700; color: #111827; }
.categories-page .page-subtitle { color: #6B7280; font-size: 1rem; margin-top: 0.25rem; }
.categories-hero {
    background: linear-gradient(135deg, #FEE2E2, #fff5f5);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}
.categories-hero-title { font-size: 2.25rem; color: #B91C1C; margin-bottom: 1rem; }
.categories-hero-text { color: #1F2937; font-size: 1.1rem; max-width: 700px; margin: 0 auto; }
.main-categories-section { margin-bottom: 3rem; }
.main-categories-section .section-header { margin-bottom: 1.5rem; }
.main-categories-section .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
    position: relative;
    padding-bottom: 0.75rem;
}
.main-categories-section .section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #B91C1C;
    border-radius: 2px;
}
.main-categories-section .section-subtitle { color: #6B7280; font-size: 1rem; margin-top: 0.5rem; }
.main-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.main-category-card {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(185,28,28,0.1);
    border-color: #FEE2E2;
}
.main-category-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #B91C1C, #991B1B);
}
.main-category-icon img { width: 100%; height: 100%; object-fit: cover; }

.main-category-mainlink {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.main-category-mainlink:hover { color: inherit; text-decoration: none; }

.main-category-fallback-letter {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.main-category-name { font-weight: 700; font-size: 1.3rem; color: #111827; margin-bottom: 0.5rem; }
.main-category-name a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.main-category-card:hover .main-category-name a { color: #B91C1C; }
.main-category-description {
    color: #6B7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.main-category-treewrap { width: 100%; margin-top: 0.25rem; text-align: left; }
.pk-category-tree { text-align: left; }

/* Category tree (recursive) */
.pk-category-tree {
    list-style: none;
    padding-left: 0;
    margin: 0.25rem 0 0;
}
.pk-category-tree .pk-category-tree {
    margin-top: 0.25rem;
    padding-left: 0.9rem;
    border-left: 1px dashed #f0c9c9;
}
.pk-category-tree-item { margin: 0.15rem 0; }

.pk-category-tree-link {
    color: #374151;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}
.pk-category-tree-link:hover { color: #B91C1C; text-decoration: none; }

.pk-category-tree-details { width: 100%; }
.pk-category-tree-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background 0.15s ease;
}
.pk-category-tree-summary:hover { background: #fff5f5; }
.pk-category-tree-summary::-webkit-details-marker { display: none; }
.pk-category-tree-summary::marker { content: ""; }

.pk-category-tree-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid #b91c1c;
    border-bottom: 2px solid #b91c1c;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    opacity: 0.8;
    flex: 0 0 auto;
}
details[open] > .pk-category-tree-summary .pk-category-tree-caret {
    transform: rotate(45deg);
}
.category-all-pagination { margin-top: 2rem; }

/* ===== BrandAll + CategoryAll Responsive ===== */
@media (max-width: 768px) {
    .publishers-page { padding: 1rem 0 2rem; }
    /* Üstteki yapışkan site başlığının altında kalsın (pk-header sticky z-index: 1000) */
    .publishers-page .publishers-content .brandall-controls-wrap {
        display: block;
        position: sticky;
        top: calc(env(safe-area-inset-top, 0px) + var(--brandall-sticky-below-header, 3.35rem));
        z-index: 990;
        margin: -0.5rem -1rem 0.75rem;
        padding: 0.65rem 1rem 0.5rem;
        background: #fff;
        border-bottom: 1px solid #E5E7EB;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    }
    .publishers-page .brandall-controls-wrap .publishers-toolbar {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }
    .publishers-page .brandall-controls-wrap .publishers-search {
        margin-left: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
    .publishers-page .brandall-controls-wrap .brand-index-bar {
        position: static;
        top: auto;
        margin-bottom: 0;
        padding-left: 0;
        padding-right: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    .brand-index-bar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    /* Yapışkan blok (sayım + arama + harf şeridi) yüksekliği için kaydırma payı */
    .brand-letter-section { scroll-margin-top: 11rem; }
    .publishers-toolbar { flex-direction: column; align-items: flex-start; }
    .publishers-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .featured-publishers { padding: 1.25rem; margin-bottom: 1rem; }
    .featured-title { font-size: 1.2rem; }
    .publishers-content { padding: 1rem; }

    .categories-page { padding: 1rem 0 2rem; }
    .main-categories-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .categories-hero { padding: 1.5rem 1rem; margin-bottom: 1.5rem; }
    .categories-hero-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .categories-hero-text { font-size: 0.95rem; }
    .main-categories-section .section-title { font-size: 1.4rem; }
    .main-category-card { padding: 1.25rem; }
    .main-category-icon { width: 60px; height: 60px; margin-bottom: 1rem; }
    .main-category-name { font-size: 1rem; }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .main-categories-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .publishers-page .page-title { font-size: 1.4rem; }
    .publishers-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .publisher-header { padding: 0.875rem; gap: 0.75rem; }
    .publisher-logo { width: 52px; height: 52px; font-size: 0.8rem; }
    .publisher-name { font-size: 0.95rem; }
    .publisher-content { padding: 0.875rem; }
    .publisher-description { font-size: 0.8rem; -webkit-line-clamp: 2; }
    .publisher-btn { padding: 0.6rem 0.75rem; font-size: 0.8rem; }

    .categories-page .page-title { font-size: 1.4rem; }
    .categories-hero { padding: 1rem; margin-bottom: 1rem; }
    .categories-hero-title { font-size: 1.25rem; }
    .main-categories-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .main-category-card { padding: 1rem 0.75rem; }
    .main-category-icon { width: 50px; height: 50px; margin-bottom: 0.75rem; border-radius: 10px; }
    .main-category-name { font-size: 0.9rem; margin-bottom: 0.25rem; }
    .main-category-description { font-size: 0.8rem; -webkit-line-clamp: 1; }
}
