/* Widget wyceny — wygląd sterowany zmiennymi, strona ustawia je na .q-root lub :root */
.q-root {
  --q-accent: #2563eb;
  --q-accent-ink: #fff;
  --q-bg: #f6f7f9;
  --q-surface: #fff;
  --q-text: #15171c;
  --q-muted: #6b7280;
  --q-border: #e3e5ea;
  --q-radius: 14px;
  --q-bed: #2a2d34;
  --q-stage: #1b1d22;
  --q-ok: #16a34a;
  --q-warn: #dc2626;
  --q-border-width: 1px;
  --q-shadow: none;
  --q-sticky-top: 16px;
  color: var(--q-text);
  font: inherit;
}
.q-root *, .q-root *::before, .q-root *::after { box-sizing: border-box; }
.q-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .q-grid { grid-template-columns: 1fr; } }
.q-main { display: grid; gap: 14px; min-width: 0; }
.q-side { display: grid; gap: 14px; position: sticky; top: var(--q-sticky-top); }
@media (max-width: 900px) { .q-side { position: static; } }
.q-card { box-shadow: var(--q-shadow); background: var(--q-surface); border: var(--q-border-width) solid var(--q-border); border-radius: var(--q-radius); padding: 18px; }
.q-muted { color: var(--q-muted); }

.q-drop {
  display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer;
  padding: 34px 18px; border: 2px dashed var(--q-border); border-radius: var(--q-radius);
  background: var(--q-surface); transition: border-color .15s, background .15s, transform .15s;
}
.q-drop:hover, .q-drop:focus-visible, .q-drop.is-over { border-color: var(--q-accent); outline: none; }
.q-drop.is-over { transform: scale(1.01); }
.q-drop-icon { color: var(--q-accent); margin-bottom: 4px; }
.q-drop strong { font-size: 1.1em; }
.q-drop .q-muted { font-size: .88em; }

