/* ============================================================================
   Cabecera de categoría — master_beta · CONCEPTO 1b (2026-10)
   Bloque full-width · fondo oscuro degradado.
   Izquierda: H1 grande (Outfit 500) + entradilla pequeña + "Más información".
   Centro: menú horizontal de subcategorías (glass, centrado, icono+texto).
   Derecha: foto de estancia anclada, con degradado a transparente.
   View Transition entre categorías: nombres puestos; navegación cross-document
   se activa aparte (ver nota al final).
   ============================================================================ */

.cat-hero{
  --accent:#ffd21e;
  --hero-1:#1a2332;
  --hero-2:#2d3e50;
  --hero-fg:#ffffff;
  --hero-dim:rgba(255,255,255,.66);
  --hero-faint:rgba(255,255,255,.10);
  --hero-line:rgba(255,255,255,.16);
  --glass-blur:9px;

  position:relative;
  /* full-width: cancelar el padding del .container-fluid sin desbordar por el scrollbar */
  margin:0 calc(-1 * var(--bs-gutter-x, 1.5rem) / 2) 1.25rem;
  padding:0;
  border:0;
  overflow:hidden;
  color:var(--hero-fg);
  background:linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 100%);
}

/* Envoltorio interior: contenido a 1860 + padding 1rem */
.cat-hero__surface{
  position:relative;
  z-index:2;
  max-width:1860px;
  margin-inline:auto;
  padding-inline:1rem;
  padding-block:clamp(1.3rem, 0.9rem + 1.3vw, 1.9rem);
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}

/* ---- Breadcrumb (claro sobre el degradado) ---- */
.cat-crumb{margin-bottom:clamp(1rem, 2vw, 1.6rem)}
.cat-crumb ol{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .5ch;margin:0;padding:0;list-style:none}
.cat-crumb__item{display:inline-flex;align-items:center;gap:.5ch;font-size:.76rem;color:var(--hero-dim)}
.cat-crumb__item:not(:first-child)::before{content:"›";opacity:.5;margin-right:.25ch}
.cat-crumb__link{display:inline-flex;align-items:center;gap:.4ch;color:var(--hero-dim);text-decoration:none}
.cat-crumb__link:hover{color:var(--hero-fg)}
.cat-crumb__home{width:14px;height:14px}
.cat-crumb__cur{color:var(--hero-fg);font-weight:600}
.cat-crumb__sronly{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---- Grid: intro | menú | (hueco para la foto, que va absoluta) ---- */
.cat-hero__content{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:minmax(300px,400px) minmax(0,1fr) minmax(300px,400px);
  gap:clamp(1.2rem, 2.5vw, 2.6rem);
  align-items:center;
}
.cat-hero__content.is-nomedia{grid-template-columns:minmax(300px,400px) minmax(0,1fr)}
.cat-hero__content.is-no-nav{grid-template-columns:minmax(0,1fr) minmax(300px,400px)}
.cat-hero__content.is-no-nav.is-nomedia{grid-template-columns:1fr}

/* ---- Intro: H1 grande + entradilla + Más información ---- */
.cat-hero__intro{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}
.cat-hero__title{
  font-family:"Outfit",system-ui,sans-serif;
  font-weight:500;
  font-size:clamp(2rem, 1.4rem + 3.2vw, 3rem);
  line-height:1.04;
  letter-spacing:-.01em;
  margin:0;
  color:var(--hero-fg);
}
.cat-hero__desc{
  font-size:.85rem;color:var(--hero-dim);max-width:38ch;margin:0;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;
}
.cat-hero__desc-inner{display:inline}
.cat-hero__more{
  display:inline-flex;align-items:center;gap:.4ch;margin-top:.25rem;
  font-size:.8rem;font-weight:600;color:var(--hero-fg);text-decoration:none;
  background:none;border:0;border-bottom:1px solid var(--hero-line);
  padding:0 0 2px;cursor:pointer;font-family:inherit;
}
.cat-hero__more:hover{border-color:var(--accent)}
.cat-hero__more svg{width:14px;height:14px}
.cat-hero__more[hidden]{display:none}

/* ---- Menú de subcategorías (glass, centrado, icono+texto, sin cajas) ---- */
.cat-hero__nav{min-width:0}
.cat-hero__carousel{
  display:flex;align-items:center;gap:.4rem;
  max-width:640px;margin-inline:auto;
  /* Glass del artifact 1b */
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(18,24,33,.38));
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(150%);
          backdrop-filter:blur(var(--glass-blur)) saturate(150%);
  border:1px solid rgba(255,255,255,.18);
  border-radius:16px;
  box-shadow:0 10px 30px -14px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.22);
  padding:.5rem .6rem;
}
/* SOLO Firefox (-moz-appearance solo lo reconoce Gecko): si no tiene WebRender no
   pinta el backdrop-filter aunque lo "soporte", así que oscurecemos el fondo para
   que el menú siga siendo legible. Chrome/Safari mantienen el glass con blur. */
