/* ==========================================================================
   COMPONENTE · SERVICIOS (pestañas + acordeón con imagen)  [equilatera_servicios]
   Escritorio: medidas sobre 1440 · Móvil: medidas sobre 390
   El fondo verde oscuro es el de la fila (no forma parte del componente).
   ========================================================================== */

.eq-srv {
  --px: calc(100vw / 1440);
  --eq-radius: 16px;
  --eq-beige: #ede8da;
  --eq-line: #e9e3d5;
  --eq-ease: cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
}

.eq-srv,
.eq-srv *,
.eq-srv *::before,
.eq-srv *::after {
  box-sizing: border-box;
}

/* ---------- Pastillas ---------- */
.eq-srv__tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: min(calc(700 * var(--px)), 100%);
  margin: 0 auto calc(40 * var(--px));
  padding: calc(10 * var(--px));
  border-radius: 999px;
  background-color: var(--light);
}

.eq-srv__indicator {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background-color: var(--accent);
  pointer-events: none;
}

.eq-srv__indicator.is-animated {
  transition:
    transform 0.55s var(--eq-ease),
    width 0.55s var(--eq-ease),
    height 0.55s var(--eq-ease);
}

/* Fantasma del hover: pastilla suave que sigue al ratón entre pestañas */
.eq-srv__ghost {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background-color: rgba(33, 110, 101, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.eq-srv__ghost.is-visible {
  opacity: 1;
}

.eq-srv__ghost.is-animated {
  transition:
    opacity 0.25s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Salient fuerza radio y transición en todos los <button>: especificidad (0,2,0) + !important en el radio */
.eq-srv .eq-srv__tab {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: max(40px, calc(40 * var(--px)));
  margin: 0;
  padding: 0 calc(16 * var(--px));
  border: 0;
  border-radius: 999px !important;
  background: transparent;
  box-shadow: none;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: max(13px, calc(14 * var(--px)));
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.4s var(--eq-ease);
  opacity: 1;
}

.eq-srv .eq-srv__tab.is-active {
  color: var(--light);
}

/* Sin JS el indicador no se mueve: se pinta la activa */
.eq-srv:not(.is-ready) .eq-srv__tab.is-active {
  background-color: var(--accent);
}

.eq-srv .eq-srv__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Paneles ---------- */
.eq-srv__panel[hidden] {
  display: none;
}

.eq-srv__panel.is-entering .eq-srv__card {
  animation: eq-srv-in 0.6s var(--eq-ease) both;
}

@keyframes eq-srv-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Tarjeta ---------- */
.eq-srv__card {
  display: grid;
  grid-template-columns: minmax(0, 700fr) minmax(0, 673fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'intro media'
    'acc media';
  min-height: calc(700 * var(--px));
  border-radius: var(--eq-radius);
  overflow: hidden;
  background-color: var(--light);
}

.eq-srv__card--no-media {
  grid-template-columns: 1fr;
  grid-template-areas: 'intro';
  min-height: 0;
}

.eq-srv__intro {
  grid-area: intro;
  padding: calc(45 * var(--px)) calc(45 * var(--px)) calc(45 * var(--px));
  background-color: var(--eq-beige);
}

.eq-srv .eq-srv__title {
  margin: 0 0 calc(38 * var(--px));
  padding: 0;
  font-family: var(--primary-font) !important;
  font-weight: 600;
  font-size: calc(38 * var(--px));
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-transform: none;
  color: var(--accent);
  max-width: 20ch;
}

.eq-srv__desc {
  max-width: calc(530 * var(--px));
  font-family: var(--secondary-font);
  font-weight: 400;
  font-size: calc(14 * var(--px));
  line-height: 1.45;
  color: var(--dark);
}

.eq-srv__desc p {
  margin: 0 0 1.45em;
  padding: 0;
  font: inherit;
  color: inherit;
}

.eq-srv__desc p:last-child {
  margin-bottom: 0;
}

.eq-srv__desc strong,
.eq-srv__desc b {
  font-weight: 600;
  color: var(--dark);
}

/* ---------- Acordeón ---------- */
.eq-srv__acc {
  grid-area: acc;
  align-self: start;
  width: 100%;
  max-width: calc((565 + 130) * var(--px));
  padding: calc(45 * var(--px)) calc(45 * var(--px)) calc(45 * var(--px));
}

.eq-srv__item {
  position: relative;
  border-bottom: 1px solid var(--eq-line);
}

.eq-srv .eq-srv__item-heading {
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

h3.eq-srv__item-heading {
  margin-bottom: 0 !important;
}

.eq-srv .eq-srv__head {
  appearance: none;
  display: flex;
  align-items: center;
  gap: calc(16 * var(--px));
  width: 100%;
  margin: 0;
  padding: calc(16 * var(--px)) 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dark);
  cursor: pointer;
  opacity: 1;
}

.eq-srv .eq-srv__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.eq-srv__num {
  flex: none;
  display: grid;
  place-items: center;
  width: max(26px, calc(32 * var(--px)));
  height: max(26px, calc(32 * var(--px)));
  border: 2px solid var(--dark-cream);
  border-radius: 50%;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: max(12px, calc(14 * var(--px)));
  line-height: 1;
  color: var(--dark-cream);
  transition:
    background-color 0.4s var(--eq-ease),
    border-color 0.4s var(--eq-ease),
    color 0.4s var(--eq-ease);
}

.eq-srv__item.is-open .eq-srv__num {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--light);
}

.eq-srv__item-title {
  font-family: var(--primary-font);
  font-weight: 600;
  font-size: calc(18 * var(--px));
  line-height: 1.2;
  color: var(--dark);
  transition: color 0.3s ease;
  letter-spacing: -0.02em;
}

@media (hover: hover) {
  .eq-srv__item:not(.is-open) .eq-srv__head:hover .eq-srv__item-title {
    color: var(--accent);
  }
}

.eq-srv__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--eq-ease);
}

.eq-srv__item.is-open .eq-srv__body {
  grid-template-rows: 1fr;
}

.eq-srv__body-inner {
  min-height: 0;
  overflow: hidden;
  padding-left: calc(max(26px, calc(32 * var(--px))) + calc(16 * var(--px)));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.eq-srv__item.is-open .eq-srv__body-inner {
  opacity: 1;
  transition-delay: 0.15s;
}

.eq-srv .eq-srv__text {
  max-width: calc(420 * var(--px));
  margin: 0;
  font-family: var(--secondary-font);
  font-weight: 400;
  font-size: calc(14 * var(--px));
  line-height: 1.4;
  color: var(--dark);
}

.eq-srv .eq-srv__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: max(14px, calc(14 * var(--px)));
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}

.eq-srv .eq-srv__more svg {
  transition: transform 0.4s var(--eq-ease);
}

@media (hover: hover) {
  .eq-srv .eq-srv__more:hover svg {
    transform: translate(2px, -2px);
  }
}

.eq-srv__body-inner > :last-child {
  margin-bottom: calc(22 * var(--px));
}

/* Barra de progreso del elemento abierto */
.eq-srv__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.eq-srv__bar {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Sin avance automático: línea completa bajo el abierto */
.eq-srv:not(.is-auto) .eq-srv__item.is-open .eq-srv__bar {
  transform: scaleX(1);
  transition: transform 0.6s var(--eq-ease);
}

.eq-srv.is-auto .eq-srv__item.is-open .eq-srv__bar.is-running {
  animation: eq-srv-progress var(--eq-dur, 7s) linear forwards;
}

.eq-srv.is-paused .eq-srv__bar {
  animation-play-state: paused !important;
}

@keyframes eq-srv-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Imagen ---------- */
.eq-srv__media {
  grid-area: media;
  position: relative;
  min-height: 100%;
}

.eq-srv__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: var(--eq-beige);
}

.eq-srv .eq-srv__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100% !important;
  max-width: none;
  margin: 0 !important;
  border-radius: 0 !important;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.7s var(--eq-ease),
    transform 1.2s var(--eq-ease);
}

