/* =====================================================================
   Lexikon parapety · Konfigurátor parapetu LUX
   Vizuální jazyk: technický výkres potkává moderní produktovou aplikaci.
   ===================================================================== */

:root {
  --blue: #005ca8;
  --blue-2: #1b74c9;
  --blue-deep: #003f75;
  --ink: #0d2238;
  --ink-2: #2b4157;
  --muted: #62778c;
  --line: #d9e2ec;
  --line-2: #edf2f7;
  --paper: #f2f5f8;
  --card: #ffffff;
  --sky: #e5f0fb;
  --sky-2: #f3f8fe;
  --green: #2f9e44;
  --green-bg: #e8f6ec;
  --red: #d64541;
  --red-bg: #fdecea;
  --wood: #b8956a;
  --wood-2: #8f7048;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-card: 0 1px 2px rgba(13, 34, 56, .05), 0 18px 40px -20px rgba(13, 34, 56, .22);
  --shadow-pop: 0 24px 60px -18px rgba(13, 34, 56, .35), 0 2px 6px rgba(13, 34, 56, .08);

  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* jemný rastr technického výkresu na pozadí */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at -10% -20%, rgba(0, 92, 168, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(184, 149, 106, .12), transparent 60%),
    linear-gradient(rgba(0, 92, 168, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 92, 168, .06) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ----------------------------------------------------------------------
   Topbar
   ---------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  padding: 0 clamp(16px, 3vw, 40px);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(217, 226, 236, .9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand img { display: block; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 92, 168, .25); }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
  line-height: 1;
}
.brand-text b { display: block; font-weight: 500; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-top: 3px; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs span { opacity: .5; }
.crumbs strong { color: var(--ink); font-weight: 600; }

.cart-wrap { margin-left: auto; position: relative; }
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-spring);
}
.cart-btn:hover { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 92, 168, .08); }
.cart-btn.is-bump { animation: bump .5s var(--ease-spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

.cart-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: transform .4s var(--ease-spring), background .2s;
}
.cart-badge.is-zero { background: var(--line); color: var(--muted); }
.cart-badge.is-bump { animation: badgePop .55s var(--ease-spring); }
@keyframes badgePop { 0% { transform: scale(1); } 50% { transform: scale(1.5); } 100% { transform: scale(1); } }

.cart-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 8px;
  transform-origin: top right;
  animation: popIn .25s var(--ease-out);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.cart-pop-head { padding: 10px 12px 6px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.cart-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.cart-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); }
.cart-item:hover { background: var(--sky-2); }
.cart-item-sw { width: 34px; height: 24px; border-radius: 6px; border: 1px solid rgba(13, 34, 56, .12); }
.cart-item-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.cart-item-meta { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.cart-item-price { font-family: var(--font-mono); font-weight: 700; font-size: 14px; white-space: nowrap; }
.cart-empty { padding: 10px 12px 16px; color: var(--muted); font-size: 14px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 12px 10px; border-top: 1px dashed var(--line); margin-top: 6px; font-size: 14px; color: var(--muted); }
.cart-total b { font-family: var(--font-mono); font-size: 17px; color: var(--ink); }

/* ----------------------------------------------------------------------
   Layout
   ---------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 26px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 40px) 80px;
}

/* ----------------------------------------------------------------------
   Stage (náhled)
   ---------------------------------------------------------------------- */
.stage {
  position: sticky;
  top: 94px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: rise .7s var(--ease-out) both;
}

.stage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 0;
}
.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
}
.stage-title h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.stage-title h1 em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -.02em;
  display: inline-block;
  animation: fadeSwap .4s var(--ease-out);
}
@keyframes fadeSwap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  flex-shrink: 0;
}
.tab {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  transition: color .25s;
}
.tab.is-active { color: var(--blue-deep); }
.tab:hover:not(.is-active) { color: var(--ink); }
.tab-glider {
  position: absolute;
  top: 4px;
  left: 0;
  height: 34px;
  width: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 34, 56, .12), 0 4px 12px -4px rgba(13, 34, 56, .2);
  transition: transform .45s var(--ease-spring), width .45s var(--ease-spring);
}

