.calculator {
  margin: 0 auto 260px;
  width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.calculator h3 {
  margin-bottom: 48px;
}
.calculator__steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.calculator__step-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 32px;
  background-color: var(--bg_beige);
  padding: 32px;
}
.calculator__step {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 48px;
}
.calculator__step-inputs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calculator__accordion {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.calculator__accordion:not(:last-child) {
  border-bottom: 1px solid var(--dark_beige);
}
.calculator__accordion:first-child .calculator__accordion-top {
  padding-top: 0;
}
.calculator__accordion-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 24px 0;
}
.calculator__accordion-bottom {
  width: 100%;
  height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: 24px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: height .4s ease-out, opacity .4s ease-out, padding-bottom .4s ease-out;
}
.calculator__accordion.open .calculator__accordion-bottom {
  opacity: 1;
  padding-bottom: 24px;
  overflow: visible;
}

.calculator__checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.calculator__step-container > .calculator__checkbox-container:last-of-type {
  margin-top: 8px;
}
.calculator__checkbox-container > input {
  display: none;
}
.calculator__checkbox {
  width: 22px;
  height: 22px;
  border: 1px solid var(--dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .3s ease-out;
} 
.calculator__checkbox img {
  opacity: 0;
  width: 12px;
  height: 12px;
  transition: all .3s ease-out;
}
.calculator__checkbox-container > input:checked + .calculator__checkbox {
  background-color: var(--olive);
}
.calculator__checkbox-container > input:checked + .calculator__checkbox img {
  opacity: 1;
}
.calculator__checkbox-container span {
  padding: 8px 16px;
  border-radius: 8px;
  background-color: white;
  white-space: nowrap;
}

.calculator__checkbox-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calculator__checkbox-qty-container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  transition: max-height .4s ease-out, opacity .4s ease-out, padding-top .4s ease-out;
}
.calculator__checkbox-qty-container.visible {
  max-height: 60px;
  opacity: 1;
  padding-top: 6px;
}
.calculator__checkbox-qty input {
  display: none;
}
.calculator__checkbox-qty label {
  width: 32px;
  text-align: center;
}
.calculator__checkbox-qty button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  border: none;
}
.calculator__checkbox-qty button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.calculator__checkbox-qty button img {
  width: 12px;
  height: 12px;
}

.calculator__step-badge {
  position: absolute;
  top: 32px;
  right: 32px;
  border-radius: 100px;
  padding: 8px 16px;
  background-color: white;
  box-shadow: 0 5px 15px 0 rgba(58, 51, 46, 0.15);
}

.calculator__subscriptions {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}
.calculator__subscription {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
  background-color: white;
  border: 4px solid white;
  border-radius: 24px;
  padding: 24px;
  cursor: pointer;
  transition: all .3s ease-out;
}
.calculator__subscription:hover {
  box-shadow: 0 0 10px 0 rgba(31, 27, 22, 0.15);
}
.calculator__subscription.selected {
  border-color: var(--olive);
}
.calculator__subscription > * {
  width: 100%;
}
.calculator__subscription input {
  display: none;
}
.calculator__subscription input.calculator__subscription-count-input {
  display: block;
}
.calculator__subscription-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.calculator__subscription-count-input {
  width: 64px;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  border: none;
  border-bottom: 2px solid var(--olive);
  background: transparent;
  color: inherit;
  padding: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.calculator__subscription-count-input::-webkit-inner-spin-button,
.calculator__subscription-count-input::-webkit-outer-spin-button {
  opacity: 1;
}
.calculator__subscription-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}
.calculator__subscription-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 12px;
}
.calculator__subscription-per-label,
.calculator__subscription-total-label {
  color: var(--muted, #8a8076);
  margin-bottom: 2px;
}
.calculator__subscription-total-old {
  text-decoration: line-through;
  color: var(--dark);
}
.calculator__subscription-old-price {
  text-decoration: line-through;
  color: var(--dark);
}

.calculator__note {
  width: 100%;
  text-align: center;
  color: var(--dark);
}

.calculator__bottom-bar {
  position: fixed;
  bottom: 10px;
  width: calc(100% - 2 * var(--padding-x));
  background-color: var(--dark_brown);
  padding: 24px;
  border-radius: 24px;
  color: white;
  display: flex;
  justify-content: space-between;
}

/* Desktop: details always visible, mobile-top hidden */
.bottom-bar__mobile-top {
  display: none;
}
.bottom-bar__details {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.bottom-bar__left {
  display: flex;
  flex-direction: column;
}
.bottom-bar__services {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.bottom-bar__services-separator {
  color: var(--dark);
}
.bottom-bar__additional-services {
  margin-bottom: 6px;
}
.bottom-bar__execution-time {
  margin-bottom: 24px;
}
.bottom-bar__additional-services span, .bottom-bar__execution-time span {
  color: var(--dark);
}
.bottom-bar__promocode {
  display: flex;
}
.bottom-bar__promocode input {
  height: 54px;
  background-color: var(--bg_beige);
  padding: 16px 24px;
  border: 1px solid rgba(232, 222, 211, 0.80);
  border-radius: 8px 0 0 8px;
  color: var(--black);
  font-size: 16px;
  font-weight: 500;
}
.bottom-bar__promocode input::placeholder {
  opacity: 0.6;
}
.bottom-bar__promocode button {
  height: 54px;
  background-color: var(--olive);
  padding: 16px 32px;
  border: none;
  border-radius: 0 8px 8px 0;
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s ease-out;
}
.bottom-bar__promocode button:hover:not(:disabled) {
  opacity: 0.8;
}
.bottom-bar__promocode button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.bottom-bar__promocode-input--ok {
  border-color: var(--olive) !important;
  color: var(--olive) !important;
}
.bottom-bar__promocode-btn--applied {
  background-color: #4a5a3a !important;
}
.bottom-bar__promo-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.875rem;
}
.bottom-bar__promo-label {
  color: var(--muted);
  font-weight: 500;
}
.bottom-bar__promo-discount {
  color: var(--olive);
  font-weight: 600;
  white-space: nowrap;
}
.bottom-bar__first-order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.875rem;
}
.bottom-bar__first-order-label {
  color: var(--muted);
  font-weight: 500;
}
.bottom-bar__first-order-discount {
  color: var(--olive);
  font-weight: 700;
  white-space: nowrap;
}
.bottom-bar__first-order-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  max-width: 280px;
  text-align: right;
}
.bottom-bar__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}
.bottom-bar__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.bottom-bar__price-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
/* Per-cleaning hint: "47 EUR / 1 прибирання" — small, inline */
.bottom-bar__sub-per {
  display: flex;
  align-items: baseline;
  gap: 6px;
  opacity: 0.75;
  margin-bottom: 2px;
}
.bottom-bar__sub-per-old {
  text-decoration: line-through;
  color: var(--dark);
}
.bottom-bar__sub-per-label {
  color: var(--dark);
}
.bottom-bar__old-price {
  text-decoration: line-through;
  color: var(--dark);
}
.bottom-bar__mobile-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bottom-bar__mobile-old-price {
  text-decoration: line-through;
  opacity: 0.6;
}
.bottom-bar__mobile-sale-price {
  line-height: 1;
}

