:root {
  color-scheme: light;
  --navy: #052d55;
  --navy-2: #0b426f;
  --blue: #0d67aa;
  --red: #df3138;
  --ink: #15263a;
  --muted: #637487;
  --line: #d9e2ea;
  --paper: #ffffff;
  --soft: #f2f6f9;
  --good: #0c8a59;
  --shadow: 0 18px 52px rgba(5, 45, 85, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 5%, rgba(13,103,170,.14), transparent 28rem),
    linear-gradient(180deg, #f8fbfd 0%, #edf3f7 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }
button { cursor: pointer; }
img, canvas { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.16);
  background: rgba(5,45,85,.96);
  color: #fff;
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  position: relative;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,.18);
}
.brand-logo img {
  position: absolute;
  width: 349px;
  max-width: none;
  height: auto;
  left: -41px;
  top: -7px;
}
.brand strong { display: block; font-size: 1rem; letter-spacing: .045em; }
.brand small { display: block; color: #c7d9e8; font-size: .78rem; }

.lang-switch { display: flex; gap: 5px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.1); }
.lang-switch button {
  min-width: 47px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d8e7f2;
  font-weight: 800;
}
.lang-switch button.active { background: #fff; color: var(--navy); }

main {
  width: min(1240px, calc(100% - 32px));
  margin: 34px auto 64px;
}

.intro {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 25px;
}
.intro > div:first-child { max-width: 790px; }
.eyebrow { margin: 0 0 7px; color: var(--red); font-weight: 850; letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; }
h1 { margin: 0; color: var(--navy); font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.04; letter-spacing: -.045em; }
.lead { margin: 14px 0 0; max-width: 730px; color: var(--muted); font-size: 1.05rem; }

.country-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: min(100%, 320px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.85);
}
.country-switch button {
  min-height: 47px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.country-switch button.active { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(5,45,85,.18); }

.panel {
  border: 1px solid rgba(11,66,111,.12);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}

.product-panel { padding: clamp(18px, 3vw, 28px); margin-bottom: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 1.35rem; letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.section-heading.compact { margin-bottom: 14px; }
.step {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: .88rem;
  font-weight: 900;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.model-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 16px rgba(18,50,78,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.model-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18,50,78,.14); }
.model-card.active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(223,49,56,.12); }
.model-card.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}
.model-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #e9eef2; }
.model-card-copy { display: grid; gap: 3px; min-height: 78px; padding: 10px 11px 12px; }
.model-card-copy strong { font-size: .87rem; line-height: 1.25; }
.model-card-copy span { color: var(--navy-2); font-size: .79rem; font-weight: 850; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(330px, .82fr); gap: 24px; align-items: start; }
.configurator { padding: clamp(18px, 3vw, 28px); }
.preview-badge { padding: 6px 10px; border-radius: 999px; background: #e9f4fb; color: var(--blue); font-size: .78rem; font-weight: 850; }
.preview-stage {
  position: relative;
  overflow: hidden;
  min-height: 410px;
  border-radius: 18px;
  background: #e6ecf0;
}
#productCanvas { width: 100%; height: 410px; display: block; object-fit: cover; }
.preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, #e7edf1, #f8fafb, #e7edf1);
  background-size: 200% 100%;
  color: var(--muted);
  animation: loading 1.5s linear infinite;
}
.preview-loading.hidden { display: none; }
@keyframes loading { to { background-position: -200% 0; } }
.preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 42px 18px 17px;
  background: linear-gradient(transparent, rgba(3,24,43,.87));
  color: #fff;
}
.preview-caption strong, .preview-caption span { display: block; }
.preview-caption strong { font-size: 1.12rem; }
.preview-caption > div span { color: #d4e0e8; font-size: .84rem; }
.price-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #fff; color: var(--navy); font-size: .84rem; font-weight: 900; }

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}
.color-choice {
  display: grid;
  grid-template-columns: 31px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.color-choice.active { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(5,45,85,.12); }
.swatch { width: 31px; height: 31px; border: 1px solid rgba(0,0,0,.2); border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); }
.color-choice strong { display: block; overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.color-choice small { display: block; color: var(--muted); font-size: .65rem; line-height: 1.2; }
.color-note { margin: 11px 0 0; color: var(--muted); font-size: .79rem; }

.technical-details { display: none; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.technical-details.visible { display: block; }
.technical-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; color: var(--navy); cursor: pointer; font-weight: 850; }
.technical-details summary::-webkit-details-marker { display: none; }
.technical-details summary::after { content: "＋"; margin-left: auto; }
.technical-details[open] summary::after { content: "−"; }
.technical-details summary b { color: var(--muted); font-size: .77rem; }
.technical-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 0 13px 13px; }
.technical-thumb { overflow: hidden; padding: 0; border: 1px solid #cad5df; border-radius: 10px; background: #fff; }
.technical-thumb img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }

