/* ==========================================================================
   Listeleme sayfaları (Kategori.html): kategori, marka, arama, fırsatlar + /kategoriler
   Değerler Kategori.html inline stillerinden birebir alınmıştır.
   ========================================================================== */

.cat-page { display: flex; flex-direction: column; gap: 24px; padding-bottom: 64px; }
.cat-page .breadcrumb { margin-bottom: -24px; }

/* ---------- Başlık + alt kategori çipleri ---------- */
.cat-head { display: flex; flex-direction: column; gap: 16px; }
.cat-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.cat-title .page-title { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
/* Kategori metni: kısa giriş (başlık altında) ve rehber (ürünlerin altında); yalnızca filtresiz ilk sayfa */
.cat-intro { max-width: 880px; }
.cat-intro p { margin: 0; }
.cat-guide { max-width: 880px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.cat-guide > h2:first-child { margin-top: 0; }
.cat-guides { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.cat-guides-label { color: var(--muted); font-weight: 600; }
.cat-guides a { color: var(--petrol-600); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 767px) {
  /* Mobilde ürünler aşağı itilmesin: ilk 3 rehber + "Tüm rehberler" */
  .cat-guides a:not(.cat-guides-all):nth-of-type(n+4) { display: none; }
}
.cat-total { font-size: 15px; color: var(--muted); }

.sub-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sub-chip {
  height: 44px; padding: 0 16px 0 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.sub-chip:hover { border-color: var(--petrol-300); color: var(--ink); }
.sub-chip-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--petrol-500); flex-shrink: 0; }

/* ---------- Yerleşim ---------- */
.cat-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 32px; align-items: start; }
.cat-results { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Filtre kenar çubuğu ---------- */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); }
.filters-form { display: flex; flex-direction: column; }
.filters-head, .filters-foot { display: none; }
.fgroup { margin: 0; padding: 20px; border: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fgroup + .fgroup { border-top: 1px solid var(--border-soft); }
.fgroup-title { padding: 0; margin: 0; font-family: var(--font-body); font-size: 15px; font-weight: 800; letter-spacing: 0; color: var(--ink); }
/* float: legend normal bir esnek öğe olur, gap uygulanır */
legend.fgroup-title { float: left; width: 100%; }

.fcat { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink); text-decoration: none; }
.fcat:hover { color: var(--orange-700); }
.fcat[aria-current] { font-weight: 800; color: var(--orange-700); }
.fcat-back { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.fcat-back:hover { color: var(--ink); }
.fcount { color: var(--muted); font-size: 13px; font-weight: 500; }
.fcat .fcount { font-size: 14px; }

/* Fiyat aralığı (çift tutamaklı kaydırıcı) */
.fgroup:has(.price-inputs) { gap: 14px; }
.range { position: relative; height: 20px; margin: 0 10px; }
.range-track { position: absolute; left: -10px; right: -10px; top: 8px; height: 4px; border-radius: 2px; background: var(--border); }
.range-fill { position: absolute; top: 8px; left: 0; width: 100%; height: 4px; border-radius: 2px; background: var(--orange-600); }
.range input[type="range"] {
  position: absolute; left: -10px; top: 0; width: calc(100% + 20px); height: 20px; margin: 0; padding: 0; background: transparent;
  -webkit-appearance: none; appearance: none; pointer-events: none; outline: none;
}
.range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 20px; }
.range input[type="range"]::-moz-range-track { background: transparent; height: 20px; }
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--orange-600); cursor: grab; box-sizing: border-box;
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--orange-600); cursor: grab; box-sizing: border-box;
}
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.price-input {
  width: 100%; height: 40px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 0 10px;
  font-size: 14px; color: var(--ink); background: #fff; outline: none;
}
.price-input:focus { border-color: var(--petrol-600); box-shadow: 0 0 0 3px rgba(31, 95, 102, .14); }
.price-apply {
  align-self: flex-end; width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: var(--radius-sm);
  background: var(--petrol-600); color: #fff; display: flex; align-items: center; justify-content: center;
}
.price-apply:hover { background: var(--petrol-700); }

