/* Modern skin for calculator embed */
body.calc-embed {
  margin: 0;
  padding: 0.5rem 0 1rem;
  font-family: "Manrope", system-ui, sans-serif !important;
  color: #152029;
  background: transparent;
  overflow-x: hidden;
  min-width: 0;
  line-height: 1.4;
}

.calc-embed .raschet {
  padding: 0;
}

.calc-embed .calc-wrapper {
  margin-bottom: 0.75rem;
}

.calc-embed .calc-wrapper h2 {
  margin: 0 0 0.85rem;
  font-family: inherit !important;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1f3a52;
  text-transform: none;
}

.calc-embed .calc-menu {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin: 0 0 1rem;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 58, 82, 0.1);
  box-shadow: 0 8px 22px rgba(21, 32, 41, 0.05);
}

.calc-embed .calc-menu li {
  margin: 0;
}

.calc-embed .calc-menu a {
  display: block;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-weight: 750;
  font-size: 0.92rem;
  color: #5d6b78 !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.calc-embed .calc-menu li.active a,
.calc-embed .calc-menu a:hover {
  background: linear-gradient(90deg, #31a375, #19b27f);
  color: #fff !important;
}

.calc-embed .blk.calculator,
.calc-embed .blk.balkon-calc {
  padding: 1.1rem 1rem 1.25rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 58, 82, 0.08);
  box-shadow: 0 14px 36px rgba(21, 32, 41, 0.07);
}

.calc-embed h4 {
  font-family: inherit !important;
  font-weight: 750;
  color: #1f3a52;
  letter-spacing: -0.01em;
}

.calc-embed .dop-field label,
.calc-embed .param__desc,
.calc-embed .blk-field label {
  font-family: inherit !important;
  color: #5d6b78;
}

.calc-embed .param-inpt-text,
.calc-embed .param-inpt-text-2,
.calc-embed .blk-field input,
.calc-embed select {
  border-radius: 10px !important;
  border: 1px solid rgba(31, 58, 82, 0.16) !important;
  font-family: inherit !important;
  font-weight: 650;
}

.calc-embed .bal-send {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(25, 178, 127, 0.18), transparent 55%),
    linear-gradient(145deg, #1a3348, #143748);
  color: #fff;
  text-align: center;
}

.calc-embed .balk-price {
  margin: 0 0 0.75rem;
  font-family: inherit !important;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff !important;
}

.calc-embed .balk-price span {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #7ddeb8;
}

.calc-embed a.modalka {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem !important;
  border-radius: 12px !important;
  background: linear-gradient(90deg, #ef9340, #e07a1f) !important;
  color: #fff !important;
  font-family: inherit !important;
  font-weight: 750 !important;
  font-size: 0.95rem !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: 0 10px 22px rgba(224, 122, 31, 0.28);
  border: 0 !important;
}

.calc-embed a.modalka:hover {
  filter: brightness(1.05);
}

.calc-embed .window-type__block_img {
  border-radius: 10px;
  overflow: hidden;
}

.calc-embed .window-type__block_img.active {
  outline: 2px solid #19b27f;
  outline-offset: 2px;
}

.calc-embed .thumb-bal li.active a,
.calc-embed .thumb-bal a:hover {
  outline: 2px solid #19b27f;
  outline-offset: 2px;
  border-radius: 8px;
}

/* hide old popup — lead form replaces it */
.calc-embed #modalka,
.calc-embed #sent {
  display: none !important;
}

@media (max-width: 767px) {
  .calc-embed .blk.calculator,
  .calc-embed .blk.balkon-calc {
    padding: 0.85rem 0.7rem 1rem;
  }

  .calc-embed .calc-menu {
    width: 100%;
  }

  .calc-embed .calc-menu a {
    flex: 1;
    text-align: center;
  }
}

/* ========== Mobile UX overhaul ========== */
@media (max-width: 767.98px) {
  body.calc-embed {
    padding: 0.25rem 0 0.5rem;
  }

  .calc-embed .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }

  .calc-embed .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .calc-embed [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .calc-embed .calc-wrapper h2 {
    font-size: 1.15rem;
    margin-bottom: 0.55rem;
  }

  .calc-embed .calc-menu {
    display: flex;
    width: 100%;
    margin-bottom: 0.65rem;
  }

  .calc-embed .calc-menu a {
    flex: 1;
    text-align: center;
    padding: 0.7rem 0.5rem;
    font-size: 0.88rem;
  }

  .calc-embed .blk.calculator,
  .calc-embed .blk.balkon-calc {
    padding: 0.75rem 0.65rem 0.85rem;
    border-radius: 16px;
  }

  .calc-embed h4 {
    margin: 0.35rem 0 0.55rem;
    font-size: 0.92rem;
  }

  /* Window types: 2×2 grid instead of left column stack */
  .calc-embed .choice-info__type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .calc-embed .choice-info__type > h4 {
    grid-column: 1 / -1;
    margin: 0 0 0.15rem;
  }

  .calc-embed .window-type {
    width: 100%;
    margin: 0;
  }

  .calc-embed .window-type__block {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 4.5rem;
    padding: 0.45rem !important;
    white-space: normal !important;
    border-radius: 12px !important;
    background: #f3f7f5 !important;
    border: 1.5px solid rgba(31, 58, 82, 0.1) !important;
  }

  .calc-embed .window-type__block.active {
    border-color: #19b27f !important;
    background: rgba(25, 178, 127, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(25, 178, 127, 0.2);
  }

  .calc-embed .window-type__block.active .window-type__block_preview,
  .calc-embed .window-type__block.active .window-type__block_img.active {
    border-color: transparent !important;
  }

  .calc-embed .window-type__block_preview,
  .calc-embed .window-type__block_img {
    margin: 0 auto;
  }

  .calc-embed .window-type__block_preview img,
  .calc-embed .window-type__block_img img {
    max-width: 72px;
    max-height: 58px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* On mobile, hover-reveal of variants is awkward — keep preview only until tap */
  .calc-embed .window-type__block:hover .window-type__block_preview {
    display: block;
  }

  .calc-embed .window-type__block:hover .window-type__block_img {
    display: none;
  }

  .calc-embed .window-type__block.active .window-type__block_img.active {
    display: inline-block;
  }

  .calc-embed .window-type__block.active .window-type__block_preview {
    display: none;
  }

  /* Extra options: two columns, big touch targets */
  .calc-embed #dop2 .col-md-12,
  .calc-embed #dop1 .col-md-12 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .calc-embed .dop-field {
    display: flex !important;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    margin: 0 !important;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: #f3f7f5;
    border: 1px solid rgba(31, 58, 82, 0.08);
  }

  .calc-embed .dop-field label {
    margin: 0 !important;
    font-size: 0.82rem !important;
    font-weight: 650;
    line-height: 1.25;
    color: #1f3a52 !important;
  }

  .calc-embed .dop-field input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
    accent-color: #19b27f;
  }

  /* Preview: don't eat half the screen */
  .calc-embed .choice-info {
    margin-bottom: 0.5rem;
  }

  .calc-embed .choice-info__preview_col-right {
    min-height: 0 !important;
    max-height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .calc-embed .choice-info__preview_col-right img,
  .calc-embed .choice-info__preview_col-left img,
  .calc-embed #raschet img {
    max-width: 100% !important;
    max-height: 210px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
  }

  .calc-embed .choice-info__preview_col-left {
    left: 0 !important;
  }

  .calc-embed .slider-h {
    margin-top: 0.5rem !important;
    bottom: auto !important;
    width: 100% !important;
  }

  /* Size + selects: full width, larger taps */
  .calc-embed .calculator__params {
    margin-top: 0.35rem;
  }

  .calc-embed .param-wrp {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.45rem;
    margin: 0.5rem 0 !important;
    width: 100%;
  }

  .calc-embed .param {
    flex: 1 1 42%;
    min-width: 0;
  }

  .calc-embed .param-inpt-text,
  .calc-embed .param-inpt-text-2,
  .calc-embed .blk-field input,
  .calc-embed select {
    width: 100% !important;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem !important;
    font-size: 1rem !important;
  }

  .calc-embed .param__desc {
    font-size: 0.75rem;
  }

  .calc-embed .param-c {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .calc-embed .param-c > div {
    margin: 0 !important;
    width: 100%;
  }

  /* Balcony thumbs horizontal */
  .calc-embed .thumb-bal {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    padding: 0;
    list-style: none;
  }

  .calc-embed .thumb-bal li {
    margin: 0 !important;
  }

  .calc-embed .thumb-bal a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.25rem;
    padding: 0.4rem;
    border-radius: 12px;
    background: #f3f7f5;
  }

  .calc-embed .thumb-bal img {
    max-width: 100%;
    max-height: 64px;
  }

  .calc-embed .width-fields .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.2rem !important;
  }

  /* Sticky price + CTA — always at hand */
  .calc-embed .bal-send {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 0.85rem -0.65rem 0;
    padding: 0.85rem 0.9rem calc(0.85rem + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -10px 28px rgba(8, 18, 28, 0.18);
  }

  .calc-embed .balk-price {
    margin: 0 0 0.55rem !important;
    font-size: 1rem !important;
  }

  .calc-embed .balk-price span {
    font-size: 1.45rem !important;
  }

  .calc-embed a.modalka {
    width: 100%;
    min-height: 3rem;
  }


  /* Bigger type tiles */
  .calc-embed .window-type__block {
    min-height: 5.25rem;
  }

  .calc-embed .window-type__block_preview img,
  .calc-embed .window-type__block_img img {
    max-width: 88px;
    max-height: 70px;
  }

  /* jQuery UI rulers are awkward on touch — hide, use number fields instead */
  .calc-embed .slider-h,
  .calc-embed .slider-v,
  .calc-embed .choice-info__preview_col-left {
    display: none !important;
  }

  .calc-embed .choice-info__preview_col-right {
    max-height: 180px;
    margin: 0.35rem 0 0.5rem;
  }

  .calc-embed .choice-info__preview_col-right img,
  .calc-embed #raschet img {
    max-height: 170px !important;
  }

  .calc-embed .param-wrp {
    background: #f3f7f5;
    border-radius: 12px;
    padding: 0.65rem 0.7rem;
  }

  .calc-embed .param-inpt-text,
  .calc-embed .param-inpt-text-2 {
    min-height: 3rem;
    font-size: 1.05rem !important;
    text-align: center;
  }

}