.canvas {
  position: relative;
  aspect-ratio: 5 / 3;
  margin: 14px 18px 0;
  border-radius: var(--r-lg);
  background:
    radial-gradient(60% 55% at 50% 60%, rgba(0, 92, 168, .06), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(13, 34, 56, .12) 1px, transparent 1.5px) 0 0 / 22px 22px,
    linear-gradient(180deg, #fbfcfe, #f4f7fa);
  overflow: hidden;
  isolation: isolate;
}
.view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
  pointer-events: none;
}
.view.is-active { opacity: 1; transform: none; pointer-events: auto; }
.view-block svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* text v SVG */
.dim-text { font-family: var(--font-mono); font-size: 15px; font-weight: 700; fill: var(--ink); }
.dim-text.blue { fill: var(--blue); }
.dim-text.muted { fill: var(--muted); font-weight: 500; }
.svg-label { font-family: var(--font-body); font-size: 14px; font-weight: 600; fill: var(--ink-2); }
.svg-label.muted { fill: var(--muted); font-weight: 500; }
.svg-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; fill: var(--blue); }
.dim-pill { fill: #fff; stroke: var(--line); }

/* kompaktní plátno (mobil): menší viewBox, větší písmo, čtverec */
.canvas.is-compact { aspect-ratio: 13 / 10; }
.canvas.is-compact .dim-text { font-size: 18px; }
.canvas.is-compact .svg-label { font-size: 16px; }
.canvas.is-compact .svg-title { font-size: 21px; }

/* nástroje pod plátnem, zobrazí se jen u příslušného pohledu */
.canvas-tools { padding: 0 18px; }
.canvas-tools:empty { display: none; }
.measure-form, .caps-note { display: none; }
.stage[data-view="measure"] .measure-form { display: flex; }
.stage[data-view="caps"] .caps-note { display: block; }

.measure-form {
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--sky-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  animation: rise .4s var(--ease-out);
}
.measure-form label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.measure-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.measure-note { width: 100%; margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.measure-note.ok { color: var(--green); }
.measure-note.warn { color: var(--red); }

.caps-note {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--sky-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
  animation: rise .4s var(--ease-out);
}
.caps-note b { color: var(--blue); }

.readout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 18px 18px;
}
.ro {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ro span { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ro b { font-family: var(--font-mono); font-size: 15.5px; font-weight: 700; color: var(--ink); }

/* ----------------------------------------------------------------------
   Panel (konfigurace)
   ---------------------------------------------------------------------- */
.panel { display: flex; flex-direction: column; gap: 14px; }

.stock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--green-bg);
  color: #1f6b30;
  font-size: 14px;
  animation: rise .7s var(--ease-out) both;
}
.stock b { color: var(--green); }
.stock-sep { opacity: .5; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47, 158, 68, .5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 158, 68, .45); } 70% { box-shadow: 0 0 0 9px rgba(47, 158, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0); } }

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-card);
  animation: rise .7s var(--ease-out) both;
}
.step:nth-of-type(1) { animation-delay: .06s; }
.step:nth-of-type(2) { animation-delay: .12s; }
.step:nth-of-type(3) { animation-delay: .18s; }
.step:nth-of-type(4) { animation-delay: .24s; }
.summary { animation: rise .7s var(--ease-out) .3s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-no {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: var(--sky);
  padding: 3px 8px;
  border-radius: 6px;
}
.step-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.step-val { margin-left: auto; font-size: 13.5px; color: var(--muted); font-weight: 500; }

/* dekory */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease-spring);
  text-align: left;
}
.swatch:hover { transform: translateY(-2px); border-color: #b9c9da; }
.swatch.is-active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 92, 168, .15); }
.swatch-chip {
  height: 46px;
  border-radius: 9px;
  border: 1px solid rgba(13, 34, 56, .1);
  box-shadow: inset 0 -6px 0 rgba(13, 34, 56, .08);
}
.swatch-name { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0 2px 2px; line-height: 1.2; }
.swatch.is-active .swatch-name { color: var(--blue-deep); }
.swatch-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform .3s var(--ease-spring);
}
.swatch.is-active .swatch-check { transform: scale(1); }

/* pole s posuvníkem */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field-head label { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 12px 0 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.num:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 92, 168, .14); }
.num input {
  width: 84px;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  -moz-appearance: textfield;
}
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num span { font-size: 13px; color: var(--muted); font-weight: 600; }
.num.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(214, 69, 65, .14); }

.range {
  --p: 50%;
  width: 100%;
  height: 28px;
  margin: 2px 0 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) var(--p), var(--line) var(--p));
}
.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--blue); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--blue);
  box-shadow: 0 2px 8px rgba(0, 92, 168, .3);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2.5px solid var(--blue);
  box-shadow: 0 2px 8px rgba(0, 92, 168, .3);
}
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(0, 92, 168, .12), 0 2px 8px rgba(0, 92, 168, .3); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(0, 92, 168, .2); }

.ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: -2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all .2s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.hint b { color: var(--ink-2); }
.link { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0, 92, 168, .35); }
.link:hover { text-decoration-color: var(--blue); }

