/* =========================================================
   T-Control · Especialidades (capacidades técnicas)
   The four areas on the left, as tabs: the open one turns black, shows its
   description (0fr → 1fr) and draws a rule under itself. On the right, a
   black panel lists the area's specialities; on every change the old list
   steps out and the new rows arrive one after another (the process
   language: one curve, text after its frame).
   Texts: "Especialidades" of the inventory (all items, with ACI y DACI).
========================================================= */

.tc-spec {
  --tc-open-ease: cubic-bezier(.65, 0, .35, 1);
  padding: clamp(96px, 10vw, 150px) clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--tc-line);
  background: var(--tc-white);
}

.tc-spec__inner { max-width: 1680px; margin: 0 auto; }

.tc-spec__layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 90px);
  align-items: start;
}

/* ---------- tabs ---------- */

.tc-spec__tabs { border-bottom: 1px solid var(--tc-line); }

.tc-spec__tab {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  width: 100%;
  padding: 26px 0;
  border: 0;
  border-top: 1px solid var(--tc-line);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* the rule under the open tab, drawn from the left */
.tc-spec__tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--tc-black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s var(--tc-open-ease);
}
.tc-spec__tab.is-active::after { transform: scaleX(1); }

.tc-spec__tab-num {
  color: var(--tc-grey-light);
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  transition: color .6s ease;
}

.tc-spec__tab-title {
  display: block;
  color: var(--tc-grey);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: .95;
  letter-spacing: .01em;
  transition: color .6s ease, translate .6s var(--tc-ease);
}
.tc-spec__tab:hover .tc-spec__tab-title { color: var(--tc-graphite); translate: 4px 0; }
.tc-spec__tab.is-active .tc-spec__tab-title,
.tc-spec__tab.is-active .tc-spec__tab-num { color: var(--tc-black); }
.tc-spec__tab.is-active:hover .tc-spec__tab-title { translate: 0 0; }

.tc-spec__tab-desc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--tc-open-ease); }
.tc-spec__tab-desc > span {
  overflow: hidden;
  color: var(--tc-grey);
  font-size: .98rem;
  line-height: 1.55;
  opacity: 0;
  filter: blur(4px);
  transition: opacity .3s ease, filter .3s ease;
}
.tc-spec__tab.is-active .tc-spec__tab-desc { grid-template-rows: 1fr; }
.tc-spec__tab.is-active .tc-spec__tab-desc > span {
  padding-top: 12px;
  opacity: 1;
  filter: blur(0);
  transition: opacity .7s var(--tc-ease) .3s, filter .7s var(--tc-ease) .3s;
}

.tc-spec__tab:focus-visible { outline: 2px solid var(--tc-black); outline-offset: 4px; }

/* ---------- panel ---------- */

.tc-spec__panels {
  --tc-pad: clamp(28px, 3vw, 44px);
  position: sticky;
  top: 100px;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 720px;
  padding: var(--tc-pad);
  overflow: hidden;
  border-radius: 24px;
  background: var(--tc-black);
  color: var(--tc-white);
}

.tc-spec__panel { grid-area: 2 / 1; }

/* the area's reference photo, full bleed at the top of the panel; the new
   one rises over the last like a curtain (the process curve) */
.tc-spec__media {
  position: relative;
  grid-row: 1;
  height: 190px;
  margin: calc(var(--tc-pad) * -1) calc(var(--tc-pad) * -1) 26px;
  overflow: hidden;
  background: var(--tc-graphite);
}
.tc-spec__media::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--tc-black));
  pointer-events: none;
}
.tc-spec__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(100% 0 0 0);
  scale: 1.12;
  transition: clip-path .9s var(--tc-open-ease), scale 1.4s var(--tc-ease);
}
.tc-spec__media img.is-active { z-index: 2; clip-path: inset(0); scale: 1; }
.tc-spec__media img.is-under { z-index: 1; clip-path: inset(0); scale: 1; transition: none; }
.tc-spec__panel[hidden] { display: none; }

.tc-spec__count {
  margin: 0 0 18px;
  color: var(--tc-grey-light);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.tc-spec__panel ul { margin: 0; padding: 0; list-style: none; }

.tc-spec__panel li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid color-mix(in srgb, var(--tc-white) 12%, transparent);
}

.tc-spec__item-num { color: var(--tc-grey); font-family: var(--font-display); font-size: 1.4rem; line-height: 1.2; }
.tc-spec__panel h3 { color: var(--tc-white); font-size: clamp(1.6rem, 2vw, 2.1rem); line-height: 1; }
.tc-spec__panel li p { margin: 6px 0 0; color: color-mix(in srgb, var(--tc-white) 72%, transparent); font-size: .95rem; line-height: 1.5; }

/* the rows arrive one after another; the old list steps out first */
.tc-spec__panel.is-entering .tc-spec__count,
.tc-spec__panel.is-entering li { opacity: 0; translate: 0 18px; filter: blur(4px); }
.tc-spec__panel .tc-spec__count,
.tc-spec__panel li {
  transition: opacity .7s var(--tc-ease), translate .7s var(--tc-ease), filter .7s var(--tc-ease);
  transition-delay: calc(var(--i, 0) * 70ms + 80ms);
}
.tc-spec__panel .tc-spec__count { --i: -1; }
.tc-spec__panel.is-leaving { opacity: 0; translate: 0 -10px; filter: blur(4px); transition: opacity .25s ease, translate .25s ease, filter .25s ease; }

@media (max-width: 1023.98px) {
  .tc-spec__layout { grid-template-columns: minmax(0, 1fr); }
  .tc-spec__panels { position: relative; top: auto; min-height: 0; }
  .tc-spec__media { height: 170px; }
}

@media (max-width: 560px) {
  .tc-spec__tab { grid-template-columns: 40px 1fr; gap: 12px; }
  .tc-spec__panel li { grid-template-columns: 34px 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-spec *, .tc-spec *::after { transition: none !important; }
}
