/* ==========================================================================
   category.css — Layout compartido de páginas de categoría / ambientes
   ========================================================================== */

/* Breadcrumb */
.crumb {
  padding: 22px 0 0;
  font-size: .82rem;
  color: var(--ink-soft);
}

/* Hero principal — mismo marco visual que el resto del sitio */
body.page-category .wrap.crumb,
body.page-category .wrap.cat-hero,
body.page-category .filterbar > .wrap,
body.page-category .grid-sec > .wrap,
body.page-category .define > .wrap,
body.page-category .faq > .wrap,
body.page-category .related > .wrap,
body.page-category .contact > .wrap {
  width: min(var(--frame-max), calc(100% - (var(--frame-gutter) * 2)));
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

body.page-category .wrap.crumb {
  padding-top: clamp(20px, 2.5vw, 28px);
}

body.page-category .cat-hero {
  padding-top: clamp(36px, 3.5vw, 52px);
  padding-bottom: clamp(30px, 3vw, 48px);
  gap: clamp(48px, 5.5vw, 72px);
}

body.page-category .cat-hero h1 {
  margin: 16px 0 22px;
}

body.page-category .cat-hero p,
body.page-category .cat-hero p.lead {
  max-width: 54ch;
  line-height: 1.65;
}

body.page-category .page-estaciones .cat-hero p {
  max-width: 52ch;
}

.crumb a:hover {
  color: var(--ink);
}

.crumb span {
  margin: 0 8px;
  opacity: .5;
}

/* Category hero */
.cat-hero {
  padding: 34px 0 30px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
  min-width: 0;
}

.page-estaciones .cat-hero {
  padding-bottom: 46px;
}

.cat-hero h1 {
  font-weight: var(--fw-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
  margin: 14px 0 20px;
}

.page-estaciones .cat-hero h1 {
  line-height: var(--lh-display);
}

.cat-hero h1 b {
  font-weight: var(--fw-emphasis);
}

.cat-hero p,
.cat-hero p.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  max-width: 50ch;
  margin-bottom: 30px;
}

.page-estaciones .cat-hero p {
  max-width: 48ch;
}

.cat-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.cat-visual {
  aspect-ratio: 5/4;
  border-radius: var(--frame-radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
}

.cat-visual .ph {
  position: absolute;
  left: 22px;
  bottom: 18px;
  color: rgba(255, 255, 255, .65);
  font-size: .78rem;
}

.inicio-img,
.est-img,
.rcard-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.inicio-img {
  z-index: 0;
}

.est-img {
  z-index: 0;
}

/* Define band */
.define {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.define .wrap {
  padding: 30px 36px;
}

.define p {
  font-size: 1.06rem;
  color: var(--ink-mid);
  max-width: 90ch;
}

.define b {
  color: var(--ink);
}

/* Product grid */
.grid-sec {
  padding: 48px 0 30px;
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  min-width: 0;
}

.pcard {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .35s;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pcard:hover {
  box-shadow: var(--shadow);
}

.pcard .pimg {
  aspect-ratio: 4/3;
  position: relative;
  display: block;
  background: linear-gradient(150deg, #ececec, #dcdcdc);
  overflow: hidden;
}

.pcard .pimg .tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--line);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ink-mid);
}

.pcard .pimg .ph {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: .7rem;
  color: rgba(0, 0, 0, .32);
}

.pbody {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pbody .kicker {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 6px;
  min-height: .8rem;
}

.pbody h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 6px;
}

.page-estaciones .pbody h3 {
  font-size: 1.2rem;
}

.pbody p {
  font-size: .9rem;
  color: var(--ink-soft);
  flex: 1;
  margin-bottom: 16px;
}

.pbody .see {
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.pbody .see .arrow {
  transition: transform .25s;
}

.pcard:hover .see .arrow {
  transform: translateX(5px);
}

/* Related section heading (reemplaza estilos inline en PHP) */
.related h2 {
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -.03em;
  margin: 12px 0 34px;
  line-height: 1.15;
}

/* Helper band */
.helper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin: 34px 0;
  flex-wrap: wrap;
}

.helper h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.helper p {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 46ch;
}

/* Related collections */
.related {
  padding: 80px 0;
  background: var(--surface);
}

.related .rel-head {
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -.03em;
  margin: 12px 0 34px;
}

.rel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-width: 0;
}

.rcard {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  color: #fff;
  border: none;
  text-decoration: none;
}

.rcard-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.rcard:has(.rcard-media img) {
  background: none;
}

.rcard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .12) 35%, rgba(0, 0, 0, .62));
  pointer-events: none;
}

