/**
 * Pregnancy Weight Gain Estimator — calculator section.
 * Shared below-section styles: height-predictor.css
 */

.pregnancy-weight-gain-page .height-predictor-content__trimester {
  margin-bottom: 16px;
}

.pregnancy-weight-gain-page .height-predictor-content__trimester strong {
  display: block;
  margin-bottom: 0;
}

.pregnancy-weight-gain-page .height-predictor-content__list {
  margin: 0 0 16px;
  padding-left: 24px;
  list-style-type: disc;
  list-style-position: outside;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.pregnancy-weight-gain-page .height-predictor-content__list li {
  display: list-item;
  margin-bottom: 0;
}

.pregnancy-calendar.pregnancy-weight-gain {
  --pwg-accent: #60a54a;
  --pwg-accent-dark: #4f8f3d;
  --pwg-purple: #503b68;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 0;
  padding: 24px 16px;
  background-color: #fff;
  background-image: url('../../img/pregnancy-weight-gain-calculator/pregnancy-weight-gain-calculator-grey.svg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

@media (min-width: 992px) {
  body.mamaspedia-burger-desktop .pregnancy-weight-gain-page .pregnancy-calendar-page__intro .container,
  body.mamaspedia-burger-desktop .pregnancy-weight-gain-page .height-predictor-below .container {
    margin-left: max(var(--spacing-6), calc((100vw - var(--container-2xl)) / 2 - var(--spacing-24)));
    margin-right: auto;
  }
}

@media (min-width: 992px) {
  .pregnancy-calendar.pregnancy-weight-gain {
    padding: 32px;
    border-radius: 16px;
  }
}

/* Header */
.pwg__header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .pwg__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
  }
}

.pwg__header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwg__header-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwg__header-aside {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
  width: auto;
  max-width: 100%;
}

@media (min-width: 992px) {
  .pwg__header-aside {
    justify-content: flex-end;
  }
}

.pwg__badge {
  display: block;
  margin: 0;
  color: #303030;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 14px;
}

.pwg__title {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 26px;
  font-weight: 500;
  line-height: 32px;
  color: #303030;
}

.pwg__subtitle {
  margin: 0;
  max-width: 640px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  color: #4d4d4d;
}

.pwg__units {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--pwg-accent);
  border-radius: 50px;
  background: transparent;
}

.pwg__unit-btn {
  padding: 9px 24px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--pwg-accent);
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pwg__unit-btn.is-active {
  background: var(--pwg-accent);
  color: #fff;
}

/* Layout */
.pwg__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (min-width: 992px) {
  .pwg__layout {
    grid-template-columns: minmax(280px, 380px) 1fr;
    grid-template-rows: 1fr auto;
    gap: 24px;
  }
}

.pwg__left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  min-height: 0;
}

/* Form card */
.pwg__form-card,
.pwg__info-card,
.pwg__result-card {
  padding: 32px;
  border-radius: 16px;
  background: #fff;
}

.pwg__info-card {
  padding-bottom: 59px;
}

@media (min-width: 992px) {
  .pwg__info-card {
    flex: 1;
  }
}

.pwg__form-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwg__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pwg__input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 14px;
  min-height: 44px;
  border: 1px solid rgba(77, 77, 77, 0.2);
  border-radius: 8px;
  background: #fff;
}

.pwg__label {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: #303030;
}

.pwg__input-group--dual {
  padding: 0 10px;
}

.pwg__input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 16px;
  color: #303030;
  outline: none;
}

.pwg__input--short {
  flex: 0 1 48px;
  text-align: center;
}

.pwg__unit-label {
  flex-shrink: 0;
  font-family: var(--font-primary);
  font-size: 14px;
  color: #888;
}

.pwg__select {
  width: 100%;
  min-height: 44px;
}

.pregnancy-weight-gain .custom-dropdown__trigger {
  height: auto;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid rgba(77, 77, 77, 0.2);
  border-radius: 8px;
  background: transparent;
  color: #4d4d4d;
  gap: 8px;
}

.pregnancy-weight-gain .custom-dropdown__trigger:hover,
.pregnancy-weight-gain .custom-dropdown.is-open .custom-dropdown__trigger,
.pregnancy-weight-gain .custom-dropdown.has-value .custom-dropdown__trigger {
  background: transparent;
  border-color: rgba(77, 77, 77, 0.2);
  color: #4d4d4d;
}

.pregnancy-weight-gain .custom-dropdown__trigger:focus {
  border-color: rgba(77, 77, 77, 0.2);
  outline: none;
}

.pregnancy-weight-gain .custom-dropdown__value {
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #4d4d4d;
}

.pregnancy-weight-gain .custom-dropdown__arrow {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
}

.pregnancy-weight-gain .custom-dropdown__arrow svg {
  display: block;
  width: 24px;
  height: 24px;
}

.pregnancy-weight-gain .custom-dropdown__arrow svg path {
  stroke: #4d4d4d;
}

.pregnancy-weight-gain .custom-dropdown.has-value .custom-dropdown__arrow svg path {
  stroke: #4d4d4d;
}

.pwg__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.pwg__submit.pregnancy-calendar__submit {
  flex: 1;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 8px;
  background: #60a54a;
  color: #fff;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.pwg__submit.pregnancy-calendar__submit:hover {
  background: var(--pwg-accent-dark);
}

