.textTabs {
  padding: var(--templateTheme-section-padding-y) var(--templateTheme-section-padding-x);
  box-sizing: border-box;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
}

.textTabs--figma {
  background: #edf0f2;
}

.textTabs--white {
  background: #fff;
}

.textTabs__container {
  max-width: var(--templateTheme-content-max);
  margin: 0 auto;
}

.textTabs__content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 406px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 769px) {
  .textTabs__content-grid {
    grid-template-rows: auto;
  }

  .textTabs__tabs-column {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0;
  }

  .textTabs__panels-slot {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    align-self: start;
    min-width: 0;
  }

  .textTabs__panels-slot .textTabs__panel {
    position: relative;
    z-index: 0;
    width: 100%;
  }

  .textTabs__panels-slot .textTabs__panel.is-active {
    z-index: 1;
  }

  .textTabs__panels-slot .textTabs__panel:not(.is-active) {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* JS / PHP set [hidden] on inactive panels; keep display:none winning over layout rules. */
.textTabs__panel[hidden] {
  display: none !important;
}

.textTabs__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  background: transparent;
  color: #000;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  opacity: 0.72;
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.textTabs__item.is-active {
  background: transparent;
  opacity: 1;
}

.textTabs__item:hover {
  opacity: 0.9;
}

.textTabs__item:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

.textTabs__item-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
}

.textTabs__item-row {
  display: flex;
  gap: 42px;
  align-items: end;
  justify-content: space-between;
}

.textTabs__item-text,
.textTabs__item-text p {
  margin: 0;
  max-width: 299px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.8);
}

.textTabs__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transform: rotate(0deg);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.textTabs__item.is-active .textTabs__item-icon {
  transform: rotate(45deg);
}

.textTabs__panel-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 845px;
}

.textTabs__panel-title {
  margin: 0;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.5;
  color: #000;
}

.textTabs__panel-text,
.textTabs__panel-text p {
  margin: 0;
  width: 100%;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.8);
}

.textTabs__panel-text p + p {
  margin-top: 16px;
}

.textTabs__panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 17px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  color: #000;
  text-decoration: none;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.textTabs__panel-btn:hover,
.textTabs__panel-btn:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}

.textTabs__panel-btn-label {
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.16px;
}

.textTabs__panel-btn-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1800px) {
  .textTabs__content-grid {
    grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
    gap: 40px;
  }

  .textTabs__tabs-column {
    gap: 48px;
  }

  .textTabs__item-title {
    font-size: 28px;
  }

  .textTabs__item-text,
  .textTabs__item-text p {
    max-width: 360px;
    font-size: 22px;
  }

  .textTabs__panel-card {
    max-width: 980px;
    gap: 28px;
  }

  .textTabs__panel-title {
    font-size: 38px;
  }
}

@media (max-width: 1200px) {
  .textTabs {
    padding: 80px 40px;
  }
}

@media (max-width: 768px) {
  .textTabs {
    padding: 56px 20px;
  }

  .textTabs__content-grid {
    display: flex;
    flex-direction: column;
    /* Vertical rhythm between tab groups; active tab+panel are flush (gap 0). */
    gap: 0;
  }

  .textTabs__tabs-column,
  .textTabs__panels-slot {
    display: contents;
  }

  .textTabs__content-grid .textTabs__item,
  .textTabs__content-grid .textTabs__panel {
    order: var(--faq-order);
    width: 100%;
  }

  .textTabs__item {
    margin: 0 0 10px;
  }

  .textTabs__item.is-active {
    margin-bottom: 0;
    border-radius: 10px 10px 0 0;
  }

  /* [hidden] handled globally with !important; only visible panel gets flex column layout. */
  .textTabs__content-grid .textTabs__panel:not([hidden]) {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    inset: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 0 20px;
  }

  .textTabs__panel-card {
    max-width: 100%;
    border-radius: 0 0 10px 10px;
  }

  .textTabs__item-title {
    font-size: 22px;
  }

  .textTabs__item-row {
    gap: 16px;
  }

  .textTabs__item-text,
  .textTabs__item-text p,
  .textTabs__panel-text,
  .textTabs__panel-text p {
    font-size: 18px;
    line-height: 1.45;
  }

  .textTabs__panel-title {
    font-size: 28px;
  }
}
