/* Matove – wycena druku 3D online. Wszystko pod .mw, żeby nie ruszać motywu. */
.mw {
  --mw-ink: #2b2a26;
  --mw-muted: #6c675d;
  --mw-olive: #5c6338;
  --mw-olive-dark: #464c29;
  --mw-olive-soft: #e7e8dc;
  --mw-sand: #f3eee5;
  --mw-plate: #ece6db;
  --mw-line: #ddd4c4;
  --mw-white: #fffdf9;
  --mw-error: #a33a2a;
  --mw-error-bg: #f8e9e5;
  --mw-warn: #7a5a14;
  --mw-warn-bg: #f7efd9;
  --mw-radius: 6px;

  color: var(--mw-ink);
  line-height: 1.55;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.mw *, .mw *::before, .mw *::after { box-sizing: border-box; }
.mw [hidden] { display: none !important; }
.mw p { margin: 0 0 .8em; }
.mw a { color: var(--mw-olive); }

.mw .mw-intro { max-width: 46rem; margin: .5rem 0 1.5rem; }
.mw .mw-eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mw-olive); font-weight: 600; margin-bottom: .6rem; }
.mw .mw-h1 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); line-height: 1.12; font-weight: 600; margin: 0 0 .5em; text-transform: none; color: var(--mw-ink); }
.mw .mw-h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .4em; text-transform: none; color: var(--mw-ink); }
.mw .mw-lead { color: var(--mw-muted); font-size: 1.08rem; }

/* Układ */
.mw .mw-app {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1.5rem;
  min-width: 0;
  align-items: start;
}
.mw .mw-stage { position: sticky; top: 1rem; }

/* Strefa upuszczania */
.mw .mw-drop {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--mw-sand);
  border: 2px dashed var(--mw-line);
  border-radius: var(--mw-radius);
  padding: 2rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.mw .mw-drop.is-over { border-color: var(--mw-olive); background: var(--mw-olive-soft); }
.mw .mw-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mw .mw-drop__icon { width: 56px; height: 56px; color: var(--mw-olive); margin-bottom: .75rem; }
.mw .mw-drop__title { font-size: 1.3rem; font-weight: 600; margin: 0; }
.mw .mw-drop__or { color: var(--mw-muted); margin: .4rem 0 .8rem; }
.mw .mw-drop__hint { color: var(--mw-muted); font-size: .9rem; margin: 1rem 0 0; }

