/* Página de categoría: cabecera tintada y barra de filtros (views/pages/category.php). */

.cat-page { --h: 210; padding-top: 8px; padding-bottom: 0; }
.cat-page .crumbs { margin-bottom: 6px; }

/* ---------- Cabecera ---------- */
.cat-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 18px;
  margin-bottom: 8px; padding: 12px 22px; border-radius: 24px;
  background: linear-gradient(135deg, hsl(var(--h) 90% 93%), hsl(var(--h) 80% 82%));
  border: 1px solid hsl(var(--h) 55% 72%);
}
.cat-hero::before, .cat-hero::after { content: ""; position: absolute; border-radius: 50%; background: hsl(var(--h) 80% 70% / .5); pointer-events: none; }
.cat-hero::before { width: 260px; height: 260px; right: -60px; top: -120px; }
.cat-hero::after { width: 140px; height: 140px; right: 140px; bottom: -80px; }
.cat-hero > * { position: relative; z-index: 1; }

.cat-hero-ico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: #fff; font-size: 1.8rem; box-shadow: 0 12px 24px -12px hsl(var(--h) 60% 35% / .5); }
.cat-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); line-height: 1.05; letter-spacing: -.035em; }
.cat-hero-tx p { margin: .15rem 0 0; color: hsl(var(--h) 35% 24%); }
.cat-hero-n { padding: .4rem .95rem; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid hsl(var(--h) 55% 72%); font-size: .9rem; color: hsl(var(--h) 25% 30%); }
.cat-hero-n b { font-size: 1.1rem; color: var(--ink); }
.cat-hero-notice { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: .25rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .85); border: 1px solid hsl(var(--h) 55% 72%); font-size: .9rem; font-weight: 600; }

/* ---------- Barra de filtros ---------- */
.toolbar {
  display: grid; gap: 6px; margin-bottom: 8px; padding: 8px 12px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, .06); border-radius: 22px; box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
}

.tb-search { position: relative; display: block; }
.tb-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tb-search input {
  width: 100%; height: 40px; padding: 0 16px 0 44px; border: 1.5px solid transparent; border-radius: 14px;
  background: #f1f4f8; font: inherit; transition: background .15s, box-shadow .15s, border-color .15s;
}
.tb-search input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--glow); }

/* Marcas como chips (carrusel horizontal si no entran) */
.tb-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.tb-chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 7px; padding: .3rem .85rem; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; font-weight: 700; font-size: .92rem; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.chip small { font-size: .74rem; font-weight: 700; color: var(--muted); background: #f1f4f8; padding: .05rem .45rem; border-radius: 999px; }
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .5); }
.chip input:checked + span small { background: rgba(255, 255, 255, .18); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.chip:active span { transform: scale(.97); }

/* Destacados, orden, cantidad */
.tb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.tb-toggle { cursor: pointer; }
.tb-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tb-toggle span { display: inline-flex; align-items: center; gap: 7px; padding: .28rem .85rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; font-size: .9rem; transition: background .15s, border-color .15s; }
.tb-toggle i { font-style: normal; color: #b8860b; }
.tb-toggle input:checked + span { background: var(--brand-soft); border-color: var(--brand); }
.tb-toggle input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.tb-sort { display: inline-flex; align-items: center; }
.tb-sort select { padding: .28rem 1.8rem .28rem .8rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.tb-sort select:focus { outline: 3px solid var(--brand); outline-offset: 1px; }

.tb-count { margin-left: auto; font-size: .9rem; color: var(--muted); }
.tb-count b { color: var(--ink); font-size: 1rem; }
.tb-clear { font-size: .9rem; font-weight: 700; color: var(--danger); text-decoration: none; }
.tb-clear:hover { text-decoration: underline; }
.tb-clear[hidden] { display: none; }

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .cat-hero { grid-template-columns: auto 1fr; padding: 14px 16px; border-radius: 22px; gap: 8px 14px; margin-bottom: 10px; }
  .cat-hero::before { width: 180px; height: 180px; right: -70px; top: -90px; }
  .cat-hero::after { display: none; }
  .cat-hero-ico { width: 52px; height: 52px; border-radius: 16px; font-size: 1.6rem; }
  .cat-hero h1 { font-size: 1.6rem; }
  .cat-hero-tx p { font-size: .85rem; margin-top: .1rem; }
  .cat-hero-n { display: none; } /* la cantidad ya está en la barra de filtros */
  .cat-hero-notice { font-size: .82rem; padding: .3rem .7rem; }

  .toolbar { position: static; gap: 8px; padding: 8px; border-radius: 18px; margin-bottom: 10px; }
  .tb-search input { height: 42px; font-size: .95rem; }
  .tb-chips { margin: 0 -8px; padding: 2px 8px; }
  .chip span { padding: .35rem .8rem; font-size: .85rem; }
  .tb-row { gap: 8px; }
  .tb-sort select { font-size: .85rem; padding-top: .35rem; padding-bottom: .35rem; }
  .tb-toggle span { font-size: .85rem; padding: .35rem .75rem; }
  .tb-count { flex: 1 1 60%; margin-left: 0; font-size: .82rem; order: 5; }
  .tb-clear { order: 6; margin-left: auto; font-size: .85rem; }
}
