/* ============================================================
   CALCULATOR V2 — Visual window configurator
   Architectural window preview, ISO opening notation,
   frame color, glass tinting, price breakdown.
   ============================================================ */

/* the v2 card */
.calc2 {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
@media (min-width: 980px) {
  .calc2 {
    grid-template-columns: 86px 1fr 340px;
    min-height: 640px;
  }
}
@media (min-width: 1180px) {
  .calc2 { grid-template-columns: 92px 1fr 400px; }
}

/* TYPE picker rail */
.calc2__types {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.calc2__types::-webkit-scrollbar { display: none; }
@media (min-width: 980px) {
  .calc2__types {
    flex-direction: column;
    padding: 20px 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    overflow-x: visible;
    overflow-y: auto;
  }
}

.calc2__type {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s var(--ease);
  position: relative;
  flex-shrink: 0;
}
@media (min-width: 980px) { .calc2__type { width: 56px; height: 56px; border-radius: 14px; } }
.calc2__type:hover { color: var(--ink); border-color: var(--blue); }
.calc2__type.on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26,77,143,.28);
}
.calc2__type.on::after {
  content: "✓";
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #fff;
}
.calc2__type svg { width: 26px; height: 30px; }
@media (min-width: 980px) { .calc2__type svg { width: 28px; height: 32px; } }

/* CANVAS (middle) */
.calc2__canvas {
  position: relative;
  padding: 48px 36px 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #eaf0f7 0%, #d6e0ec 100%);
  min-height: 340px;
  gap: 20px;
}
@media (min-width: 600px) { .calc2__canvas { padding: 56px 56px 80px; min-height: 440px; } }
@media (min-width: 980px) { .calc2__canvas { padding: 56px 80px 80px; min-height: 640px; } }

/* graph-paper bg */
.calc2__canvas::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(26,77,143,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,77,143,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  pointer-events: none;
}

.calc2__stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 280px;
  max-width: 500px;
}
@media (min-width: 600px) { .calc2__stage { min-height: 360px; } }

.calc2__window {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 24px 36px rgba(14,28,51,.16));
  line-height: 0;
}
.calc2__svg { display: block; }
.calc2__svg svg { display: block; }