.pwg__reset.pregnancy-calendar__clear {
  flex: 1;
  width: 100%;
  min-height: 48px;
  border: 1px solid #b1a8f6;
  border-radius: 8px;
  background: #fff;
  color: var(--pwg-purple);
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.pwg__form-errors {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fdecea;
  color: #c0392b;
  font-size: 14px;
}

.pwg__form-errors p {
  margin: 0 0 4px;
}

.pwg__form-errors p:last-child {
  margin-bottom: 0;
}

/* Info card */
.pwg__info-title {
  margin: 0 0 16px;
  font-family: var(--font-primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 18px;
  color: #303030;
}

.pwg__info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pwg__info-item {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 18px;
  color: #303030;
}

.pwg__info-term {
  font-weight: 500;
}

.pwg__info-desc {
  font-weight: 400;
}

/* Result panel */
.pwg__right {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

@media (min-width: 992px) {
  .pwg__right {
    grid-column: 2;
    grid-row: 1;
  }
}

.pwg__result-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.pwg__result-empty {
  text-align: center;
}

.pwg__result-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.pwg__result-visual img {
  display: block;
  width: 100%;
  max-width: 293px;
  max-height: 191px;
  height: auto;
  object-fit: contain;
}

.pwg__result-heading {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 22px;
  font-weight: 500;
  line-height: 22px;
  color: #303030;
}

.pwg__result-lead {
  margin: 0;
  max-width: 429px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 22px;
  color: #4d4d4d;
}

/* Stats grid */
.pwg__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  margin-top: 16px;
}

.pwg__stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid #503b68;
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.pwg__stat-icon {
  flex-shrink: 0;
  width: 80px;
  height: 78px;
  object-fit: contain;
}

.pwg__stat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.pwg__stat-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
}

.pwg__stat-row.is-calculated {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.pwg__stat-row .pwg__stat-key {
  min-width: 0;
  flex-shrink: 1;
}

.pwg__stat-row .pwg__stat-value--inline {
  flex-shrink: 0;
  text-align: left;
  white-space: nowrap;
}

.pwg__stat-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pwg-purple);
}

.pwg__stat-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7db768;
}

.pwg__stat-text,
.pwg__stat-desc {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: #4d4d4d;
}

.pwg__stat-value--inline {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: #6d4d92;
}

.pwg__stat-text.js-pwg-stat-status {
  color: #6d4d92;
}

.pwg__stat-text.js-pwg-stat-status.is-calculated {
  color: #4d4d4d;
}

.pwg__stat-desc {
  color: #6d4d92;
}

.pwg__stat-value--inline.is-calculated {
  font-weight: 600;
  line-height: 26px;
  color: #4d4d4d;
}

/* Chart */
.pwg__chart-wrap {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 14px;
  min-height: 0;
}

.pwg__chart-title {
  margin: 0 0 14px;
  font-family: var(--font-primary);
  font-size: 22px;
  line-height: 22px;
  font-weight: 500;
  text-align: center;
  color: #303030;
}

.pwg__chart-canvas-wrap {
  position: relative;
  flex: 1;
  height: 344px;
  min-height: 344px;
  padding: 16px;
  border: 1px solid #503b68;
  border-radius: 12px;
  background: radial-gradient(70.71% 70.71% at 50% 50%, rgba(254, 240, 231, 0.51) 3.54%, rgba(219, 171, 255, 0.07) 84.13%);
}

.pwg__chart-legend {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(80, 59, 104, 0.12);
  pointer-events: none;
}

.pwg__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-primary);
  font-size: 12px;
  line-height: 16px;
  color: #4d4d4d;
  white-space: nowrap;
}

.pwg__legend-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pwg__legend-dot--zone {
  background: #fdd4c0;
}

.pwg__legend-dot--progress {
  background: #6b538e;
}

.pwg__chart {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
}

/* Disclaimer */
.pwg__disclaimer {
  margin: 0;
  padding: 32px;
  border-radius: 10px;
  background: #fff;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 18px;
  color: #303030;
}

@media (min-width: 992px) {
  .pwg__left {
    grid-column: 1;
    grid-row: 1;
  }

  .pwg__disclaimer {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.pwg__disclaimer-icon {
  display: inline;
  width: 1em;
  height: 1em;
  margin-right: 0.35em;
  vertical-align: -0.125em;
}

/* Unit visibility */
.pwg__form-card[data-unit-system="metric"] .js-pwg-pre-weight-imperial,
.pwg__form-card[data-unit-system="metric"] .js-pwg-current-weight-imperial,
.pwg__form-card[data-unit-system="metric"] .js-pwg-height-imperial {
  display: none !important;
}

.pwg__form-card[data-unit-system="imperial"] .js-pwg-pre-weight-metric,
.pwg__form-card[data-unit-system="imperial"] .js-pwg-current-weight-metric,
.pwg__form-card[data-unit-system="imperial"] .js-pwg-height-metric {
  display: none !important;
}

/* Mobile */
@media (max-width: 991px) {
  .pwg__layout {
    display: flex;
    flex-direction: column;
  }

  .pwg__left {
    display: contents;
  }

  .pwg__form-card {
    order: 1;
    padding: 16px;
  }

  .pwg__right {
    order: 2;
  }

  .pwg__info-card {
    order: 3;
    padding: 8px;
  }

  .pwg__disclaimer {
    order: 4;
    padding: 8px;
  }

  .pregnancy-weight-gain-page .pregnancy-calendar-page__intro {
    padding-bottom: 0;
  }

  .pregnancy-calendar.pregnancy-weight-gain {
    padding: 20px 12px;
    border-radius: 12px;
  }

  .pwg__title {
    font-size: 22px;
    line-height: 28px;
  }

  .pwg__result-card {
    padding: 16px;
  }
}

@media (max-width: 575px) {
  .pwg__stats {
    grid-template-columns: 1fr;
  }
}
