/*
 * TEC · Catálogo continuo (B05): TEC-10 grupos, TEC-11 chips, TEC-12 destacado y TEC-37 cierre.
 * CAT_Continuo_Desktop_V01 / CAT_Continuo_Mobile_V01. Las cards son SPC-01 (tec-cards.css) y la
 * retícula 3 D / 2 M / 1 en reflow es la de B03. Solo tokens B03; sin animaciones (B07).
 */

.tec-catalog {
  --tec-catalog-header: 72px;
  --tec-catalog-nav: 48px;
  padding-block-end: var(--tec-section-space);
  background: var(--tec-surface-page);
  color: var(--tec-text-primary);
  font-family: var(--tec-font-sans);
  font-synthesis: none;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}

.tec-catalog :where(h1, h2, h3, p) {
  margin: 0;
}

.tec-catalog a:focus-visible,
.tec-catalog button:focus-visible,
.tec-catalog input:focus-visible {
  outline: var(--tec-focus-width) solid var(--tec-focus-light);
  outline-offset: var(--tec-focus-offset);
}

/* Las anclas quedan bajo el header fijo y la fila de chips. */
.tec-catalog [id] {
  scroll-margin-top: calc(var(--tec-catalog-header) + var(--tec-catalog-nav) + 14px);
}

.tec-catalog__intro[id] {
  scroll-margin-top: calc(var(--tec-catalog-header) + var(--tec-catalog-nav));
}

.tec-catalog-eyebrow {
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-eyebrow);
  font-weight: 400;
  line-height: var(--tec-leading-eyebrow);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Apertura: antetítulo, H1, texto y búsqueda nativa ---------- */
.tec-catalog__intro {
  display: flex;
  flex-direction: column;
  gap: var(--tec-s2);
  padding-block: var(--tec-s7) var(--tec-s5);
}

.tec-catalog__title {
  margin-block-start: var(--tec-s3);
  color: var(--tec-color-cacao);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-h1);
  font-weight: 400;
  line-height: var(--tec-leading-h1);
  letter-spacing: var(--tec-tracking-heading);
  text-wrap: balance;
}

.tec-catalog__em {
  font-style: italic;
}

.tec-catalog__lead {
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-body);
  line-height: var(--tec-leading-body);
}

.tec-catalog-search {
  position: relative;
  display: flex;
  margin-block-start: var(--tec-s3);
}

.tec-catalog-search__input {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: var(--tec-target);
  margin: 0;
  padding: var(--tec-s2) calc(var(--tec-target) + var(--tec-s2)) var(--tec-s2) var(--tec-s4);
  border: var(--tec-border-width) solid var(--tec-border-decorative);
  border-radius: var(--tec-radius-control);
  background: var(--tec-surface-card);
  color: var(--tec-text-primary);
  font-family: var(--tec-font-sans);
  font-size: var(--tec-type-ui);
  line-height: var(--tec-leading-ui);
  -webkit-appearance: none;
  appearance: none;
}

.tec-catalog-search__input::placeholder {
  color: var(--tec-text-secondary);
  opacity: 1;
}

.tec-catalog-search__submit {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--tec-target);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--tec-radius-control);
  background: transparent;
  color: var(--tec-text-secondary);
  cursor: pointer;
}

/* ---------- TEC-11 · chips ancla, sticky dentro del catálogo ---------- */
.tec-catalog__body {
  position: relative;
}

.tec-catalog-nav {
  position: sticky;
  top: var(--tec-catalog-header);
  z-index: calc(var(--tec-z-header) - 1);
  border-block-end: var(--tec-border-width) solid var(--tec-border-decorative);
  background: var(--tec-surface-card);
}

.tec-catalog-nav__inner {
  display: flex;
  align-items: center;
  min-block-size: var(--tec-catalog-nav-base, 48px);
}

