.services-tabs {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: row;
  gap: 3rem;
  align-items: flex-start;
  min-height: 100vh;
}

.tabs-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 120%;
  color: var(--black);
  padding: 2rem 0;

  span {
    color: var(--blue);
    font-size: 2rem;
  }
}

.services-sidebar {
  display: flex;
  flex-direction: column;
  width: 25.81rem;
  position: sticky;
  top: 3.5rem;
  flex-shrink: 0;
}

.tabs-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.tabs-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 51.1875rem;
  background-color: var(--gray-light);
  gap: 4rem;
  padding: 5rem;
  border-radius: 1rem;
  height: 100%;
}

.tab-panel {
  position: absolute;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.7s ease, transform 0.7s ease;
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: opacity, transform;
  min-height: calc(100vh - 10rem);
}
.tab-panel.active {
  position: relative;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.tab-panel-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;

  .tab-number {
    font-size: 3rem;
    color: var(--black);
  }

  .tab-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--blue);
  }
}

.tab-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background-color: var(--gray-light);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  overflow: hidden;
  width: 26.93rem;
  font-family: inherit;
  color: var(--gray);
  height: auto;
  height: 3.72rem;

  transition-property: height, background, opacity;
  transition-duration: 0.5s, 1.2s, 1.2s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1),
    cubic-bezier(0.4, 0, 0.6, 1), cubic-bezier(0.4, 0, 0.6, 1);
}
.tab-item:hover {
  color: var(--black);
  transition: color 0.5s ease;
}

.tab-label {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1.5rem;
}

.tab-item .tab-number {
  flex-shrink: 0;
  font-weight: 400;
  margin-right: 1rem;
}

.tab-item.active {
  background-image: var(--tab-img);
  background-size: cover;
  background-position: center;
  color: var(--white);
  justify-content: center;
  height: 21.25rem;
  width: 26.93rem;
  transition-duration: 1.5s, 1.2s, 1.2s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1),
    cubic-bezier(0.4, 0, 0.6, 1), cubic-bezier(0.4, 0, 0.6, 1);
  cursor: default;
}

.tab-item.exit-to-top,
.tab-item.exit-to-bottom {
  max-height: 3.5rem;
  opacity: 0.9;
}

.tab-item.enter-from-top,
.tab-item.enter-from-bottom {
  max-height: 0; /* empieza cerrado */
  opacity: 0;
}
.tab-item.enter-active {
  max-height: 21.25rem; /* se expande */
  opacity: 1;
}
/* Anima salida */
.tab-item.exit-to-top,
.tab-item.exit-to-bottom {
  max-height: 3.5rem;
  opacity: 0.9;
}

/* Entrada inicial (arranca en colapsado) */
.tab-item.entering {
  opacity: 1;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.tab-item.active .tab-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: var(--blue);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.tab-item span {
  position: relative;
  z-index: 2;
}

.tab-item:not(.active):hover {
  background-color: #e3e3e3;
}

.tab-circle {
  position: absolute;
  top: -1rem;
  right: 0.5rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--gray-dark);
  transition: background 0.3s, box-shadow 0.3s;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.tab-item:hover .tab-circle {
  background: var(--lilac);
  transition: background-color 0.5s ease-in-out;
}

.tab-isotype {
  width: 12.56px;
  height: 13.99px;
  object-fit: contain;
  z-index: 4;
  display: none;
}

.tab-item.active .tab-circle {
  background: var(--lilac);
  top: -9rem;
  left: 12rem;
  width: 2rem;
  height: 2rem;
}

.tab-item.active .tab-isotype {
  display: block;
}

.visit-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.doc-photo {
  width: 10.75rem;
  height: 12.5rem;
}

@media (min-width: 1024px) {
  .med-grid {
    grid-template-columns: 1fr;
  }

  .carousel-item {
    flex-direction: row;
    gap: 2rem;
  }
}