.q-empty-info { font-size: .92em; line-height: 1.55; }
.q-empty-info > :first-child { margin-top: 0; }
.q-empty-info > :last-child { margin-bottom: 0; }
.q-stage { position: relative; border-radius: var(--q-radius); overflow: hidden; background: var(--q-stage); }
.q-viewer { height: 340px; }
.q-viewer canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.q-noview { padding: 40px; text-align: center; color: #bbb; }
.q-stage-info {
  position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none;
}
.q-stage-info span { background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 99px; backdrop-filter: blur(4px); }
.q-stage-info .q-ok { color: #86efac; }
.q-stage-info .q-error { color: #fca5a5; }

.q-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q-items:empty { display: none; }
.q-items li { background: var(--q-surface); border: var(--q-border-width) solid var(--q-border); border-radius: var(--q-radius); padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.q-items li.is-sel { border-color: var(--q-accent); box-shadow: 0 0 0 1px var(--q-accent); }
.q-items li.is-err { border-color: var(--q-warn); cursor: default; }
.q-item-head { display: flex; align-items: center; gap: 10px; }
.q-swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.q-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-price { font-weight: 700; white-space: nowrap; }
.q-remove { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--q-muted); cursor: pointer; padding: 0 4px; }
.q-remove:hover { color: var(--q-warn); }
.q-meta { font-size: .85em; color: var(--q-muted); margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.q-meta .q-error, .q-meta .q-hint { flex-basis: 100%; }
.q-hint { color: #b45309; }
.q-error { color: var(--q-warn); font-size: .88em; }
.q-loading { font-size: .88em; margin-top: 6px; }
.q-controls { display: grid; grid-template-columns: 1.2fr 1.4fr .7fr .8fr; gap: 8px; }
@media (max-width: 560px) { .q-controls { grid-template-columns: 1fr 1fr; } }
.q-controls label { display: grid; gap: 3px; font-size: .75em; color: var(--q-muted); text-transform: uppercase; letter-spacing: .04em; }
.q-root select, .q-root input:not([type=checkbox]):not([type=file]), .q-root textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--q-text); background: var(--q-bg);
  border: var(--q-border-width) solid var(--q-border); border-radius: calc(var(--q-radius) * .6); padding: 8px 10px; text-transform: none; letter-spacing: 0;
}
.q-root input[type=file] { font-size: 13px; max-width: 100%; }
.q-root select:focus, .q-root input:focus, .q-root textarea:focus { outline: 2px solid var(--q-accent); outline-offset: -1px; border-color: transparent; }
.q-disc { font-size: .82em; color: var(--q-ok); margin-top: 8px; font-weight: 600; }
.q-unit { font-size: .82em; margin-top: 8px; }

.q-field { display: grid; gap: 5px; margin-bottom: 12px; }
.q-label { font-size: .8em; font-weight: 600; color: var(--q-muted); }
.q-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.q-seg button {
  flex: 1 1 auto; font: inherit; font-size: 13px; padding: 7px 10px; cursor: pointer; white-space: nowrap;
  border: var(--q-border-width) solid var(--q-border); background: var(--q-bg); color: var(--q-text); border-radius: 99px;
}
.q-seg button.is-on { background: var(--q-accent); border-color: var(--q-accent); color: var(--q-accent-ink); }

.q-summary { border-top: 1px solid var(--q-border); margin-top: 6px; padding-top: 14px; }
.q-total-empty { text-align: center; padding: 10px 0; font-size: .95em; line-height: 1.5; }
.q-dl { margin: 0 0 12px; display: grid; gap: 5px; font-size: .9em; }
.q-dl div { display: flex; justify-content: space-between; gap: 10px; }
.q-dl dt { color: var(--q-muted); }
.q-dl dd { margin: 0; font-weight: 600; }
.q-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--q-border); padding-top: 12px; }
.q-total strong { font-size: 1.9em; line-height: 1; color: var(--q-accent); letter-spacing: -.02em; }
.q-vat { text-align: right; font-size: .82em; margin-top: 4px; }
.q-note { font-size: .78em; line-height: 1.45; margin: 12px 0 0; }

.q-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .q-row2 { grid-template-columns: 1fr; } }
.q-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; }
.q-check { display: flex; gap: 8px; align-items: flex-start; font-size: .8em; color: var(--q-muted); line-height: 1.45; margin: 4px 0 14px; }
.q-check input { margin-top: 3px; accent-color: var(--q-accent); }
.q-check a { color: inherit; }
.q-submit {
  width: 100%; font: inherit; font-weight: 700; font-size: 16px; padding: 14px; cursor: pointer;
  background: var(--q-accent); color: var(--q-accent-ink); border: 0; border-radius: calc(var(--q-radius) * .7);
  transition: filter .15s, transform .1s;
}
.q-submit:hover { filter: brightness(1.08); }
.q-submit:active { transform: translateY(1px); }
.q-submit:disabled { opacity: .55; cursor: wait; }
.q-status { margin: 10px 0 0; font-size: .88em; min-height: 1.2em; }
.q-status[data-kind=warn] { color: var(--q-warn); }

.q-done { text-align: center; padding: 48px 24px; }
.q-done-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: var(--q-accent); color: var(--q-accent-ink); }
.q-done h3 { margin: 0 0 12px; font-size: 1.5em; }
.q-done p { margin: 6px 0; }
/* po wgraniu plików strefa uploadu robi się kompaktowa */
.q-root.has-items .q-drop { grid-template-columns: auto 1fr; justify-items: start; text-align: left; padding: 12px 16px; gap: 2px 12px; }
.q-root.has-items .q-drop-icon { grid-row: span 2; margin: 0; }
.q-root.has-items .q-drop-icon svg { width: 30px; height: 30px; }
.q-root.has-items .q-drop strong { font-size: 1em; }
.q-again { margin-top: 18px; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 99px; cursor: pointer; background: transparent; color: var(--q-accent); border: var(--q-border-width) solid var(--q-accent); }