.rcard:has(.rcard-media img)::after {
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .55));
}

.rcard .inner {
  position: relative;
  z-index: 2;
  color: #fff;
}

.rcard .kicker,
.rcard h3,
.rcard p {
  color: #fff;
}

.rcard .kicker {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .9;
  font-weight: 600;
}

.rcard h3 {
  font-size: 1.18rem;
  font-weight: 600;
  margin: 3px 0 4px;
}

.page-estaciones .rcard h3 {
  font-size: 1.2rem;
}

.rcard p {
  font-size: .84rem;
  opacity: .92;
  margin: 0;
}

.rc1 { background: linear-gradient(150deg, #2d2d2d, #525252); }
.rc2 { background: linear-gradient(150deg, #3a3a3a, #5e5e5e); }
.rc3 { background: linear-gradient(150deg, #333, #4d4d4d); }
.rc4 { background: linear-gradient(150deg, #404040, #606060); }

/* FAQ max-width override on estaciones */
.page-estaciones details p {
  max-width: 74ch;
}

/* ==========================================================================
   Responsive — páginas de categoría
   ========================================================================== */

@media (max-width: 1100px) {
  .cat-hero {
    gap: 40px;
  }

  .pgrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .rel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .helper {
    padding: 32px 36px;
  }
}

@media (max-width: 900px) {
  body.page-category {
    overflow-x: clip;
  }

  .crumb {
    padding: 16px 0 0;
    font-size: .78rem;
    line-height: 1.5;
    word-break: break-word;
  }

  .cat-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .page-estaciones .cat-hero {
    padding-bottom: 32px;
  }

  .cat-visual {
    order: -1;
    aspect-ratio: 16 / 10;
    max-height: 360px;
  }

  .cat-hero h1 {
    margin: 12px 0 16px;
  }

  .cat-hero p,
  .cat-hero p.lead {
    font-size: var(--fs-body);
    max-width: none;
    margin-bottom: 22px;
  }

  .cat-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .define .wrap {
    padding: 24px 20px;
  }

  .define p {
    font-size: .98rem;
  }

  .grid-sec {
    padding: 36px 0 24px;
  }

  .pgrid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .pbody {
    padding: 16px 18px 18px;
  }

  .pbody h3 {
    font-size: 1.05rem;
  }

  .helper {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
    margin: 28px 0;
    gap: 20px;
  }

  .helper h3 {
    font-size: 1.25rem;
  }

  .helper p {
    font-size: .95rem;
    max-width: none;
  }

  .helper .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .related {
    padding: 64px 0;
  }

  .related h2 {
    margin-bottom: 24px;
  }

  .rel-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .rcard {
    min-height: 200px;
    padding: 18px;
  }

  .rcard h3 {
    font-size: 1.05rem;
  }
}

@media (max-width: 768px) {
  .filterbar .wrap {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .chip {
    font-size: .82rem;
    padding: 10px 16px;
    min-height: 44px;
  }

  .count {
    margin-left: 0;
    width: 100%;
    padding-top: 4px;
    font-size: .8rem;
  }
}

@media (max-width: 560px) {
  .crumb {
    padding-top: 14px;
    font-size: .75rem;
  }

  .crumb span {
    margin: 0 5px;
  }

  .cat-hero {
    padding-top: 22px;
    padding-bottom: 20px;
    gap: 22px;
  }

  .cat-visual {
    aspect-ratio: 4 / 3;
    max-height: none;
    border-radius: 10px;
  }

  .cat-actions .btn-primary,
  .cat-actions .btn-text {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .cat-actions .btn-text {
    justify-content: center;
  }

  .define .wrap {
    padding: 20px 18px;
  }

  .define p {
    font-size: .92rem;
  }

  .grid-sec {
    padding: 28px 0 20px;
  }

  .pgrid,
  .rel-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pcard .pimg .tag {
    top: 12px;
    left: 12px;
  }

  .page-sillas .pcard .pimg .tag {
    left: auto;
    right: 12px;
  }

  .pbody {
    padding: 14px 16px 16px;
  }

  .helper {
    padding: 22px 18px;
    margin: 22px 0;
    border-radius: 12px;
  }

  .helper h3 {
    font-size: 1.15rem;
  }

  .related {
    padding: 52px 0;
  }

  .rcard {
    min-height: 180px;
    padding: 16px;
  }

  .rcard p {
    font-size: .8rem;
  }

}

@media (max-width: 400px) {
  .chip {
    font-size: .8rem;
    padding: 10px 14px;
    min-height: 44px;
  }
}

/* ==========================================================================
   Sillas de oficina — 4 por fila, imagen alta, pie compacto
   ========================================================================== */

/* Hero: espejo horizontal para orientar la silla hacia el copy (lado contrario) */
.page-sillas .cat-visual .inicio-img {
  transform: scaleX(-1);
}

.page-sillas .pgrid {
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.page-sillas .pcard .pimg {
  aspect-ratio: 3 / 4;
}

.page-sillas .pcard .pimg .tag {
  left: auto;
  right: 14px;
}

/* Contain + más relleno: un poco más pequeñas que el tamaño original. */
.page-sillas .pcard .pimg .est-img {
  object-fit: contain;
  object-position: center center;
  padding: 34px;
  background: #fff;
}

.page-sillas .pcard[data-slug="parma"] .pimg .est-img {
  transform: scale(1.1);
  transform-origin: center center;
}

.page-sillas .pcard {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.page-sillas .pcard .pimg .est-img--hover {
  opacity: 0;
  z-index: 1;
  transition: opacity .35s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .page-sillas .pcard:hover .pimg.has-hover .est-img--hover {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-sillas .pcard .pimg .est-img--hover {
    transition: none;
  }
}

.page-sillas .pbody {
  padding: 16px 18px 18px;
  flex: 0 0 auto;
}

.page-sillas .pbody h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  line-height: 1.25;
}

.page-sillas .pbody .see {
  font-size: .8rem;
  align-self: flex-start;
  text-align: left;
}

@media (max-width: 1100px) {
  .page-sillas .pgrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .page-sillas .pgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .page-sillas .pgrid {
    grid-template-columns: 1fr;
  }

  .page-sillas .pcard .pimg {
    aspect-ratio: 4 / 5;
  }
}

.sin-resultados { padding: 40px 0; color: var(--ink-soft); font-size: .95rem; }

.filterbar {
  position: sticky;
  top: var(--header-h, 56px);
  z-index: 40;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
  transition: padding .2s ease;
}

/* Se libera (deja de quedar fijo) en cuanto termina de recorrerse la
   sección de tarjetas que filtra — evita que quede pegado sobre .define,
   .faq, .related, etc. Clase controlada por assets/js/components/filter-chips.js. */
.filterbar.filterbar-libre {
  position: static;
}

.filterbar .wrap {
  display: flex;
  flex-wrap: wrap;        /* si no caben, saltan de fila: nunca scroll lateral */
  gap: 8px;
  align-items: center;
}

.filterbar .count { margin-left: auto; }

@media (max-width: 768px) {
  .filterbar .chip  { min-height: 44px; }
  .filterbar .count { flex-basis: 100%; margin-left: 0; }
}

/* Chips de filtro en una fila pareja; si sobran más de 4, la fila de
   arriba se lleva el sobrante y la de abajo queda centrada (--chip-cols
   lo calcula filter-chips.js según cuántos chips haya). Padding e
   min-height reducidos para que cada fila ocupe lo mínimo posible. */
@media (max-width: 560px) {
  .filterbar .wrap {
    justify-content: center;
    gap: 6px;
  }

  .filterbar .chip {
    flex: 0 0 calc((100% - (var(--chip-cols, 1) - 1) * 6px) / var(--chip-cols, 1));
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 6px 3px;
    min-height: 32px;
    font-size: .58rem;
    white-space: nowrap;
  }
}

/* El achicado al quedar pegado bajo el header es solo de escritorio: en
   móvil los chips deben verse siempre igual que arriba (mismo tamaño de
   fila --chip-cols), o el texto se sale de los botones. */
@media (min-width: 561px) {
  .filterbar.compacta { padding-top: 8px; padding-bottom: 8px; }
  .filterbar.compacta .count { display: none; }
  .filterbar.compacta .chip { min-height: 38px; font-size: .74rem; padding: 0 12px; }
}

.pbody .see { margin-top: auto; }          /* alinea el enlace en toda la fila */

.pcard:active { transform: scale(.99); }   /* en táctil no hay :hover */

.pcard:focus-visible,
.chip:focus-visible,
.burger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

