/* Kategori sayfası (product/category) — sol dinamik filtre + ürün ızgarası. JS: hb-category.js */
.hb-cat { --hb-cat-accent: #f97316; background: #f8f8f8; padding-top: 24px; padding-bottom: 56px; }

/* Başlık (category_header): ad + sayı + kartın sonuna uzanan turuncu çizgi */
.hb-cat-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hb-cat-head-card { padding: 18px 24px; background: #fff; border-radius: 16px; box-shadow: 0 8px 24px -18px rgba(17, 24, 39, .25); }
.hb-cat-title { margin: 0; font-size: 24px; font-weight: 800; color: #111827; letter-spacing: -.01em; line-height: 1.25; }
.hb-cat-head-count { flex-shrink: 0; font-size: 13px; color: #9ca3af; white-space: nowrap; }
.hb-cat-head-line { flex: 1 1 40px; min-width: 40px; height: 4px; border-radius: 999px; background: var(--hb-cat-accent); }

/* Yan panel */
.hb-cat-aside { width: 100%; }
.hb-cat-sticky { position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 2px; }
.hb-cat-filters { display: grid; gap: 16px; }
.hb-cat-box { background: #fff; border-radius: 16px; padding: 18px 16px; box-shadow: 0 8px 24px -18px rgba(17, 24, 39, .25); }
.hb-cat-box-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #1f2937; cursor: default; list-style: none; }
.hb-cat-box-title small { font-weight: 400; color: #9ca3af; }
.hb-cat-group > summary { cursor: pointer; margin: 0; }
.hb-cat-group > summary::-webkit-details-marker { display: none; }
.hb-cat-group > summary i { color: #9ca3af; transition: transform .2s; }
.hb-cat-group[open] > summary { margin-bottom: 12px; }
.hb-cat-group[open] > summary i { transform: rotate(180deg); }

.hb-cat-tree, .hb-cat-children { list-style: none; margin: 0; padding: 0; }
.hb-cat-tree a { display: flex; align-items: center; gap: 4px; padding: 4px 0; font-size: 14px; color: #4b5563; transition: color .15s; }
.hb-cat-tree a:hover { color: var(--hb-cat-accent); }
.hb-cat-tree a span { color: #9ca3af; }
.hb-cat-tree .hb-cat-up { color: #6b7280; font-size: 13px; }
.hb-cat-tree .hb-cat-up i { font-size: 16px; color: #9ca3af; }
.hb-cat-tree .hb-cat-current { color: var(--hb-cat-accent); font-weight: 600; }
.hb-cat-tree .hb-cat-current span { color: var(--hb-cat-accent); }
.hb-cat-children { padding-left: 14px; max-height: 330px; overflow-y: auto; scrollbar-width: thin; }

.hb-cat-search { position: relative; display: block; margin-bottom: 12px; }
.hb-cat-search input { width: 100%; height: 38px; padding: 0 34px 0 12px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; background: #fff; outline: none; }
.hb-cat-search input:focus { border-color: var(--hb-cat-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .12); }
.hb-cat-search i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }

.hb-cat-options { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.hb-cat-check, .hb-cat-switch { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 14px; color: #374151; cursor: pointer; border-radius: 8px; }
.hb-cat-check:hover span, .hb-cat-switch:hover span { color: var(--hb-cat-accent); }
.hb-cat-check span, .hb-cat-switch span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hb-cat-check em, .hb-cat-switch em { font-style: normal; font-size: 12px; color: #9ca3af; }
.hb-cat-check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--hb-cat-accent); cursor: pointer; }
.hb-cat-none { margin: 6px 2px; font-size: 13px; color: #9ca3af; }

.hb-cat-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hb-cat-switch i { position: relative; width: 34px; height: 20px; flex-shrink: 0; border-radius: 999px; background: #e5e7eb; transition: background .15s; }
.hb-cat-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.hb-cat-switch input:checked + i { background: var(--hb-cat-accent); }
.hb-cat-switch input:checked + i::after { transform: translateX(14px); }
.hb-cat-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(249, 115, 22, .25); }

.hb-cat-price { display: flex; align-items: center; gap: 6px; }
.hb-cat-price label { flex: 1; min-width: 0; }
.hb-cat-price input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; outline: none; -moz-appearance: textfield; }
.hb-cat-price input::-webkit-outer-spin-button, .hb-cat-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hb-cat-price input:focus { border-color: var(--hb-cat-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .12); }
.hb-cat-price > span { color: #9ca3af; }
.hb-cat-price button { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--hb-cat-accent); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.hb-cat-price button:hover { filter: brightness(.95); }
.hb-cat-apply { height: 40px; border-radius: 12px; background: var(--hb-cat-accent); color: #fff; font-weight: 600; }
.hb-cat-results { display: none; }

/* Araç çubuğu */
.hb-cat-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 16px; padding: 14px 24px; background: #fff; border-radius: 999px; box-shadow: 0 8px 24px -18px rgba(17, 24, 39, .3); }
.hb-cat-open { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: #fff7ed; color: var(--hb-cat-accent); font-size: 14px; font-weight: 600; }
.hb-cat-sort { position: relative; display: inline-flex; align-items: center; color: var(--hb-cat-accent); }
.hb-cat-sort select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 26px 0 2px; border: 0; background: transparent; color: var(--hb-cat-accent); font-size: 14px; font-weight: 500; cursor: pointer; outline: none; }
.hb-cat-sort i { position: absolute; right: 2px; pointer-events: none; }
.hb-cat-bulk-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 2px; color: var(--hb-cat-accent); font-size: 14px; font-weight: 500; }
.hb-cat-bulk-toggle[aria-pressed="true"] { padding: 0 14px; border-radius: 999px; background: var(--hb-cat-accent); color: #fff; }
.hb-cat-count { margin-left: auto; font-size: 13px; color: #9ca3af; white-space: nowrap; }
.hb-cat-view { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: #374151; }
.hb-cat-view button { display: inline-flex; gap: 2px; padding: 4px; border-radius: 6px; }
.hb-cat-view button i { width: 5px; height: 14px; border-radius: 2px; background: #d1d5db; transition: background .15s; }
.hb-cat-view button[aria-pressed="true"] i { background: var(--hb-cat-accent); }
.hb-cat-view button:hover i { background: #fdba74; }

/* Seçili filtreler */
.hb-cat-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.hb-cat-chips-label { font-size: 13px; color: #6b7280; }
.hb-cat-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 12px; border-radius: 999px; background: #fff; color: #374151; font-size: 13px; box-shadow: 0 0 0 1px #e5e7eb inset; transition: box-shadow .15s, color .15s; }
.hb-cat-chip:hover { color: var(--hb-cat-accent); box-shadow: 0 0 0 1px var(--hb-cat-accent) inset; }
.hb-cat-chip-clear { font-size: 13px; color: var(--hb-cat-accent); font-weight: 500; }

/* Izgara */
.hb-cat-grid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 16px; transition: opacity .2s; }
.hb-cat-grid[data-cols="3"] { --cols: 3; }
.hb-cat-grid.is-loading { opacity: .45; pointer-events: none; }
.hb-cat-item { position: relative; min-width: 0; }
.hb-cat-item.is-new { animation: hb-cat-in .35s ease both; }
@keyframes hb-cat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hb-cat-pick { position: absolute; z-index: 5; top: 10px; left: 10px; display: none; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); font-size: 12px; font-weight: 600; color: #374151; cursor: pointer; }
.hb-cat-pick input { width: 16px; height: 16px; accent-color: var(--hb-cat-accent); }
.hb-cat-grid.is-bulk .hb-cat-pick { display: inline-flex; }
.hb-cat-grid.is-bulk .hb-cat-item:has(.hb-cat-pick input:checked) > div { box-shadow: 0 0 0 2px var(--hb-cat-accent); border-radius: 12px; }

.hb-cat-empty { padding: 56px 16px; text-align: center; color: #6b7280; background: #fff; border-radius: 16px; }
.hb-cat-empty i { display: block; margin-bottom: 10px; font-size: 44px; color: #d1d5db; }
.hb-cat-empty-hint { margin-top: 4px; font-size: 13px; color: #9ca3af; }

.hb-cat-more { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 0 8px; }
.hb-cat-more-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 220px; height: 44px; padding: 0 24px; border-radius: 999px; background: #fff; color: var(--hb-cat-accent); font-weight: 600; box-shadow: 0 0 0 1px #fed7aa inset; transition: background .15s; }
.hb-cat-more-btn:hover { background: #fff7ed; }
.hb-cat-status { min-height: 20px; font-size: 13px; color: #9ca3af; display: flex; align-items: center; gap: 8px; }
.hb-cat-status.is-loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fed7aa; border-top-color: var(--hb-cat-accent); animation: hb-cat-spin .7s linear infinite; }
@keyframes hb-cat-spin { to { transform: rotate(360deg); } }

.hb-cat-desc { padding: 24px; background: #fff; border-radius: 16px; font-size: 14px; line-height: 1.7; color: #4b5563; }
.hb-cat-desc.is-collapsed .hb-cat-desc-body { max-height: 140px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.hb-cat-desc-toggle { margin-top: 10px; color: var(--hb-cat-accent); font-weight: 600; font-size: 14px; }

/* Toplu sepete ekleme çubuğu */
.hb-cat-bulkbar { position: fixed; z-index: 110; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 22px; border-radius: 999px; background: #111827; color: #fff; font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.hb-cat-bulkbar[hidden] { display: none; }
.hb-cat-bulkbar button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--hb-cat-accent); font-weight: 600; }
.hb-cat-bulkbar button:disabled { opacity: .6; }

.hb-cat-drawer-head, .hb-cat-backdrop { display: none; }

@media (max-width: 1279px) {
  .hb-cat-grid { --cols: 3; }
  .hb-cat-grid[data-cols="3"] { --cols: 2; }
}

/* Tablet / telefon: filtre çekmece olur */
@media (max-width: 1023px) {
  .hb-cat-aside, .hb-cat-sticky { position: fixed; z-index: 130; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); max-height: none; padding: 0 14px 90px; background: #f8f8f8; transform: translateX(-102%); transition: transform .25s ease; }
  .hb-cat-aside.is-open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .hb-cat-backdrop { position: fixed; z-index: 129; inset: 0; background: rgba(17, 24, 39, .45); }
  .hb-cat-aside.is-open + .hb-cat-backdrop { display: block; }
  .hb-cat-drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0 -14px 12px; padding: 14px; background: #f8f8f8; font-size: 17px; font-weight: 700; color: #111827; }
  .hb-cat-drawer-head button { font-size: 24px; color: #6b7280; }
  .hb-cat-results { position: fixed; bottom: 14px; left: 14px; width: calc(min(340px, 88vw) - 28px); display: block; height: 46px; border-radius: 12px; background: var(--hb-cat-accent); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(249, 115, 22, .35); }
  .hb-cat-open { display: inline-flex; }
  .hb-cat-toolbar { border-radius: 18px; padding: 10px 14px; gap: 8px 14px; }
  .hb-cat-count { order: 9; width: 100%; margin: 0; }
  .hb-cat-bulkbar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 639px) {
  .hb-cat-title { font-size: 20px; }
  .hb-cat-head { flex-wrap: wrap; gap: 6px 12px; }
  .hb-cat-head-card { padding: 14px 16px; }
  .hb-cat-grid, .hb-cat-grid[data-cols="3"] { --cols: 2; gap: 10px; }
  .hb-cat-view { display: none; }
  .hb-cat-bulk-toggle span { font-size: 13px; }
  .hb-cat-bulkbar { width: calc(100% - 24px); justify-content: space-between; padding-left: 16px; }
}
