.pricing-builder {
  padding: 72px 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.pricing-builder__container {
  display: grid;
  gap: 28px;
}

.pricing-builder__header h1 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
}

.pricing-builder__eyebrow {
  margin: 0 0 10px;
  color: #db333c;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}

.pricing-builder__intro {
  margin: 0;
  max-width: 72ch;
  color: #475569;
  line-height: 1.6;
}

.pricing-builder__form {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 3vw, 34px);
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.components__topbar h2,
.summary h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.2rem;
}

.components__hint,
.summary p {
  margin: 8px 0 0;
  color: #475569;
  line-height: 1.55;
}

.components__topbar {
  display: grid;
  gap: 10px;
}

.components__help-link {
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: #334155;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.components__help-link:hover {
  color: #0f172a;
}

.components__help-link:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(219, 51, 60, 0.22);
}

.components__list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.component-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #dbe4ee;
  background-color: #f9fbfe;
}

.component-row__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.component-row__field label {
  color: #1e293b;
  font-weight: 600;
  font-size: 0.92rem;
}

.component-row__field input,
.component-row__field select {
  min-height: 44px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #1e293b;
  background: #ffffff;
}

.component-row__field input:focus,
.component-row__field select:focus,
.button:focus-visible {
  outline: none;
  border-color: #db333c;
  box-shadow: 0 0 0 3px rgba(219, 51, 60, 0.2);
}

.component-row__actions {
  display: flex;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button--primary {
  min-height: 48px;
  background: #db333c;
  color: #ffffff;
}

.button--primary:hover {
  background: #bd2b33;
}

.button--secondary {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #ffffff;
}

.button--secondary:hover,
.button--ghost:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.button--ghost {
  color: #334155;
  border-color: #cbd5e1;
  background: #ffffff;
}

.summary {
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.summary--alert {
  margin-bottom: 1rem;
}

.summary__item,
.summary__price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.summary__item strong {
  color: #0f172a;
  font-size: 1.1rem;
}

.summary__price {
  margin-top: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.summary__price strong {
  color: #db333c;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}


.summary__offer {
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbe4ee;
  background: linear-gradient(130deg, #f8fafc 0%, #f1f5f9 100%);
}

.summary__offer-label {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.summary__offer-note {
  margin: 6px 0 0;
  color: #334155;
  font-size: 0.88rem;
}

.summary__price--initial {
  padding: 10px 12px;
}

.summary__price--initial strong {
  color: #334155;
  font-size: 1.05rem;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: #94a3b8;
}

.summary__discount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.summary__discount span {
  color: #334155;
  font-weight: 600;
}

.summary__discount strong {
  color: #0f766e;
  font-size: 1.06rem;
}

.summary__price--final {
  margin-top: 0;
  border-color: #fbcfd1;
  background: linear-gradient(135deg, #fff5f6 0%, #ffffff 100%);
}

.summary__price--final strong {
  color: #c61f2b;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.summary__note {
  font-size: 0.95rem;
  margin-top: 6px;
}

.pricing-builder__footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
}

.components-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.components-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.components-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.components-modal__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.2);
}

.components-modal__panel h2 {
  margin: 0;
  color: #0f172a;
}

.components-modal__panel p {
  margin: 10px 0 0;
  color: #475569;
}

.components-modal__examples {
  margin: 18px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: #334155;
}

.components-modal__examples strong {
  color: #0f172a;
}

.components-modal__actions {
  margin-top: 22px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .component-row {
    grid-template-columns: 1fr 1fr;
  }

  .component-row__field--label,
  .component-row__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .pricing-builder {
    padding: 44px 0;
  }

  .component-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .component-row__field--label,
  .component-row__actions {
    grid-column: auto;
  }

  .summary__item,
  .summary__price,
  .summary__discount {
    align-items: flex-start;
    flex-direction: column;
  }

  .button--primary,
  .button--secondary,
  .button--ghost {
    width: 100%;
    justify-content: center;
  }
}
