/* Mağaza üst filtre çubuğu — resources/views/frontend/partials/shop_filter_bar.blade.php, assets/js/shop-filter-bar.js
   Tasarım dili: vurgu #f97316 (hover #ea580c, açık #fff7ed), metin #111827 / #6b7280, kenarlık #e5e7eb. */

.sfb { margin-bottom: 16px; }
.sfb-row { display: flex; align-items: flex-start; gap: 12px; }
.sfb-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }

/* ── Çip ── */
.sfb-item { position: relative; }
.sfb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border: 1px solid #e5e7eb; border-radius: 8px; background: #fff;
    color: #111827; font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
    cursor: pointer; text-decoration: none; transition: border-color .15s, background-color .15s;
}
.sfb-chip:hover { border-color: #f97316; color: #111827; text-decoration: none; }
.sfb-chip:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }
.sfb-chip.is-active { border-color: #f97316; background: #fff7ed; color: #c2410c; font-weight: 600; }
.sfb-chip-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sfb-caret { font-size: 14px; color: #6b7280; transition: transform .2s; }
.sfb-item.is-open .sfb-caret { transform: rotate(180deg); }
.sfb-chip.is-active .sfb-caret { color: #c2410c; }
.sfb-chip-toggle i { font-size: 17px; color: #9ca3af; }
.sfb-chip-toggle.is-active i { color: #f97316; }
.sfb-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #f97316; color: #fff; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sfb-count { color: #9ca3af; font-size: 12px; font-weight: 400; }

/* ── Panel (masaüstü: çipin altında) ── */
.sfb-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 1030;
    width: 300px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .12);
    display: flex; flex-direction: column;
}
.sfb-panel[hidden] { display: none; }
.sfb-panel-right { left: auto; right: 0; }
.sfb-panel-wide { width: 520px; }
.sfb-panel-head { display: none; }
.sfb-form { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.sfb-panel-body { padding: 8px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sfb-panel-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px 12px; border-top: 1px solid #e5e7eb;
}

.sfb-search { position: relative; padding: 10px 10px 2px; }
.sfb-search i { position: absolute; left: 20px; top: 50%; transform: translateY(-30%); color: #9ca3af; }
.sfb-search-input {
    width: 100%; height: 34px; padding: 0 10px 0 32px;
    border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; color: #111827;
}
.sfb-search-input:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px #fff7ed; }

/* Seçenekler */
.sfb-option {
    display: flex; align-items: center; gap: 8px; margin: 0;
    padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #111827;
}
.sfb-option[hidden] { display: none; }
.sfb-option:hover { background: #f5f6f8; }
.sfb-option input { position: absolute; opacity: 0; pointer-events: none; }
.sfb-check {
    flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid #d1d5db; border-radius: 4px; background: #fff;
    position: relative; transition: background-color .15s, border-color .15s;
}
.sfb-option input:checked + .sfb-check { background: #f97316; border-color: #f97316; }
.sfb-option input:checked + .sfb-check::after {
    content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sfb-option input:focus-visible + .sfb-check { box-shadow: 0 0 0 3px #fed7aa; }
.sfb-option .hg-color-dot { margin-right: 0; width: 16px; height: 16px; }
.sfb-option-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfb-option.is-empty .sfb-option-label { color: #9ca3af; }
.sfb-options-color { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; }
.sfb-no-match { padding: 12px 8px; color: #6b7280; font-size: 13px; text-align: center; }

/* Fiyat */
.sfb-presets { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sfb-preset { display: block; padding: 7px 8px; border-radius: 6px; color: #111827; font-size: 13px; }
.sfb-preset:hover { background: #f5f6f8; color: #111827; text-decoration: none; }
.sfb-preset.is-selected { background: #fff7ed; color: #c2410c; font-weight: 600; }
.sfb-range { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; }
.sfb-input {
    width: 100%; min-width: 0; height: 36px; padding: 0 10px;
    border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; color: #111827;
}
.sfb-input:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px #fff7ed; }
.sfb-range-sep { color: #6b7280; }

/* Kategori ağacı */
.sfb-cats { max-height: 420px; columns: 2; column-gap: 16px; padding: 10px 12px; }
/* Sütun kırılması ana kategori içinde olabilir ama alt grubun (ör. Cilt Bakımı + yaprakları) ortasında olmaz */
.sfb-cat-group { margin-bottom: 10px; }
.sfb-cat-root { break-after: avoid; }
.sfb-cat-sub { break-inside: avoid; padding-bottom: 4px; }
.sfb-cat {
    display: flex; justify-content: space-between; gap: 8px;
    padding: 4px 6px; border-radius: 6px; color: #4b5563; font-size: 13px;
}
.sfb-cat:hover { background: #f5f6f8; color: #111827; text-decoration: none; }
.sfb-cat-all { column-span: all; font-weight: 600; color: #111827; margin-bottom: 8px; }
.sfb-cat-root { font-weight: 600; color: #111827; }
.sfb-cat-children { padding-left: 10px; border-left: 1px solid #e5e7eb; margin-left: 6px; }
.sfb-cat-leaf { padding-left: 16px; font-size: 12.5px; }
.sfb-cat.is-selected { background: #fff7ed; color: #c2410c; font-weight: 600; }
.sfb-cat.is-empty { color: #c0c4cc; }

/* Butonlar */
.sfb-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 34px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.sfb-btn-primary { background: #f97316; color: #fff; box-shadow: 0 2px 6px rgba(249, 115, 22, .25); }
.sfb-btn-primary:hover { background: #ea580c; color: #fff; }
.sfb-btn-link { background: transparent; color: #6b7280; padding: 0 4px; }
.sfb-btn-link:hover { color: #111827; text-decoration: none; }

/* ── Sıralama ── */
.sfb-sort { flex: 0 0 auto; }
.sfb-sort form { margin: 0; }
.sfb-select {
    height: 36px; padding: 0 32px 0 12px; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none; appearance: none;
    color: #111827; font-size: 13px; cursor: pointer;
}
.sfb-select:hover, .sfb-select:focus { border-color: #f97316; outline: none; }

/* ── Seçili filtre etiketleri ── */
.sfb-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sfb-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 10px; border-radius: 15px;
    background: #f3f4f6; color: #111827; font-size: 12.5px; text-decoration: none;
}
.sfb-pill .hg-color-dot { margin-right: 0; width: 12px; height: 12px; }
.sfb-pill i { color: #6b7280; font-size: 13px; }
.sfb-pill:hover { background: #fff7ed; color: #c2410c; text-decoration: none; }
.sfb-pill:hover i { color: #c2410c; }
.sfb-clear { font-size: 12.5px; font-weight: 600; color: #f97316; margin-left: 4px; }
.sfb-clear:hover { color: #ea580c; }

.sfb-backdrop { display: none; }

/* Boş sonuç */
.sfb-empty { text-align: center; padding: 48px 16px; }
.sfb-empty i { font-size: 56px; color: #d1d5db; }
.sfb-empty p { margin: 12px 0 16px; color: #6b7280; }

/* ── Mobil: çipler yatay kayar, panel alttan açılır ── */
@media (max-width: 767.98px) {
    .sfb { margin-bottom: 12px; }
    .sfb-row { flex-direction: column-reverse; gap: 10px; }
    .sfb-sort, .sfb-select { width: 100%; }
    .sfb-chips {
        flex-wrap: nowrap; overflow-x: auto; width: 100%;
        margin: 0 -10px; padding: 0 10px 2px; width: calc(100% + 20px);
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .sfb-chips::-webkit-scrollbar { display: none; }
    .sfb-item { position: static; }
    .sfb-panel, .sfb-panel-wide {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1060;
        width: 100%; max-width: none; max-height: 82vh;
        border-radius: 16px 16px 0 0; border: 0; box-shadow: 0 -8px 30px rgba(17, 24, 39, .18);
    }
    .sfb-panel-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 16px; border-bottom: 1px solid #e5e7eb; font-size: 16px; font-weight: 700; color: #111827;
    }
    .sfb-panel-close { border: 0; background: transparent; font-size: 22px; color: #6b7280; padding: 0 4px; }
    .sfb-form { flex: 1 1 auto; overflow: hidden; }
    .sfb-panel-body { max-height: none; flex: 1 1 auto; padding: 8px 12px; }
    .sfb-cats { columns: 1; overflow-y: auto; max-height: calc(82vh - 56px); }
    .sfb-option { padding: 10px 8px; font-size: 14px; }
    .sfb-panel-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .sfb-panel-foot .sfb-btn-primary { flex: 1 1 auto; height: 44px; font-size: 15px; }
    .sfb-backdrop { display: block; position: fixed; inset: 0; z-index: 1055; background: rgba(17, 24, 39, .45); }
    .sfb-backdrop[hidden] { display: none; }
    body.sfb-sheet-open { overflow: hidden; }
}
