.tasis-calculator-page,
.tasis-calculator-page * {
  box-sizing: border-box;
}

.site-main--calculator {
  padding-block: clamp(24px, 5vw, 64px);
  overflow-x: clip;
}

.tasis-calculator-page {
  min-width: 0;
}

.tasis-calculator-hero {
  max-width: 850px;
  margin-inline: auto;
  text-align: center;
}

.tasis-calculator-hero__eyebrow,
.tasis-calculator-products header p,
.tasis-calculator-result__header p {
  margin: 0 0 6px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--tasis-accent, #1268d4);
}

.tasis-calculator-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.25;
}

.tasis-calculator-hero > p:last-child {
  margin: 14px auto 0;
  max-width: 700px;
  color: var(--tasis-muted, #5d6672);
  line-height: 1.9;
}

.tasis-calculator-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px 0;
}

.tasis-calculator-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--tasis-border, #e0e5ec);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.tasis-calculator-nav a[aria-current="page"] {
  border-color: var(--tasis-accent, #1268d4);
  color: var(--tasis-accent, #1268d4);
  font-weight: 700;
}

.tasis-calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 28px;
}

.tasis-calculator-panel,
.tasis-calculator-guide,
.tasis-calculator-result {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--tasis-border, #e0e5ec);
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(27, 39, 51, .06);
}

.tasis-calculator-panel {
  padding: clamp(18px, 3vw, 30px);
}

.tasis-calculator-panel > header h2,
.tasis-calculator-guide h2,
.tasis-calculator-result h2,
.tasis-calculator-result h3 {
  margin-top: 0;
}

.tasis-calculator-panel > header p,
.tasis-calculator-guide p {
  color: var(--tasis-muted, #5d6672);
  line-height: 1.8;
}

.tasis-calculator-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.tasis-calculator-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tasis-calculator-field__label {
  font-weight: 700;
}

.tasis-calculator-field__label small {
  font-weight: 400;
  color: var(--tasis-muted, #5d6672);
}

.tasis-calculator-field input,
.tasis-calculator-field select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--tasis-border, #cfd7e3);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.tasis-calculator-field input:focus,
.tasis-calculator-field select:focus {
  outline: 2px solid rgba(18, 104, 212, 0.24);
  border-color: var(--tasis-accent, #1268d4);
}

.tasis-calculator-form__submit {
  min-height: 48px;
  margin-top: 20px;
  padding-inline: 24px;
}

.tasis-calculator-form__submit:disabled {
  cursor: wait;
  opacity: .7;
}

.tasis-calculator-form__status {
  min-height: 24px;
  margin: 10px 0 0;
}

.tasis-calculator-form__status.is-error {
  color: #a82121;
}

.tasis-calculator-form__status.is-success {
  color: #18753c;
}

.tasis-calculator-guide {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.tasis-calculator-guide ul {
  display: grid;
  gap: 10px;
  padding-inline-start: 20px;
  line-height: 1.7;
}

.tasis-calculator-result {
  margin-top: 24px;
  padding: clamp(18px, 3vw, 30px);
  scroll-margin-top: 24px;
}

.tasis-calculator-result__header,
.tasis-calculator-products > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tasis-calculator-result__header h2,
.tasis-calculator-products > header h2 {
  margin-bottom: 0;
}

.tasis-calculator-result__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.tasis-calculator-result__summary > div {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border-radius: 12px;
  background: var(--tasis-surface, #f4f7fb);
}

.tasis-calculator-result__summary span {
  color: var(--tasis-muted, #5d6672);
}

.tasis-calculator-result__summary strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 2.3vw, 1.45rem);
}

.tasis-calculator-result__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tasis-calculator-result__details section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--tasis-border, #e0e5ec);
  border-radius: 12px;
}

.tasis-calculator-result__details ul {
  margin-bottom: 0;
  padding-inline-start: 20px;
  line-height: 1.8;
}

.tasis-calculator-products {
  margin-top: 32px;
  scroll-margin-top: 24px;
}

.tasis-calculator-products > header a {
  white-space: nowrap;
}

.tasis-calculator-products__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tasis-calculator-product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--tasis-border, #e0e5ec);
  border-radius: 12px;
  background: #fff;
}

.tasis-calculator-product__image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f7f9;
}

.tasis-calculator-product__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tasis-calculator-product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
}