.calculator__error a {
  text-decoration: underline;
}

.calculator__checkboxes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 24px;
}

.calculator__range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.calculator__range-minmax {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--dark);
}
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border: 1px solid rgba(32, 35, 44, 0.20);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--olive);
  cursor: pointer;
}
.calc-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--olive);
  border: none;
  cursor: pointer;
}

.calc-number {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--dark_beige);
  border-radius: 12px;
  background-color: white;
  color: var(--black);
  font-size: 16px;
  font-weight: 500;
}
.calc-sqm {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid var(--dark_beige);
  border-radius: 8px;
  background-color: white;
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}
.calc-textarea {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--dark_beige);
  border-radius: 12px;
  background-color: white;
  color: var(--black);
  font-size: 16px;
  font-weight: 500;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}
.calc-textarea::placeholder {
  color: var(--dark_beige);
  font-weight: 400;
}
.calculator__input-hint {
  display: block;
  text-align: right;
  margin-top: 8px;
  color: var(--dark);
  text-decoration: underline;
}

@media (max-width: 768px) {
  /* ── Layout ── */
  .calculator {
    width: 100%;
    padding: 0 16px;
    margin-bottom: 120px;
  }
  .calculator h3 {
    margin-bottom: 32px;
    text-align: center;
  }
  .calculator__step-container {
    padding: 24px 16px;
    border-radius: 24px;
  }
  .calculator__step {
    margin-bottom: 32px;
  }
  .calculator__step-badge {
    top: 20px;
    right: 16px;
  }

  /* ── Subscriptions: stack vertically ── */
  .calculator__subscriptions {
    flex-direction: column;
    gap: 12px;
  }

  /* ── Bottom bar ── */
  .calculator__bottom-bar {
    flex-direction: column;
    gap: 0;
    padding: 0;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    width: 100%;
    left: 0;
  }

  /* Mobile summary row — always visible */
  .bottom-bar__mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
  }
  .bottom-bar__expand-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    padding: 0;
  }
  .bottom-bar__expand-icon {
    width: 20px;
    height: 20px;
    transition: transform .3s ease-out;
  }
  .calculator__bottom-bar.open .bottom-bar__expand-icon {
    transform: rotate(180deg);
  }
  .bottom-bar__mobile-top .button.filled.yellow {
    flex-shrink: 0;
  }

  /* Details panel — collapsed by default */
  .bottom-bar__details {
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .4s ease-out, opacity .3s ease-out;
  }
  .calculator__bottom-bar.open .bottom-bar__details {
    max-height: 600px;
    opacity: 1;
  }
  .bottom-bar__left {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .bottom-bar__execution-time {
    margin-bottom: 8px;
  }
  .bottom-bar__right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .bottom-bar__price {
    align-items: flex-start;
  }
  .bottom-bar__right .button {
    flex-shrink: 0;
  }

  /* Promo code full width on mobile */
  .bottom-bar__promocode {
    flex-direction: column;
    gap: 8px;
  }
  .bottom-bar__promocode input {
    border-radius: 8px;
    width: 100%;
  }
  .bottom-bar__promocode button {
    border-radius: 8px;
    width: 100%;
  }
}