.tec-catalog-nav__list {
  display: flex;
  gap: var(--tec-s2);
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.tec-catalog-nav__list::-webkit-scrollbar {
  display: none;
}

.tec-catalog-nav__list > li {
  flex: none;
}

.tec-chip {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-block-size: var(--tec-target);
  padding: 0 var(--tec-s4);
  border: var(--tec-border-width) solid var(--tec-color-taupe);
  border-radius: var(--tec-radius-chip);
  background: var(--tec-surface-card);
  color: var(--tec-text-primary);
  font-size: var(--tec-type-ui);
  line-height: var(--tec-leading-ui);
  text-decoration: none;
  white-space: nowrap;
}

.tec-chip[aria-current='location'] {
  border-color: var(--tec-color-cacao);
  background: var(--tec-color-cacao);
  color: var(--tec-color-logo-ivory);
}

.tec-catalog .tec-chip:focus-visible {
  outline-offset: -1px;
  box-shadow: 0 0 0 var(--tec-focus-width) var(--tec-surface-card), 0 0 0 calc(2 * var(--tec-focus-width)) var(--tec-focus-light);
}

@media (hover: hover) and (pointer: fine) {
  .tec-chip:not([aria-current='location']):hover {
    background: var(--tec-surface-panel);
  }
}

/* ---------- TEC-10 · grupos ---------- */
.tec-catalog-group {
  display: flex;
  flex-direction: column;
  gap: var(--tec-s4);
  padding-block-start: var(--tec-s8);
}

.tec-catalog-group + .tec-catalog-group {
  padding-block-start: var(--tec-section-space);
}

.tec-catalog-group__head {
  display: flex;
  flex-direction: column;
  gap: var(--tec-s2);
}

.tec-catalog-group__title {
  color: var(--tec-color-cacao);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-h2);
  font-weight: 400;
  line-height: var(--tec-leading-h2);
  letter-spacing: var(--tec-tracking-heading);
  text-wrap: balance;
}

.tec-catalog-group__lead {
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-body);
  line-height: var(--tec-leading-body);
}

/* ---------- TEC-12 · destacado único: escena 4:5 íntegra + panel editorial ---------- */
/* The panel extends the scene: the deepest tone of its universe in Dirección's reference palette
   (01_Identidad_y_Alcance, «Paleta de referencia»), e.g. the BL olive for Zen Garden as in the CAT
   artboards. Ivory text on every tone is ≥ 7:1. Unknown universe: the B03 inverse surface. */
.tec-featured {
  --tec-featured-surface: var(--tec-surface-inverse);
  background: var(--tec-featured-surface);
  color: var(--tec-text-inverse);
}

.tec-featured[data-tec-universe="AE"] { --tec-featured-surface: #594438; }
.tec-featured[data-tec-universe="BL"] { --tec-featured-surface: #414b35; }
.tec-featured[data-tec-universe="AR"] { --tec-featured-surface: #211814; }
.tec-featured[data-tec-universe="UB"] { --tec-featured-surface: #402a33; }
.tec-featured[data-tec-universe="MR"] { --tec-featured-surface: #263f49; }
.tec-featured[data-tec-universe="TE"] { --tec-featured-surface: #263e35; }
.tec-featured[data-tec-universe="SH"] { --tec-featured-surface: #342923; }

.tec-featured__link:focus-visible {
  outline-color: var(--tec-focus-light);
}

.tec-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--tec-s2);
  padding: var(--tec-s5) var(--tec-s5) var(--tec-s6);
}

.tec-featured__label {
  color: var(--tec-text-inverse);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-h3);
  font-weight: 400;
  line-height: var(--tec-leading-h3);
}

.tec-featured__title {
  color: var(--tec-text-inverse);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-h2);
  font-style: italic;
  font-weight: 400;
  line-height: var(--tec-leading-h2);
  overflow-wrap: break-word;
}

.tec-featured__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--tec-s2);
  color: var(--tec-text-inverse);
  font-size: var(--tec-type-body);
  line-height: var(--tec-leading-ui);
}

.tec-featured__meta [data-tec-availability] {
  font-weight: 700;
}

.tec-featured__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--tec-s2);
  box-sizing: border-box;
  min-block-size: var(--tec-target);
  margin-block-start: var(--tec-s3);
  padding: var(--tec-s2) var(--tec-s5);
  border-radius: var(--tec-radius-control);
  background: var(--tec-action-secondary-bg);
  color: var(--tec-action-secondary-fg);
  font-size: var(--tec-type-ui);
  font-weight: 700;
  line-height: var(--tec-leading-ui);
}

@media (hover: hover) and (pointer: fine) {
  .tec-featured__link:hover .tec-featured__cta {
    background: var(--tec-surface-panel);
  }
}