/* Podgląd 3D */
.mw .mw-viewer {
  position: relative;
  height: min(62vh, 560px);
  min-height: 360px;
  background: linear-gradient(180deg, #faf7f1 0%, var(--mw-sand) 100%);
  border-radius: var(--mw-radius);
  overflow: hidden;
}
.mw .mw-canvas, .mw .mw-canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.mw .mw-viewer__top, .mw .mw-viewer__bottom {
  position: absolute;
  left: .75rem;
  right: .75rem;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  pointer-events: none;
}
.mw .mw-viewer__top { top: .75rem; }
.mw .mw-viewer__bottom { bottom: .75rem; }
.mw .mw-chip {
  pointer-events: auto;
  background: rgba(255, 253, 249, .92);
  border: 1px solid var(--mw-line);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .85rem;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw .mw-chip:empty { display: none; }
.mw .mw-chip--button { cursor: pointer; font: inherit; font-size: .85rem; color: var(--mw-ink); }
.mw .mw-chip--button:hover { border-color: var(--mw-olive); }
.mw .mw-progress {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(243, 238, 229, .82);
  gap: .75rem;
}
.mw .mw-progress__bar { width: min(320px, 70%); height: 6px; background: var(--mw-line); border-radius: 3px; overflow: hidden; }
.mw .mw-progress__bar span { display: block; height: 100%; width: 0; background: var(--mw-olive); transition: width .2s ease; }
.mw .mw-nopreview { position: absolute; left: 1rem; right: 1rem; top: 45%; text-align: center; color: var(--mw-muted); }

/* Panel opcji */
.mw .mw-panel { background: var(--mw-white); border: 1px solid var(--mw-line); border-radius: var(--mw-radius); }
.mw .mw-form { padding: 1.25rem 1.25rem .25rem; }
.mw .mw-field { border: 0; margin: 0 0 1.1rem; padding: 0; min-width: 0; }
.mw .mw-label { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .95rem; margin-bottom: .5rem; padding: 0; width: auto; float: none; }
.mw .mw-label__value { font-weight: 400; color: var(--mw-muted); }
.mw .mw-help { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--mw-line); font-size: .72rem; align-items: center; justify-content: center; color: var(--mw-muted); cursor: help; }
.mw .mw-row { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }

.mw .mw-materials { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.mw .mw-card { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: .7rem .8rem; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); cursor: pointer; background: #fff; }
.mw .mw-card input { position: absolute; opacity: 0; }
.mw .mw-card__title { font-weight: 600; }
.mw .mw-card__desc { font-size: .8rem; color: var(--mw-muted); line-height: 1.35; }
.mw .mw-card:has(input:checked) { border-color: var(--mw-olive); box-shadow: inset 0 0 0 1px var(--mw-olive); background: var(--mw-olive-soft); }
.mw .mw-card:has(input:focus-visible) { outline: 2px solid var(--mw-olive); outline-offset: 2px; }

.mw .mw-swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.mw .mw-swatch { position: relative; cursor: pointer; }
.mw .mw-swatch input { position: absolute; opacity: 0; }
.mw .mw-swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); box-shadow: inset 0 0 0 2px #fff; }
.mw .mw-swatch input:checked + span { outline: 2px solid var(--mw-olive); outline-offset: 2px; }
.mw .mw-swatch input:focus-visible + span { outline: 2px dashed var(--mw-olive); outline-offset: 2px; }

.mw .mw-segments { display: flex; flex-wrap: wrap; gap: .35rem; }
.mw .mw-seg { position: relative; margin: 0; cursor: pointer; }
.mw .mw-seg input { position: absolute; opacity: 0; }
.mw .mw-seg span { display: block; padding: .42rem .75rem; font-size: .88rem; white-space: nowrap; background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); transition: border-color .12s ease; }
.mw .mw-seg:hover span { border-color: var(--mw-olive); }
.mw .mw-seg input:checked + span { background: var(--mw-olive); border-color: var(--mw-olive); color: #fff; }
.mw .mw-seg input:focus-visible + span { outline: 2px solid var(--mw-olive); outline-offset: 2px; }

.mw .mw-size summary { cursor: pointer; list-style: none; }
.mw .mw-size summary::-webkit-details-marker { display: none; }
.mw .mw-size summary::after { content: "▾"; margin-left: auto; color: var(--mw-muted); }
.mw .mw-size[open] summary::after { content: "▴"; }
.mw .mw-size__body { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.mw .mw-inline { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin: 0; }
.mw .mw-inline input { width: 5.5rem; padding: .4rem .5rem; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); }
.mw .mw-small { font-size: .82rem; color: var(--mw-muted); margin: 0; }

.mw .mw-qty { display: inline-flex; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); overflow: hidden; background: #fff; }
.mw .mw-qty__btn { width: 42px; border: 0; background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--mw-ink); }
.mw .mw-qty__btn:hover { background: var(--mw-sand); }
.mw .mw-qty input { width: 4.5rem; text-align: center; border: 0; border-left: 1px solid var(--mw-line); border-right: 1px solid var(--mw-line); padding: .45rem; font-size: 1rem; -moz-appearance: textfield; }
.mw .mw-qty input::-webkit-outer-spin-button, .mw .mw-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mw .mw-tiers { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 0; }
.mw .mw-tiers span { font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; background: var(--mw-sand); color: var(--mw-muted); }
.mw .mw-tiers span.is-active { background: var(--mw-olive); color: #fff; }

/* Cena */
.mw .mw-summary { border-top: 1px solid var(--mw-line); padding: 1.1rem 1.25rem 1.25rem; background: var(--mw-sand); border-radius: 0 0 var(--mw-radius) var(--mw-radius); }
.mw .mw-summary__empty { color: var(--mw-muted); }
.mw .mw-price-line { display: flex; align-items: baseline; gap: .4rem; }
.mw .mw-price { font-size: 2.1rem; line-height: 1.1; font-weight: 700; color: var(--mw-ink); }
.mw .mw-price-per { color: var(--mw-muted); }
.mw .mw-total { margin: .2rem 0 .6rem; font-weight: 600; }
.mw .mw-total:empty { display: none; }
.mw .mw-spinner { width: 16px; height: 16px; border: 2px solid var(--mw-line); border-top-color: var(--mw-olive); border-radius: 50%; animation: mw-spin .7s linear infinite; align-self: center; }
@keyframes mw-spin { to { transform: rotate(360deg); } }
.mw .mw-facts { list-style: none; margin: .6rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.mw .mw-facts li { display: flex; flex-direction: column; font-size: .85rem; }
.mw .mw-facts span { color: var(--mw-muted); }
.mw .mw-breakdown { margin: .4rem 0 .6rem; font-size: .88rem; }
.mw .mw-breakdown summary { cursor: pointer; color: var(--mw-olive); }
.mw .mw-breakdown dl { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; margin: .6rem 0 0; }
.mw .mw-breakdown dt { font-weight: 400; color: var(--mw-muted); }
.mw .mw-breakdown dd { margin: 0; text-align: right; }
.mw .mw-messages { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.mw .mw-messages li { padding: .5rem .7rem; border-radius: var(--mw-radius); font-size: .88rem; }
.mw .mw-messages .is-error { background: var(--mw-error-bg); color: var(--mw-error); }
.mw .mw-messages .is-warning { background: var(--mw-warn-bg); color: var(--mw-warn); }
.mw .mw-terms { display: flex; gap: .55rem; align-items: flex-start; font-size: .82rem; color: var(--mw-muted); margin: .4rem 0 .9rem; cursor: pointer; }
.mw .mw-terms input { margin-top: .2rem; accent-color: var(--mw-olive); width: 16px; height: 16px; flex: 0 0 auto; }
.mw .mw-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.mw .mw-buttons .mw-btn { flex: 1 1 10rem; }
.mw .mw-minibar { display: none; }
.mw .mw-added__title { font-weight: 700; font-size: 1.15rem; color: var(--mw-olive); margin-bottom: .3rem; }

.mw .mw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .7rem 1.3rem;
  border-radius: var(--mw-radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.mw .mw-btn--primary { background: var(--mw-olive); color: #fff; }
.mw .mw-btn--primary:hover { background: var(--mw-olive-dark); color: #fff; }
.mw .mw-btn--ghost { background: transparent; color: var(--mw-ink); border-color: var(--mw-ink); }
.mw .mw-btn--ghost:hover { background: var(--mw-ink); color: var(--mw-sand); }
.mw .mw-btn:disabled { opacity: .45; cursor: not-allowed; }
.mw .mw-btn:focus-visible { outline: 2px solid var(--mw-olive); outline-offset: 3px; }

.mw .mw-alert { padding: .8rem 1rem; border-radius: var(--mw-radius); margin-top: .75rem; }
.mw .mw-alert--error { background: var(--mw-error-bg); color: var(--mw-error); }

.mw .mw-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--mw-line); }
.mw .mw-notes p { color: var(--mw-muted); font-size: .95rem; }

@media (max-width: 991px) {
  .mw .mw-app { grid-template-columns: minmax(0, 1fr); }
  .mw .mw-stage { position: static; }
  .mw .mw-drop { min-height: 300px; }
  .mw .mw-viewer { height: 360px; min-height: 300px; }
  .mw .mw-minibar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom));
    background: var(--mw-white);
    border-top: 1px solid var(--mw-line);
    box-shadow: 0 -6px 18px rgba(43, 42, 38, .08);
  }
  .mw .mw-minibar__price strong { font-size: 1.3rem; }
  .mw .mw-minibar__price span { color: var(--mw-muted); font-size: .9rem; }
  .mw .mw-minibar .mw-btn { min-height: 44px; padding: .5rem 1.1rem; }
  .mw .mw-notes { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .mw .mw-facts { grid-template-columns: 1fr 1fr 1fr; }
  .mw .mw-price { font-size: 1.8rem; }
}