/* segmentový přepínač */
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border-radius: var(--r-md);
}
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all .25s var(--ease-out);
}
.seg-opt:hover span { color: var(--ink); }
.seg-opt:has(input:checked) span { background: #fff; color: var(--blue-deep); box-shadow: 0 1px 3px rgba(13, 34, 56, .12), 0 4px 10px -4px rgba(13, 34, 56, .18); }
.seg-opt:has(input:focus-visible) span { outline: 2px solid var(--blue); outline-offset: 1px; }

/* souhrn */
.summary {
  background: linear-gradient(160deg, #ffffff, #f6f9fd);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-card);
}
.sum-rows { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.sum-row em { font-style: normal; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.sum-row b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-size: 14px; }
.sum-row[hidden] { display: none; }

.sum-total { display: flex; justify-content: space-between; align-items: flex-end; padding: 16px 0 6px; }
.sum-label { display: block; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.sum-vat { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.sum-vat span { font-family: var(--font-mono); }
.sum-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sum-cur { font-size: 18px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sum-price.is-tick { animation: tick .35s var(--ease-out); }
@keyframes tick { 0% { color: var(--blue); } 100% { color: var(--ink); } }

.cta-row { display: flex; gap: 10px; margin-top: 12px; }
.qty { display: inline-flex; align-items: stretch; height: 52px; border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; flex-shrink: 0; }
.qty-btn { width: 42px; border: 0; background: var(--paper); font-size: 18px; font-weight: 600; color: var(--ink-2); transition: background .15s; }
.qty-btn:hover { background: var(--sky); color: var(--blue); }
.qty input { width: 48px; border: 0; outline: 0; text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-cart {
  position: relative;
  flex: 1;
  height: 52px;
  border: 0;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 10px 22px -8px rgba(0, 92, 168, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
  overflow: hidden;
  transition: transform .2s var(--ease-spring), box-shadow .2s, background .3s;
}
.btn-cart:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -8px rgba(0, 92, 168, .65), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-cart:active { transform: translateY(0) scale(.99); }
.btn-cart-inner, .btn-cart-done { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .4s var(--ease-spring), opacity .3s; }
.btn-cart-done { transform: translateY(110%); opacity: 0; }
.btn-cart.is-done { background: linear-gradient(180deg, #3aae51, var(--green)); box-shadow: 0 10px 22px -8px rgba(47, 158, 68, .6); }
.btn-cart.is-done .btn-cart-inner { transform: translateY(-110%); opacity: 0; }
.btn-cart.is-done .btn-cart-done { transform: none; opacity: 1; }

.trust { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust span:first-child { color: var(--ink-2); font-weight: 600; }

.btn-ghost {
  height: 42px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--blue);
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  font-size: 13.5px;
  transition: background .2s, color .2s;
}
.btn-ghost:hover { background: var(--blue); color: #fff; }

/* pevná spodní lišta (jen mobil) */
.mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -18px rgba(13, 34, 56, .35);
  transform: translateY(0);
  transition: transform .35s var(--ease-out), opacity .25s;
}
.mobile-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.mobile-bar-price { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mobile-bar-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar-label span { font-family: var(--font-mono); }
.mobile-bar-price b { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.btn-cart-sm { flex: 0 0 auto; width: 150px; height: 48px; font-size: 15px; }

/* letící parapet do košíku */
.fly {
  position: fixed;
  z-index: 100;
  width: 46px;
  height: 14px;
  border-radius: 3px 3px 2px 2px;
  box-shadow: 0 6px 14px -4px rgba(13, 34, 56, .5);
  pointer-events: none;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  transition: transform .4s var(--ease-spring), opacity .3s;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast b { color: #8fc6ff; }

/* ----------------------------------------------------------------------
   Responsivita
   ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; }
  .crumbs { display: none; }
}
@media (max-width: 900px) {
  body { padding-bottom: 96px; }
  .app { grid-template-columns: 1fr; padding: 14px 12px 40px; gap: 14px; }
  .stage { position: relative; top: auto; border-radius: var(--r-lg); }
  .stage-head { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 16px 0; }
  .tabs { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .tab { padding: 0; }
  .canvas { margin: 12px 12px 0; }
  .canvas-tools { padding: 0 12px; }
  .readout { grid-template-columns: repeat(2, 1fr); padding: 12px 12px 14px; }
  .mobile-bar { display: flex; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .step, .summary { padding: 16px 16px 18px; }
  .chip { height: 34px; padding: 0 13px; }
  .range { height: 34px; }
  .swatch-chip { height: 40px; }
}
@media (max-width: 520px) {
  .topbar { gap: 12px; height: 60px; padding: 0 12px; }
  .brand-text { display: none; }
  .cart-label { display: none; }
  .cart-btn { padding: 0 10px; }
  .stage-title h1 { font-size: 28px; }
  .swatches { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .swatch { padding: 5px; }
  .swatch-name { font-size: 11px; }
  .seg-opt span { font-size: 12.5px; }
  .sum-price { font-size: 34px; }
  .cta-row { flex-direction: column; }
  .qty { width: 100%; }
  .qty input { flex: 1; }
  .tab { font-size: 13px; }
  .field-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .num { justify-content: flex-end; }
  .num input { width: 100px; }
  .btn-cart-sm { width: 136px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