.measure-block { margin-top: 24px; padding-top: 23px; border-top: 1px solid var(--line); }
.measure-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { color: #405367; font-size: .86rem; font-weight: 780; }
.measure-fields label, .location { display: grid; gap: 6px; }
input[type="number"], input[type="text"] {
  width: 100%;
  min-height: 49px;
  border: 1px solid #c8d4de;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13,103,170,.12); }
.measure-result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.measure-result > div { padding: 13px 14px; border-radius: 12px; background: var(--soft); }
.measure-result span, .measure-result strong { display: block; }
.measure-result span { color: var(--muted); font-size: .77rem; }
.measure-result strong { margin-top: 2px; color: var(--navy); font-size: 1.08rem; }
.add-estimate {
  width: 100%;
  min-height: 52px;
  margin-top: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}
.add-estimate:hover { background: var(--navy-2); }

.summary { position: sticky; top: 96px; overflow: hidden; }
.summary-top { padding: 23px 23px 19px; background: linear-gradient(145deg, var(--navy), #0b4a7c); color: #fff; }
.summary-top p { margin: 0; color: #cfe0ed; font-size: .84rem; }
.summary-top h2 { margin: 3px 0 0; color: #fff; font-size: 1.38rem; }
.total { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 17px; }
.total span { color: #d4e2ed; font-size: .86rem; }
.total strong { font-size: clamp(2rem, 5vw, 2.65rem); line-height: 1; letter-spacing: -.05em; }
.summary-body { padding: 19px 22px 23px; }
.summary-lines { display: grid; gap: 10px; }
.summary-empty { margin: 0; padding: 14px; border: 1px dashed #bac9d5; border-radius: 11px; color: var(--muted); font-size: .87rem; text-align: center; }
.summary-line { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 11px; padding: 0 28px 11px 0; border-bottom: 1px solid #e5ebf0; }
.summary-line span { color: #42566c; font-size: .84rem; }
.summary-line span small { display: block; margin-top: 3px; color: #718294; }
.summary-line b { color: var(--navy); white-space: nowrap; font-size: .88rem; }
.remove-line { position: absolute; top: -4px; right: -5px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: #fff0f1; color: #a91f27; font-weight: 900; }

.extras { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.extras h3 { margin: 0 0 10px; color: var(--navy); font-size: .98rem; }
.extra { display: flex; align-items: center; gap: 10px; min-height: 45px; cursor: pointer; }
.extra input { width: 19px; height: 19px; accent-color: var(--navy); }
.extra > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 10px; }
.extra b { color: var(--ink); font-size: .82rem; }
.extra em { color: var(--navy); font-size: .81rem; font-style: normal; font-weight: 900; }
.location { margin-top: 15px; }
.notice { margin: 17px 0; padding: 12px 13px; border-left: 4px solid var(--red); border-radius: 9px; background: #fff3f3; color: #6d3538; font-size: .8rem; }
.primary, .secondary { width: 100%; min-height: 51px; border-radius: 12px; font-weight: 900; }
.primary { border: 0; background: #19985a; color: #fff; box-shadow: 0 10px 24px rgba(25,152,90,.2); }
.primary:hover { background: #12804a; }
.secondary { margin-top: 9px; border: 1px solid #b9c8d4; background: #fff; color: var(--navy); }
.copied { min-height: 18px; margin: 8px 0 0; color: var(--good); text-align: center; font-size: .81rem; font-weight: 850; }

footer { width: min(1240px, calc(100% - 32px)); margin: 0 auto 30px; color: #6b7c8d; text-align: center; font-size: .82rem; }

dialog { max-width: min(94vw, 1050px); max-height: 90vh; padding: 0; border: 0; border-radius: 16px; background: #071725; box-shadow: 0 25px 80px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(2,15,27,.78); backdrop-filter: blur(3px); }
dialog img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; }
.dialog-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(5,45,85,.9); color: #fff; font-size: 1.5rem; }

@media (max-width: 1120px) {
  .model-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .color-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .work-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .model-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar-inner, main, footer { width: min(100% - 22px, 1240px); }
  .topbar-inner { min-height: 66px; }
  .brand small { display: none; }
  main { margin-top: 24px; }
  .country-switch { width: 100%; }
  .panel { border-radius: 17px; }
  .product-panel, .configurator { padding: 14px; }
  .section-heading { align-items: flex-start; }
  .section-heading > p { display: none; }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .model-card-copy { min-height: 76px; padding: 9px; }
  .preview-stage { min-height: 300px; }
  #productCanvas { height: 300px; }
  .preview-caption { padding: 38px 13px 13px; }
  .preview-caption strong { font-size: .98rem; }
  .price-badge { font-size: .75rem; }
  .color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .color-choice { grid-template-columns: 27px 1fr; min-height: 54px; padding: 6px; }
  .swatch { width: 27px; height: 27px; }
  .technical-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-top, .summary-body { padding-left: 17px; padding-right: 17px; }
}