/* Marka araması + onay kutuları */
.fsearch { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); color: var(--muted); }
.fsearch:focus-within { border-color: var(--petrol-600); box-shadow: 0 0 0 3px rgba(31, 95, 102, .14); }
.fsearch input { flex-grow: 1; min-width: 0; border: 0; outline: none; font-size: 14px; color: var(--ink); background: transparent; }
.flist { display: flex; flex-direction: column; gap: 12px; }
.fcheck { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 20px; }
.fcheck input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--orange-600); cursor: pointer; }
.fcheck-label { flex-grow: 1; min-width: 0; }
.fcheck .stars { gap: 2px; }
.fempty { font-size: 13px; color: var(--muted); }
.fmore, .fclear-link {
  align-self: flex-start; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 800; color: var(--orange-700); text-decoration: none;
}
.fmore:hover, .fclear-link:hover { color: var(--orange-800); text-decoration: underline; }

/* Renk örnekleri */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 32px; height: 32px; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch-dot { display: block; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-input); pointer-events: none; }
.swatch input:checked + .swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--orange-600); }
.swatch input:focus-visible + .swatch-dot { outline: 2px solid var(--orange-600); outline-offset: 3px; }

/* ---------- Araç çubuğu ---------- */
.cat-toolbar {
  min-height: 60px; padding: 10px 12px 10px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.result-text { font-size: 14px; color: var(--muted); min-width: 0; }
.result-text strong { color: var(--ink); }
.tb-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.btn-filter { display: none; }
.sort-form { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort-form select {
  height: 40px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 0 36px 0 12px; font-size: 14px; font-weight: 600;
  color: var(--ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23141A2E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;
}
.sort-form select:focus-visible { border-color: var(--petrol-600); box-shadow: 0 0 0 3px rgba(31, 95, 102, .14); }
.view-toggle { display: flex; gap: 4px; }
.view-toggle a {
  width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.view-toggle a:hover { border-color: var(--petrol-300); color: var(--ink); }
.view-toggle a[aria-current="true"] { background: var(--petrol-600); border-color: var(--petrol-600); color: #fff; }

/* ---------- Seçili filtre çipleri ---------- */
.fchips { min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fchips-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.fchip {
  height: 34px; padding: 0 10px 0 14px; border-radius: var(--radius-pill); background: var(--petrol-600); color: #fff;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.fchip:hover { background: var(--petrol-700); color: #fff; }
.fclear { margin-left: 6px; font-size: 13px; font-weight: 800; color: var(--orange-700); }

/* ---------- Liste görünümü (yatay kart) ---------- */
.pgrid.is-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pgrid.is-list .pcard { flex-direction: row; }
.pgrid.is-list .pcard-media { width: 232px; aspect-ratio: auto; height: auto; min-height: 220px; }
.pgrid.is-list .pcard-body { padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; grid-template-rows: auto auto 1fr; gap: 8px 24px; align-content: start; }
.pgrid.is-list .pcard-title { grid-column: 1; }
.pgrid.is-list .pcard-name { height: auto; font-size: 16px; line-height: 22px; }
.pgrid.is-list .pcard-rating, .pgrid.is-list .pcard-ship { grid-column: 1; }
.pgrid.is-list .pcard-price { grid-column: 2; grid-row: 1; justify-content: flex-end; }
.pgrid.is-list .pcard-price .price { font-size: 24px; }
.pgrid.is-list .pcard-cta { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; align-self: end; }

/* ---------- Boş sonuç ---------- */
.cat-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); padding: 48px 24px; }
.cat-empty-chips { justify-content: center; margin-top: 8px; }

/* ==========================================================================
   /kategoriler
   ========================================================================== */
.allcats-jump { display: none; }
/* Düzenli ızgara: kapalıyken tüm kartlar aynı yükseklikte (liste 4 alt kategori + "daha" satırına göre), kısa kartların altı boş kalır.
   "+N alt kategori daha" açılınca yalnızca o kartın satırı uzar. */
.allcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.allcat { scroll-margin-top: 16px; overflow: hidden; display: flex; flex-direction: column; }
.allcat-head { display: flex; align-items: center; gap: 14px; padding: 20px; min-height: 108px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--border-soft); }
.allcat-head:hover { color: var(--ink); background: var(--surface-2); }
.allcat-head:last-child { border-bottom: 0; }
.allcat-head:hover h2 { text-decoration: underline; }
.allcat-icon { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--petrol-500); flex-shrink: 0; }
.allcat-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.allcat-text h2 { font-size: 19px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.allcat-text span { font-size: 13px; color: var(--muted); }
.allcat-chev { color: var(--subtle); }
.allcat-list { list-style: none; padding: 6px 10px 10px; margin: 0; display: flex; flex-direction: column; }
.allcat-list a { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.allcat-list a:hover { background: var(--ground); color: var(--ink); }
.allcat-list .tile-icon { width: 30px; height: 30px; }
.allcat-name { flex-grow: 1; min-width: 0; }
.allcat-list { min-height: 236px; }
.allcat-more { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 4px; padding: 0 8px; border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--orange-700); cursor: pointer; text-align: left; }
.allcat-more:hover { background: var(--ground); color: var(--orange-800); }
.allcat-more svg { transition: transform .15s; }
.allcat-more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ==========================================================================
   DUYARLI
   ========================================================================== */
@media (max-width: 1279px) {
  .cat-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
  .pgrid.is-list .pcard-media { width: 200px; }
}

/* Tablet ve mobil: filtreler "Filtrele" butonuyla açılan panelde */
@media (max-width: 1023px) {
  .cat-page { gap: 16px; padding-bottom: 32px; }
  .cat-page .breadcrumb { margin-bottom: -16px; }
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
  .allcats-jump { display: flex; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }

  .filters { display: none; }
  .filters.is-open {
    display: block; position: fixed; z-index: 200; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
    border: 0; border-radius: 0; box-shadow: var(--shadow-pop); animation: filters-in .2s ease-out;
  }
  .filters.is-open .filters-form { height: 100%; }
  .filters-head { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 8px 0 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .filters-head h2 { font-size: 20px; font-weight: 700; }
  .filters-body { flex-grow: 1; overflow-y: auto; overscroll-behavior: contain; }
  .filters-foot {
    display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-sticky); flex-shrink: 0;
  }
  .filters-foot .btn { height: 48px; }
  .fcheck { min-height: 32px; }
  .fcat { min-height: 32px; align-items: center; }
  .filters-backdrop { position: fixed; inset: 0; z-index: 199; background: rgba(20, 26, 46, .45); }

  .cat-toolbar { padding: 12px; }
  .result-text { width: 100%; }
  .tb-actions { width: 100%; margin-left: 0; }
  .btn-filter {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border: 1.5px solid var(--petrol-600);
    border-radius: var(--radius-input); background: #fff; color: var(--petrol-600); font-size: 14.5px; font-weight: 800;
  }
  .btn-filter:hover { background: var(--petrol-50); }
  .btn-filter-count {
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--orange-600); color: #fff;
    font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  }
  .sort-form { flex-grow: 1; justify-content: flex-end; }
  .sort-form select { height: 44px; }
  .fchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .fchips::-webkit-scrollbar { display: none; }
  .fchips-label { display: none; }
  .fchip { height: 36px; flex-shrink: 0; }
  .fclear { flex-shrink: 0; white-space: nowrap; }
}

@media (max-width: 767px) {
  .cat-title .page-title { font-size: 28px; }
  .cat-total { font-size: 14px; }
  .sub-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px; }
  .sub-chips::-webkit-scrollbar { display: none; }
  .filters.is-open { width: 100%; box-shadow: none; }
  .result-text { display: none; }
  .cat-toolbar { padding: 0; background: transparent; border: 0; min-height: 0; }
  .tb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn-filter { width: 100%; }
  .sort-form { justify-content: stretch; }
  .sort-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sort-form select { width: 100%; border: 1.5px solid var(--border-input); border-radius: var(--radius-input); }
  .view-toggle { display: none; }

  .pgrid.is-list .pcard-media { width: 128px; min-height: 0; height: auto; }
  .pgrid.is-list .pcard-media > a > svg { width: 64px; }
  .pgrid.is-list .pcard-body { display: flex; padding: 10px 12px; }
  .pgrid.is-list .pcard-name { font-size: 13.5px; line-height: 19px; }
  .pgrid.is-list .pcard-price { justify-content: flex-start; }
  .pgrid.is-list .pcard-price .price { font-size: 17px; }
  .cat-empty { padding: 32px 16px; }

  .allcats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .allcat-head { min-height: 0; }
  .allcat-list { min-height: 0; }
  .allcat-head { padding: 16px; }
  .allcat-icon { width: 48px; height: 48px; }
  .allcat-text h2 { font-size: 18px; }
}

@keyframes filters-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
