/*
 * Layout corrections for theme 1.2.0
 * ----------------------------------
 * Loaded after the legacy stylesheet so the fixes remain page-scoped and do
 * not depend on the order or wrapping generated by Contact Form 7.
 */

/* Home: visually separate the hero from the services block. */
.home-services {
  margin-top: clamp(32px, 3.5vw, 56px);
  padding-top: clamp(32px, 3.5vw, 52px);
}

.home-services .section-title {
  margin-top: 0;
}

/* Home: remove the old nested flex shrink and centre the complete lead form. */
.tak-form-section--home {
  width: 100%;
  padding: clamp(48px, 5vw, 76px) 0;
}

.tak-form-section--home > .container {
  width: calc(100% - 40px);
  max-width: 960px;
  margin-inline: auto;
}

.tak-form-section--home .section-title {
  margin: 0 0 34px !important;
  text-align: center;
}

/* Services archive: account for the fixed desktop header and add breathing room. */
.services-page {
  margin-top: 84px;
  padding-top: clamp(40px, 4vw, 64px);
  padding-bottom: clamp(40px, 4vw, 64px);
}

.services-page .section-title {
  margin-top: 0;
}

/* Shared price table treatment. */
.service-pricing .tariffs,
.tariff-content--price-page .tariffs {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e2e4e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.06);
}

.service-pricing .tariff,
.tariff-content--price-page .tariff {
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid #eceef1;
  color: #171717;
  font-size: 16px;
  line-height: 1.5;
}

.service-pricing .tariff:last-child,
.tariff-content--price-page .tariff:last-child {
  border-bottom: 0;
}

.service-pricing .tariff-left,
.tariff-content--price-page .tariff-left {
  min-width: 0;
}

.service-pricing .tariff-right,
.tariff-content--price-page .tariff-right {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.service-pricing .tariff-border,
.tariff-content--price-page .tariff-border {
  border-top: 12px solid #f3f3f3;
}

/* Service pages: stable two-column price/form layout on desktop. */
.service-pricing {
  padding: 0 0 clamp(56px, 6vw, 88px);
  background: #f3f3f3;
}

.service-pricing .container,
.service-pricing .container_content {
  width: 100%;
  min-width: 0;
}

.service-pricing .container_content {
  display: block;
}

.service-pricing .calculator_title_block {
  margin: 0 0 28px;
  text-align: left;
}

.service-price-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.08fr);
  align-items: start;
  gap: clamp(24px, 3vw, 44px);
  width: 100%;
  min-width: 0;
}

.service-price-layout__prices,
.service-price-layout__form {
  min-width: 0;
}

.service-price-layout__form {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid #e2e4e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.06);
}

.service-price-layout__form .tak-form-section--embedded,
.service-price-layout__form .tak-form-section--embedded > .container {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

.service-price-layout__form .section-title {
  margin: 0 0 28px !important;
  color: #333;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
  text-align: left;
}

/* Price page: tariffs and calculator stay in column one, explanatory copy in two. */
.tariff-content--price-page {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
  width: 100%;
  min-width: 0;
}

.tariff-content--price-page > * {
  min-width: 0;
  max-width: none;
  flex: none;
}

.tariff-content--price-page .tariff-column {
  width: 100%;
}

.tariff-content--price-page .tariff-text__calculator {
  width: 100%;
  margin-top: 32px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid #e2e4e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.06);
}

.tariff-content--price-page .tariff-text__calculator--title {
  margin: 0 0 24px;
}

@media screen and (max-width: 1050px) {
  .service-price-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-price-layout__form {
    width: 100%;
  }
}

@media screen and (max-width: 900px) {
  .tariff-content--price-page {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .home-services {
    margin-top: 24px;
    padding-top: 30px;
  }

  .tak-form-section--home {
    padding: 40px 0 48px;
  }

  .tak-form-section--home > .container {
    width: calc(100% - 30px);
  }

  .services-page {
    margin-top: 0;
    padding-top: 32px;
    padding-bottom: 36px;
  }

  .service-pricing {
    padding-bottom: 52px;
  }

  .service-pricing .calculator_title_block {
    margin-bottom: 22px;
    font-size: 22px;
    line-height: 1.3;
  }

  .service-price-layout__form {
    padding: 22px 16px;
  }

  .service-pricing .tariff,
  .tariff-content--price-page .tariff {
    gap: 14px;
    padding: 14px 12px;
    font-size: 14px;
    line-height: 1.45;
  }

  .tariff-content--price-page .tariff-text__calculator {
    padding: 20px 15px;
  }
}

@media screen and (max-width: 420px) {
  .service-pricing .tariff-right,
  .tariff-content--price-page .tariff-right {
    white-space: normal;
  }
}