/* dimension labels */
.calc2__dim {
  position: absolute;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  padding: 4px 8px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(14,28,51,.08);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.calc2__dim input {
  width: 46px;
  border: 0;
  font: inherit;
  color: var(--blue);
  font-weight: 700;
  background: transparent;
  padding: 0;
  text-align: right;
}
.calc2__dim input:focus { outline: none; }
.calc2__dim small {
  font-family: "Manrope", sans-serif;
  color: var(--muted);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.calc2__dim--bottom {
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
}
.calc2__dim--right {
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 560px) { .calc2__dim--right { right: -8px; } }

.calc2__dim--bottom::before, .calc2__dim--bottom::after {
  content: "";
  position: absolute;
  bottom: 50%;
  width: 1px; height: 28px;
  background: var(--blue);
  opacity: .6;
}
.calc2__dim--bottom::before { left: -28px; }
.calc2__dim--bottom::after  { right: -28px; }

.calc2__dim--right::before, .calc2__dim--right::after {
  content: "";
  position: absolute;
  right: 50%;
  width: 28px; height: 1px;
  background: var(--blue);
  opacity: .6;
}
.calc2__dim--right::before { top: -28px; }
.calc2__dim--right::after  { bottom: -28px; }

/* type label on canvas */
.calc2__label {
  position: absolute;
  top: 16px; left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(26,77,143,.28);
  z-index: 3;
}
.calc2__label small {
  font-weight: 500;
  font-size: 10.5px;
  opacity: .8;
  padding-left: 7px;
  margin-left: 3px;
  border-left: 1px solid rgba(255,255,255,.35);
}

/* quantity stepper */
.calc2__qty {
  position: absolute;
  left: 16px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  z-index: 3;
}
.calc2__qty__stepper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.calc2__qty__stepper button {
  width: 30px; height: 30px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
}
.calc2__qty__stepper button:hover { background: var(--surface); color: var(--blue); }
.calc2__qty__stepper b {
  min-width: 28px;
  text-align: center;
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 4px;
}

/* scale chip */
.calc2__scale {
  position: absolute;
  right: 16px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
}
.calc2__scale__bar {
  width: 52px; height: 5px;
  border: 1.5px solid var(--muted);
  border-top: 0;
  position: relative;
}
.calc2__scale__bar::before, .calc2__scale__bar::after {
  content: "";
  position: absolute;
  top: 0;
  width: 1.5px; height: 5px;
  background: var(--muted);
}
.calc2__scale__bar::before { left: 0; }
.calc2__scale__bar::after  { right: 0; }

/* OPTIONS panel */
.calc2__opts {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 980px) {
  .calc2__opts {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 24px;
  }
}
@media (min-width: 1180px) { .calc2__opts { padding: 28px; } }
.calc2__opts h4 { font-family: "Sora", sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.calc2__opts > p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.calc2__list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.calc2-row {
  background: var(--surface);
  border: 1.5px solid var(--surface);
  border-radius: 11px;
  padding: 5px 5px 5px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .2s, background .2s;
}
.calc2-row:focus-within, .calc2-row:hover { border-color: var(--blue); background: #fff; }
.calc2-row > label {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  flex: 1;
  min-width: 0;
}
.calc2-row select {
  border: 0;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 26px 8px 10px;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%231a4d8f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  max-width: 180px;
}
@media (min-width: 1180px) { .calc2-row select { max-width: 200px; } }
.calc2-row select:focus { outline: none; }

/* addon chips */
.calc2__addons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.calc2__addon {
  background: var(--surface);
  border: 1.5px solid var(--surface);
  border-radius: 11px;
  padding: 9px 12px 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.calc2__addon > span:nth-child(2) { flex: 1; }
.calc2__addon__price { margin-left: auto; white-space: nowrap; }
.calc2__addon:hover { border-color: var(--blue); }
.calc2__check {
  width: 17px; height: 17px;
  border-radius: 4px;
  background: #fff;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  transition: all .2s;
  flex-shrink: 0;
}
.calc2__check svg { width: 10px; height: 10px; color: #fff; opacity: 0; transition: opacity .15s; }
.calc2__addon.on { background: rgba(26,77,143,.08); border-color: var(--blue); color: var(--ink); }
.calc2__addon.on .calc2__check { background: var(--blue); border-color: var(--blue); }
.calc2__addon.on .calc2__check svg { opacity: 1; }
.calc2__addon span.calc2__addon__price { font-weight: 700; color: var(--muted); font-size: 11px; }
.calc2__addon.on span.calc2__addon__price { color: var(--blue); }

/* SUMMARY bar */
.calc2__summary {
  grid-column: 1 / -1;
  background: var(--ink);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}
@media (min-width: 600px) {
  .calc2__summary {
    grid-template-columns: minmax(0, 1.1fr) auto auto;
    padding: 20px 28px;
    gap: 24px;
  }
}
.calc2__summary__cfg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc2__summary__cfg small {
  color: #7fa8da;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.calc2__summary__cfg b {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calc2__breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
@media (min-width: 600px) { .calc2__breakdown { gap: 22px; } }
.calc2__breakdown__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calc2__breakdown__item small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7fa8da;
}
.calc2__breakdown__item b { font-family: "Sora", sans-serif; font-weight: 600; font-size: 13px; color: #fff; }

.calc2__summary__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
@media (min-width: 600px) { .calc2__summary__right { flex-direction: row; } }
.calc2__summary__price {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -.02em;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  white-space: nowrap;
}
.calc2__summary__price big { display: inline-flex; align-items: baseline; gap: 4px; }
.calc2__summary__price big::after {
  content: "₴";
  font-size: .52em;
  color: #7fa8da;
  font-weight: 700;
}
.calc2__summary__price small {
  font-size: 10.5px;
  color: #7fa8da;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: .04em;
}
.calc2__summary__actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .calc2__summary__actions { width: 100%; }
  .calc2__summary__actions .btn { flex: 1; }
}