@supports (-moz-appearance: none){
  .cat-hero__carousel{background:linear-gradient(180deg, rgba(40,48,60,.58), rgba(18,24,33,.68))}
}
.cat-hero__viewport{flex:1 1 auto;min-width:0;overflow:hidden}
/* El SCROLLER es el track (el JS del carrusel usa track.scrollBy / track.scrollLeft).
   'safe center': centrado cuando cabe, pero flex-start (sin recorte y navegable)
   cuando hay overflow — si no, los extremos quedarían inalcanzables. */
.cat-hero__track{display:flex;gap:.6rem;justify-content:safe center;overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity}
.cat-hero__track::-webkit-scrollbar{display:none}

.cat-hero__arrow{
  flex:none;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  background:var(--hero-faint);border:1px solid var(--hero-line);color:#fff;cursor:pointer;
}
.cat-hero__arrow:hover{background:rgba(255,255,255,.22)}
.cat-hero__arrow svg{width:18px;height:18px}

.cat-hero__card{
  flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:.3rem;
  width:92px;text-align:center;padding:.4rem .2rem;
  text-decoration:none;color:var(--hero-dim);
  scroll-snap-align:center;
}
.cat-hero__card:hover{color:var(--hero-fg)}
.cat-hero__card-media{flex:none;width:38px;height:38px;display:grid;place-items:center}
.cat-hero__card-media img{width:100%;height:100%;object-fit:contain;display:block}
.cat-hero__card-name{font-size:.76rem;font-weight:500;line-height:1.15}
.cat-hero__card.active{color:var(--accent)}
.cat-hero__card.active .cat-hero__card-name{color:var(--accent)}
/* Legibilidad sobre la foto (artifact 1b) */
.cat-hero__card-name{text-shadow:0 1px 3px rgba(0,0,0,.5)}
.cat-hero__card-media img{filter:drop-shadow(0 1px 2px rgba(0,0,0,.55))}

/* ---- Foto de estancia: fondo del bloque full-width, anclada a la derecha,
        degradado a transparente (= .hero__bgphoto del artifact) ---- */