.tasis-calculator-product__stock {
  align-self: flex-start;
  margin-bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf8f1;
  color: #18753c;
  font-size: .78rem;
  font-weight: 700;
}

.tasis-calculator-product h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
}

.tasis-calculator-product h3 a {
  color: inherit;
  text-decoration: none;
}

.tasis-calculator-product__specs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  margin: 12px 0;
  font-size: .84rem;
}

.tasis-calculator-product__specs dt,
.tasis-calculator-product__specs dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.tasis-calculator-product__specs dt {
  color: var(--tasis-muted, #5d6672);
}

.tasis-calculator-product__price {
  margin-top: auto;
  padding-top: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tasis-calculator-product__button {
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.tasis-calculator-products__empty,
.tasis-calculator-noscript {
  padding: 16px;
  border-radius: 10px;
  background: #fff6df;
  color: #6d4b00;
}

/* Double Offer Architecture Styles */
.tasis-calculator-offer-group {
  margin-top: 28px;
  padding: 22px;
  border-radius: 16px;
  background: #fbfcfd;
  border: 1px solid var(--tasis-border, #e0e5ec);
  box-shadow: 0 4px 18px rgba(27, 39, 51, .03);
}

.tasis-calculator-offer-group--fit {
  border-right: 5px solid #10b981;
}

.tasis-calculator-offer-group--upsized {
  border-right: 5px solid #f59e0b;
}

.tasis-calculator-offer-header {
  margin-bottom: 18px;
}

.tasis-calculator-offer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: .92rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1.4;
}

.tasis-calculator-offer-badge--fit {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.tasis-calculator-offer-badge--upsized {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.tasis-calculator-offer-desc {
  margin: 10px 0 0;
  font-size: .88rem;
  color: var(--tasis-muted, #5d6672);
  line-height: 1.8;
}

.tasis-calculator-product__badge {
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--tasis-border, #e0e5ec);
}

.tasis-calculator-product__badge--fit {
  background: #f0fdf4;
  color: #166534;
}

.tasis-calculator-product__badge--upsized {
  background: #fffbeb;
  color: #b45309;
}

.tasis-calculator-editor-content {
  max-width: 880px;
  margin: 32px auto 0;
}

@media (max-width: 1100px) {
  .tasis-calculator-products__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .tasis-calculator-layout,
  .tasis-calculator-result__details {
    grid-template-columns: 1fr;
  }

  .tasis-calculator-guide {
    position: static;
  }

  .tasis-calculator-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-main--calculator {
    padding-block: 20px 40px;
  }

  .tasis-calculator-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    margin-inline: calc(var(--tasis-gutter, 16px) * -1);
    padding-inline: var(--tasis-gutter, 16px);
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .tasis-calculator-nav a {
    flex: 0 0 auto;
  }

  .tasis-calculator-form__grid,
  .tasis-calculator-result__summary,
  .tasis-calculator-products__grid {
    grid-template-columns: 1fr;
  }

  .tasis-calculator-form__submit,
  .tasis-calculator-result__header .button {
    width: 100%;
  }

  .tasis-calculator-result__header,
  .tasis-calculator-products > header {
    align-items: stretch;
    flex-direction: column;
  }

  .tasis-calculator-products > header a {
    align-self: flex-start;
  }

  .tasis-calculator-product {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .tasis-calculator-product__image {
    aspect-ratio: auto;
    min-height: 100%;
  }

  .tasis-calculator-product__specs {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tasis-calculator-product__specs dd + dt {
    margin-top: 6px;
  }
}

@media (max-width: 360px) {
  .tasis-calculator-panel,
  .tasis-calculator-guide,
  .tasis-calculator-result {
    border-radius: 12px;
  }

  .tasis-calculator-product {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}
