/*!
 * Estetika Window Calculator — стили v0.2
 * Европейский архитектурный минимализм: белый / #F5F6F8, графит #1D252C,
 * тонкие границы, без теней и скруглений.
 * Все селекторы начинаются с .ec, чтобы перебить стили кнопок/полей темы Astra.
 * Адаптивность построена на container queries: калькулятор подстраивается
 * под ширину своего блока, а не экрана.
 */

.ec {
  --ec-bg: #F5F6F8;
  --ec-ink: #1D252C;
  --ec-muted: #68727C;
  --ec-line: #D3D8DD;
  --ec-err: #A12622;
  --ec-sticky-top: 24px;   /* если в Astra липкая шапка — увеличьте, напр. 100px */
  --ec-bleed: 100vmax;     /* серый фон на всю ширину экрана; 0 — отключить */

  box-sizing: border-box;
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0;
  background: var(--ec-bg);
  /* фон-«полоса» на всю ширину экрана без горизонтальной прокрутки */
  box-shadow: 0 0 0 var(--ec-bleed) var(--ec-bg);
  clip-path: inset(0 calc(var(--ec-bleed) * -1));
  color: var(--ec-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Единая ширина до 1200px независимо от узкого контейнера Astra */
.ec.ec--wide {
  width: min(1200px, calc(100vw - 32px));
  max-width: none;
  left: 50%;
  transform: translateX(-50%);
}
.ec *, .ec *::before, .ec *::after { box-sizing: border-box; }
.ec [hidden] { display: none !important; }
.ec p, .ec dl, .ec dd, .ec ul, .ec li { margin: 0; padding: 0; }
.ec ul, .ec li { list-style: none; }
.ec label { margin: 0; font-weight: normal; }
.ec svg { max-width: 100%; }
.ec .ec-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- сетка ---------- */
.ec .ec-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ec .ec-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
@container (min-width: 940px) {
  .ec .ec-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
  .ec .ec-col { gap: 20px; }
  .ec .ec-summary { position: sticky; top: var(--ec-sticky-top); }
}

/* ---------- секции ---------- */
.ec .ec-section { background: #fff; border: 1px solid var(--ec-line); min-width: 0; }
.ec .ec-section__head { display: flex; align-items: baseline; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--ec-line); }
.ec .ec-section__num { font-size: 12px; letter-spacing: .12em; color: var(--ec-muted); font-variant-numeric: tabular-nums; }
.ec .ec-section__title { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ec-ink); }
.ec .ec-section__body { padding: 18px; }
@container (max-width: 520px) {
  .ec .ec-section__head { padding: 10px 14px; }
  .ec .ec-section__body { padding: 14px; }
}

/* ---------- плитки выбора (radio) ---------- */
.ec .ec-tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ec .ec-tiles--types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 560px) and (max-width: 939px) {
  .ec .ec-tiles--types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (min-width: 1040px) {
  .ec .ec-tiles--types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-width: 400px) {
  .ec .ec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ec .ec-tile { position: relative; display: block; min-width: 0; cursor: pointer; }
.ec .ec-tile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ec .ec-tile__body {
  display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 52px;
  padding: 11px 12px; background: #fff; border: 1px solid var(--ec-line); transition: border-color .15s;
}
.ec .ec-tile:hover .ec-tile__body { border-color: #8A939B; }
.ec .ec-tile input:checked + .ec-tile__body { border-color: var(--ec-ink); box-shadow: inset 0 0 0 1px var(--ec-ink); }
.ec .ec-tile input:focus-visible + .ec-tile__body { outline: 2px solid var(--ec-ink); outline-offset: 2px; }
.ec .ec-tile__title { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ec .ec-tile__hint { font-size: 12px; color: var(--ec-muted); }
.ec .ec-tile--type .ec-tile__body { align-items: center; justify-content: space-between; text-align: center; gap: 8px; padding: 12px 6px 10px; }
.ec .ec-tile--type .ec-tile__title { font-size: 12.5px; hyphens: auto; -webkit-hyphens: auto; }
.ec .ec-ico-svg { display: block; width: 72px; max-width: 100%; height: auto; }
.ec .ec-ico { fill: none; stroke: var(--ec-ink); stroke-width: 1.2; }

/* ---------- чертёж ---------- */
.ec .ec-drawing { background: #fff; border: 1px solid var(--ec-line); }
.ec .ec-drawing svg { display: block; width: 100%; height: auto; max-height: 460px; }
.ec .ec-s { stroke: var(--ec-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ec .ec-wall { stroke: none; }
.ec .ec-wall-label { font-size: 11px; fill: var(--ec-muted); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.ec .ec-handle { stroke: #fff; stroke-width: .6; vector-effect: non-scaling-stroke; }
.ec .ec-sym { fill: none; stroke: var(--ec-ink); stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.ec .ec-fixed-label { font-size: 12px; fill: var(--ec-muted); letter-spacing: .06em; pointer-events: none; }
.ec .ec-dim { font-size: 13px; fill: var(--ec-ink); font-variant-numeric: tabular-nums; }
.ec .ec-dim-line { fill: none; stroke: var(--ec-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ec .ec-hit { cursor: pointer; outline: none; }
.ec .ec-hit__hover { fill: var(--ec-ink); fill-opacity: 0; stroke: none; }
.ec .ec-hit:hover .ec-hit__hover { fill-opacity: .06; }
.ec .ec-hit__ring { display: none; fill: none; stroke: var(--ec-ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ec .ec-hit.is-selected .ec-hit__ring { display: block; }
.ec .ec-hit:focus-visible .ec-hit__ring { display: block; stroke-dasharray: 4 3; }

.ec .ec-inspector { margin-top: 14px; }
.ec .ec-inspector__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ec .ec-inspector__name { font-size: 14px; font-weight: 600; }
.ec .ec-muted { font-size: 12px; color: var(--ec-muted); font-variant-numeric: tabular-nums; }
.ec .ec-auto { margin-top: 2px; font-size: 12px; color: var(--ec-muted); }
.ec .ec-legend { margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--ec-muted); }

/* ---------- сегментированные кнопки ---------- */
.ec .ec-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.ec .ec-seg--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ec .ec-seg__btn {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; margin: 0 -1px 0 0; padding: 8px 10px;
  background: #fff; color: var(--ec-ink);
  border: 1px solid var(--ec-line); border-radius: 0; box-shadow: none;
  font: inherit; font-size: 13px; line-height: 1.25; text-transform: none; letter-spacing: 0;
  cursor: pointer; position: relative; transition: background .15s, color .15s, border-color .15s;
}
.ec .ec-seg__btn:hover { border-color: var(--ec-ink); background: #fff; color: var(--ec-ink); z-index: 1; }
.ec .ec-seg__btn[aria-pressed="true"], .ec .ec-seg__btn[aria-pressed="true"]:hover { background: var(--ec-ink); border-color: var(--ec-ink); color: #fff; z-index: 2; }
.ec .ec-seg__btn:focus-visible { outline: 2px solid var(--ec-ink); outline-offset: 2px; z-index: 3; }
@container (max-width: 520px) {
  .ec .ec-seg { grid-template-columns: minmax(0, 1fr); }
  .ec .ec-seg--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ec .ec-seg .ec-seg__btn { margin: 0 0 -1px 0; }
  .ec .ec-seg--small .ec-seg__btn { margin: 0 -1px 0 0; }
}

/* ---------- поля и ползунки ---------- */
.ec .ec-fields { display: grid; gap: 18px; }
.ec .ec-label { display: block; margin-bottom: 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ec-muted); }
.ec .ec-field__row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; }
.ec .ec-lead .ec-field + .ec-field { margin-top: 14px; }
.ec .ec-hint { margin-top: 6px; font-size: 12px; color: var(--ec-muted); }
.ec .ec-field.is-invalid .ec-hint { color: var(--ec-err); font-weight: 600; }
.ec .ec-field.is-invalid .ec-input { border-color: var(--ec-err); box-shadow: inset 0 0 0 1px var(--ec-err); }

.ec .ec-input {
  display: block; width: 100%; height: 46px; margin: 0; padding: 0 12px;
  background: #fff; color: var(--ec-ink);
  border: 1px solid var(--ec-line); border-radius: 0; box-shadow: none;
  font: inherit; font-size: 16px; font-variant-numeric: tabular-nums;
}
.ec .ec-input:focus { outline: none; border-color: var(--ec-ink); box-shadow: inset 0 0 0 1px var(--ec-ink); background: #fff; color: var(--ec-ink); }
.ec .ec-input::placeholder { color: #9AA3AB; }

.ec .ec-range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 28px; margin: 0; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; cursor: pointer;
}
.ec .ec-range:focus { outline: none; }
.ec .ec-range::-webkit-slider-runnable-track { height: 1px; background: var(--ec-ink); border: 0; }
.ec .ec-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -9px; background: #fff; border: 1px solid var(--ec-ink); border-radius: 0; box-shadow: none; }
.ec .ec-range::-moz-range-track { height: 1px; background: var(--ec-ink); border: 0; }
.ec .ec-range::-moz-range-thumb { width: 16px; height: 16px; background: #fff; border: 1px solid var(--ec-ink); border-radius: 0; box-shadow: none; }
.ec .ec-range:focus-visible::-webkit-slider-thumb { background: var(--ec-ink); }
.ec .ec-range:focus-visible::-moz-range-thumb { background: var(--ec-ink); }
@container (max-width: 400px) {
  .ec .ec-field__row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
}

/* ---------- параметры ---------- */
.ec .ec-group { margin-bottom: 22px; }
.ec .ec-group:last-child { margin-bottom: 0; }
.ec .ec-group__title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ec-muted); }
.ec .ec-group__aside { letter-spacing: 0; text-transform: none; font-size: 12px; text-align: right; color: var(--ec-ink); }

.ec .ec-swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }
.ec .ec-swatch { position: relative; display: block; cursor: pointer; }
.ec .ec-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ec .ec-swatch__chip { display: block; width: 40px; height: 40px; border: 1px solid var(--ec-line); outline: 1px solid transparent; outline-offset: 3px; }
.ec .ec-swatch:hover .ec-swatch__chip { border-color: #8A939B; }
.ec .ec-swatch input:checked + .ec-swatch__chip { outline-color: var(--ec-ink); border-color: var(--ec-ink); }
.ec .ec-swatch input:focus-visible + .ec-swatch__chip { outline: 2px solid var(--ec-ink); outline-offset: 3px; }

.ec .ec-check { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ec-line); cursor: pointer; }
.ec .ec-checks .ec-check:first-child { border-top: 0; padding-top: 0; }
.ec .ec-check input { position: absolute; top: 13px; left: 0; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.ec .ec-checks .ec-check:first-child input { top: 2px; }
.ec .ec-check__box { position: relative; flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; background: #fff; border: 1px solid var(--ec-ink); }
.ec .ec-check input:checked + .ec-check__box::after { content: ""; position: absolute; inset: 3px; background: var(--ec-ink); }
.ec .ec-check input:focus-visible + .ec-check__box { outline: 2px solid var(--ec-ink); outline-offset: 2px; }
.ec .ec-check__text { display: flex; flex: 1; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.ec .ec-check__name { font-size: 14px; }
.ec .ec-check__name--small { font-size: 12px; color: var(--ec-muted); line-height: 1.45; }
.ec .ec-check__price { font-size: 13px; color: var(--ec-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec .ec-check--consent { border-top: 0; padding: 0; margin: 4px 0 14px; }
.ec .ec-check--consent input { top: 2px; }

/* ---------- расчёт ---------- */
.ec .ec-spec { margin-bottom: 16px; }
.ec .ec-spec__row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--ec-line); font-size: 13px; }
.ec .ec-spec__row:first-child { border-top: 0; padding-top: 0; }
.ec .ec-spec dt { margin: 0; color: var(--ec-muted); }
.ec .ec-spec dd { margin: 0; font-variant-numeric: tabular-nums; }

.ec .ec-lines { border-top: 1px solid var(--ec-ink); }
.ec .ec-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0; padding: 9px 0; border-bottom: 1px solid var(--ec-line); font-size: 14px; }
.ec .ec-lines__label small { display: block; font-size: 12px; color: var(--ec-muted); }
.ec .ec-lines__val { white-space: nowrap; font-variant-numeric: tabular-nums; }

.ec .ec-total { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; padding: 16px 0 6px; }
.ec .ec-total__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ec-muted); }
.ec .ec-total__sum { font-size: clamp(26px, 6cqi, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ec .ec-note { margin: 0 0 18px; font-size: 12px; line-height: 1.5; color: var(--ec-muted); }

/* ---------- кнопки ---------- */
.ec .ec-btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; margin: 0; padding: 12px 20px;
  background: #fff; color: var(--ec-ink);
  border: 1px solid var(--ec-ink); border-radius: 0; box-shadow: none;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background .15s, color .15s;
}
.ec .ec-btn--block { display: flex; width: 100%; }
.ec .ec-btn--primary, .ec .ec-btn--primary:visited { background: var(--ec-ink); color: #fff; }
.ec .ec-btn--primary:hover, .ec .ec-btn--primary:active { background: #35424D; border-color: #35424D; color: #fff; }
.ec .ec-btn[disabled] { opacity: .6; cursor: default; }
.ec .ec-btn:focus-visible { outline: 2px solid var(--ec-ink); outline-offset: 3px; }

/* ---------- заявка ---------- */
.ec .ec-lead { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ec-line); }
.ec .ec-error { margin-bottom: 10px; font-size: 13px; color: var(--ec-err); }
.ec .ec-error:empty { display: none; }
.ec .ec-success { margin-top: 4px; padding: 16px; border: 1px solid var(--ec-ink); font-size: 14px; line-height: 1.55; }
.ec .ec-success small { color: var(--ec-muted); }