.cat-hero__bgphoto{
  position:absolute;inset:0 0 0 auto;z-index:1;
  width:min(44%,900px);
  background-size:cover;background-position:center right;background-repeat:no-repeat;
  -webkit-mask-image:linear-gradient(to right, transparent 0, #000 58%);
          mask-image:linear-gradient(to right, transparent 0, #000 58%);
  pointer-events:none;
}

/* ---- Banda 1001–1280: el menú gana terreno; la foto se estrecha ---- */
@media (min-width:1001px) and (max-width:1280px){
  .cat-hero__content{grid-template-columns:minmax(260px,340px) minmax(0,1fr) 0}
  .cat-hero__content.is-nomedia{grid-template-columns:minmax(260px,340px) minmax(0,1fr)}
  .cat-hero__carousel{max-width:640px}/* 18/11: 4 subcategorías visibles, como en escritorio ancho */
  .cat-hero__bgphoto{width:min(30%,420px)}
}

/* ---- ≤1000: apilar (el menú nunca desaparece); foto al fondo inferior ---- */
@media (max-width:1000px){
  .cat-hero__content,
  .cat-hero__content.is-nomedia,
  .cat-hero__content.is-no-nav,
  .cat-hero__content.is-no-nav.is-nomedia{grid-template-columns:1fr;gap:1rem}
  .cat-hero__intro{align-items:flex-start}
  /* Estancia (artifact): ancho completo, degradado hacia abajo, tenue */
  .cat-hero__bgphoto{
    width:100%;opacity:.5;background-position:center;
    -webkit-mask-image:linear-gradient(to bottom, transparent, #000 70%);
            mask-image:linear-gradient(to bottom, transparent, #000 70%);
  }
  /* En móvil se navega con swipe → fuera flechas; el snap da el "paso" entre tarjetas */
  .cat-hero__arrow{display:none}
  .cat-hero__track{justify-content:flex-start;scroll-snap-type:x mandatory}
}

/* View Transition entre categorías: activación, nombres y tiempos viven en
   templates/_partials/head.tpl (solo page_name == 'category'), para que estén
   presentes desde el primer pintado de la página nueva. */


/* ============================================================================
   Descripción completa al pie de la categoría (destino de "Más información").
   Vive fuera de .cat-hero (sobre el fondo claro de la página).
   ============================================================================ */
#category-descripcion{scroll-margin-top:calc(var(--ml-header-bottom-vp, 120px) + 12px)}
.category-desc-full{max-width:1860px;margin:2.25rem auto 1.25rem;padding-inline:1rem}
.category-desc-full__title{
  font-family:"Outfit",system-ui,sans-serif;font-weight:500;
  font-size:clamp(1.25rem, 1rem + 0.8vw, 1.6rem);margin:0 0 .6rem;color:#1a2332;
}
.category-desc-full__inner{max-width:78ch;color:#3a4150;font-size:.95rem;line-height:1.65}
.category-desc-full__inner :is(h2,h3,h4){font-family:"Outfit",system-ui,sans-serif;color:#1a2332}
.category-desc-full__inner a{color:#1d2a55;text-decoration:underline}

/* ---- Menú de subcategorías: alturas equilibradas (2026-10-09) ----
   Antes: ancho fijo 92px → los nombres largos partían en 4 líneas y descompensaban.
   Ahora: 124px iguales, líneas equilibradas (text-wrap: balance) y máximo 2 líneas
   con "…" (el nombre completo está en el title de la tarjeta).
   El hueco del nombre siempre mide 2 líneas → todas las tarjetas con la misma altura. */
.cat-hero__card{
  width:124px;               /* ancho igual para todas: ritmo regular y caben 4 sin flechas */
  padding:.4rem .35rem;
}
.cat-hero__card-name{
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  min-height:2.3em;          /* 2 líneas × line-height 1.15 */
  max-height:fit-content;
  text-wrap:balance;
}

/* 18/11/2026 móvil: títulos de hasta 26 caracteres (.is-fit, lo pone el tpl) encogen a 1 línea con text-fit:shrink
   (solo navegadores que lo admiten; el resto se queda como estaba). Los largos, 2 líneas con cortes equilibrados. */
@media (max-width:1000px){
  .cat-hero__title{text-wrap:balance}
  @supports (text-fit:shrink){.cat-hero__title.is-fit{width:100%;white-space:nowrap;text-fit:shrink}}
}

/* 18/11/2026 móvil ≤480: sin líneas de descripción (se conserva el hueco) y la foto termina justo encima del menú
   de subcategorías (menú 92px + 20px de margen inferior); así la foto ocupa el hueco y se ve casi entera (≈16:9). */
@media (max-width:480px){
  .cat-hero__desc{visibility:hidden;height:4.5em}/* mismo hueco en todas: siempre el alto de 3 líneas */
  .cat-hero__bgphoto{bottom:112px;opacity:.6;
    /* mismo fundido superior que ≤1000 + fundido en el 15 % inferior: sin corte visible sobre el menú */
    -webkit-mask-image:linear-gradient(to bottom, transparent 0, #000 70%, #000 85%, transparent 100%);
            mask-image:linear-gradient(to bottom, transparent 0, #000 70%, #000 85%, transparent 100%)}
  .cat-hero__desc{order:1}/* «Más información» justo bajo el título; el hueco de la descripción queda debajo */
  .cat-hero__intro{min-height:148px}/* categorías sin descripción: mismo alto que título + 3 líneas + «Más información» */
}

/* 18/11/2026 escritorio (>1000): menú de subcategorías alineado a la izquierda de su columna (antes centrado) */
@media (min-width:1001px){
  .cat-hero__carousel{margin-inline:0 auto}
}