@media screen and (min-width: 768px) {
  .tec-featured .tec-featured__link {
    display: grid;
    grid-template-columns: calc((100% - var(--tec-gap)) / 2) minmax(0, 1fr);
    align-items: stretch;
  }

  .tec-featured__body {
    padding: var(--tec-s8);
  }
}

/* Escritorio: la escena ocupa exactamente una columna de la retícula 3 D y el panel las otras dos. */
@media screen and (min-width: 1024px) {
  .tec-featured .tec-featured__link {
    grid-template-columns: calc((100% - 2 * var(--tec-gap)) / 3) minmax(0, 1fr);
  }

  .tec-featured__body {
    gap: var(--tec-s3);
    padding: var(--tec-s9) var(--tec-s10);
  }
}

/* ---------- TEC-37 · cierre del catálogo ---------- */
.tec-catalog-end {
  padding-block-start: var(--tec-section-space);
}

.tec-catalog-end__band {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-block-size: 220px;
  overflow: hidden;
  border-radius: var(--tec-radius-panel);
  background: var(--tec-surface-inverse);
  color: var(--tec-text-inverse);
}

.tec-catalog-end__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.tec-catalog-end__media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* Velo de contraste localizado detrás del texto, no un degradado genérico. */
.tec-catalog-end__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(48 41 36 / 0.82) 0%, rgb(48 41 36 / 0.6) 45%, rgb(48 41 36 / 0.2) 100%);
}

.tec-catalog-end__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--tec-s3);
  padding: var(--tec-s7) var(--tec-s5);
}

.tec-catalog-end__eyebrow {
  color: var(--tec-text-inverse);
  font-size: var(--tec-type-eyebrow);
  font-weight: 700;
  line-height: var(--tec-leading-eyebrow);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.tec-catalog-end__title {
  color: var(--tec-text-inverse);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-h2);
  font-weight: 400;
  line-height: var(--tec-leading-h2);
  text-wrap: balance;
}

.tec-catalog-end__action {
  display: inline-flex;
  align-items: center;
  gap: var(--tec-s2);
  min-block-size: var(--tec-target);
  color: var(--tec-text-inverse);
  font-size: var(--tec-type-body);
  font-weight: 700;
  line-height: var(--tec-leading-ui);
  text-decoration: none;
}

.tec-catalog-end__action:focus-visible {
  outline-color: var(--tec-focus-dark);
}

@media (hover: hover) and (pointer: fine) {
  .tec-catalog-end__action:hover span {
    text-decoration: underline;
    text-underline-offset: 0.3em;
  }
}

.tec-catalog-end__next {
  display: flex;
  justify-content: center;
}

.tec-catalog-end__top {
  display: flex;
  justify-content: flex-end;
  margin-block-start: var(--tec-s3);
}

.tec-catalog-end__top .tec-action--text {
  color: var(--tec-text-secondary);
}

@media screen and (min-width: 768px) {
  .tec-catalog-end__content {
    padding: var(--tec-s8) var(--tec-s7);
  }

  .tec-catalog-end__band {
    min-block-size: 264px;
  }
}

/* ---------- Vacío legítimo (sin productos autorizados) ---------- */
.tec-catalog__empty {
  max-inline-size: var(--tec-measure);
  padding-block: var(--tec-s8) var(--tec-s4);
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-body);
  line-height: var(--tec-leading-body);
}

/* ---------- Escritorio ---------- */
@media screen and (min-width: 768px) {
  .tec-catalog {
    --tec-catalog-nav: 54px;
    --tec-catalog-nav-base: 53px;
  }
}

@media screen and (min-width: 1024px) {
  .tec-catalog {
    --tec-catalog-header: 84px;
  }

  .tec-catalog__intro {
    padding-block: var(--tec-s8) var(--tec-s6);
  }

  .tec-catalog-group {
    padding-block-start: var(--tec-s9);
  }

  .tec-catalog-group__head {
    margin-block-end: var(--tec-s1);
  }
}

/* Móvil: el final del título pasa a su línea en itálica (CAT_Continuo_Mobile_V01). */
@media screen and (max-width: 767px) {
  .tec-catalog__em {
    display: block;
  }
}

@media screen and (min-width: 768px) {
  .tec-catalog__em {
    font-style: normal;
  }
}