.eq-srv .eq-srv__img.is-active {
  opacity: 1;
  transform: none;
}

.eq-srv__counter {
  position: absolute;
  z-index: 2;
  bottom: calc(32 * var(--px));
  right: calc(32 * var(--px));
  padding: 0.55em 1em;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background-color: rgba(246, 243, 236, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--secondary-font);
  font-weight: 400;
  font-size: max(13px, calc(15 * var(--px)));
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--light);
}

@media (min-width: 1000px) {
  .eq-srv {
    padding: 0 9vw;
  }
}

/* ==========================================================================
   MÓVIL
   ========================================================================== */
@media (max-width: 999px) {
  .eq-srv {
    --px: calc(100vw / 390);
  }

  .eq-srv__tabs {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: calc(14 * var(--px));
    width: calc(262 * var(--px));
    margin-bottom: calc(44 * var(--px));
    padding: calc(18 * var(--px));
    border-radius: calc(30 * var(--px));
  }

  .eq-srv .eq-srv__tab {
    height: calc(40 * var(--px));
    font-size: calc(15 * var(--px));
  }

  /* Tarjeta a sangre en móvil */
  .eq-srv__card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      'intro'
      'acc'
      'media';
    min-height: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }

  .eq-srv__intro {
    padding: calc(36 * var(--px)) calc(36 * var(--px)) calc(40 * var(--px));
  }

  .eq-srv .eq-srv__title {
    margin-bottom: calc(36 * var(--px));
    font-size: calc(32 * var(--px));
    line-height: 1.1;
  }

  .eq-srv__br {
    display: none;
  }

  .eq-srv__desc {
    max-width: none;
    font-size: calc(17 * var(--px));
    line-height: 1.5;
  }

  .eq-srv__acc {
    max-width: none;
    padding: calc(24 * var(--px)) calc(26 * var(--px)) calc(30 * var(--px));
  }

  .eq-srv .eq-srv__head {
    align-items: flex-start;
    gap: calc(12 * var(--px));
    padding: calc(20 * var(--px)) 0;
  }

  .eq-srv__num {
    width: calc(24 * var(--px));
    height: calc(24 * var(--px));
    margin-top: calc(1 * var(--px));
    font-size: calc(13 * var(--px));
  }

  .eq-srv__item-title {
    font-size: calc(20 * var(--px));
  }

  .eq-srv__body-inner {
    padding-left: calc(36 * var(--px));
  }

  .eq-srv .eq-srv__text {
    max-width: none;
    font-size: calc(14 * var(--px));
  }

  .eq-srv .eq-srv__more {
    margin-top: calc(14 * var(--px));
    font-size: calc(14 * var(--px));
  }

  .eq-srv__body-inner > :last-child {
    margin-bottom: calc(24 * var(--px));
  }

  .eq-srv__media {
    min-height: 0;
    padding: 0 calc(26 * var(--px)) calc(30 * var(--px));
  }

  .eq-srv__frame {
    position: relative;
    inset: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--eq-radius);
  }

  .eq-srv__counter {
    bottom: calc(18 * var(--px));
    right: calc(18 * var(--px));
    font-size: calc(14 * var(--px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .eq-srv *,
  .eq-srv *::before,
  .eq-srv *::after {
    transition-duration: 0.01s !important;
    animation-duration: 0.01s !important;
  }
}
