/* ============================================================
   3D Lab Cafe – štýly (mobile-first)
   ============================================================ */
:root {
  --bg: #0f172a;
  --bg2: #111827;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #f1f5f9;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* Header / footer */
.site-header {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff; padding: 18px 0;
}
.site-header .logo { font-size: 1.35rem; font-weight: 800; letter-spacing: .3px; }
.site-header .tagline { opacity: .9; font-size: .92rem; }
.site-footer { color: var(--muted); font-size: .82rem; text-align: center; padding: 24px 0 40px; }

main { padding: 18px 0 40px; }

/* Karty / kroky */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-head h2 { font-size: 1.12rem; margin: 0; }
.step-num {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .95rem;
}
.muted { color: var(--muted); font-weight: 400; font-size: .85rem; }
.hidden { display: none !important; }
.dimmed { opacity: .45; pointer-events: none; }

/* Dropzone */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 32px 18px; text-align: center; cursor: pointer;
  transition: .15s; background: #f8fafc;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: #eff6ff; }
.dropzone .dz-icon { font-size: 2rem; }
.dropzone p { margin: 8px 0 4px; }
.dropzone small { color: var(--muted); }

/* Prepínač */
.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; cursor: pointer; user-select: none; }
.switch-row input { display: none; }
.switch { width: 44px; height: 26px; background: #cbd5e1; border-radius: 999px; position: relative; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.switch-row input:checked + .switch { background: var(--brand); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }

/* Globálne nastavenia */
.global-wrap { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; background: #f8fafc; }
.global-label { font-weight: 600; font-size: .9rem; margin-bottom: 10px; color: var(--muted); }

/* Mriežka nastavení */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.settings-grid label, .order-form label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 4px; font-weight: 600; }
select, input[type=number], input[type=text], input[type=email], input[type=tel], textarea {
  font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

/* Karta súboru */
.files { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.file-card {
  display: grid; grid-template-columns: 96px 1fr 28px; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: relative; align-items: start;
}
.thumb { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg,#eef2ff,#e0e7ff); }
.thumb-canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.thumb-zoom {
  position: absolute; right: 4px; bottom: 4px; width: 26px; height: 26px; border: none; border-radius: 7px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: .9rem;
}
.file-info { min-width: 0; }
.file-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.file-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.file-remove {
  border: none; background: #f1f5f9; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.file-remove:hover { background: #fee2e2; color: var(--err); }

/* Badge / výsledok súboru */
.file-result { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .78rem; background: #f1f5f9; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.err { background: #fee2e2; color: var(--err); }
.badge.price { background: var(--brand); color: #fff; }

/* Súhrn */
.totals { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.trow { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: none; }
.trow.total { background: #f0f9ff; font-size: 1.15rem; }
.trow.total b { color: var(--brand-dark); }

/* Akcie / tlačidlá */
.actions { margin-top: 16px; display: flex; justify-content: center; }
.btn {
  font: inherit; font-weight: 700; border: none; border-radius: 11px; padding: 12px 20px; cursor: pointer; transition: .15s;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn.big { font-size: 1.02rem; padding: 14px 26px; }
.btn.full { width: 100%; }

/* Formulár objednávky */
.order-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-form .full { grid-column: 1 / -1; }
.note-small { grid-column: 1/-1; font-size: .78rem; color: var(--muted); text-align: center; margin: 0; }

/* Viewer modál */
.viewer-modal { position: fixed; inset: 0; background: rgba(15,23,42,.75); display: none; z-index: 100; padding: 16px; }
.viewer-modal.open { display: grid; place-items: center; }
.viewer-box { width: 100%; max-width: 760px; background: #0b1220; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; color: #fff; }
.viewer-bar #viewer-title { font-weight: 700; }
.viewer-dims { font-size: .8rem; opacity: .7; }
.viewer-host { width: 100%; height: 56vh; background: radial-gradient(circle at 50% 40%, #1e293b, #0b1220); }
.viewer-hint { color: #94a3b8; font-size: .78rem; text-align: center; padding: 8px; }

/* Overlay loading */
.overlay { position: fixed; inset: 0; background: rgba(255,255,255,.82); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 200; backdrop-filter: blur(2px); }
.overlay.show { display: flex; }
.overlay #overlay-msg { font-weight: 600; color: var(--ink); text-align: center; padding: 0 24px; }
.spinner { width: 46px; height: 46px; border: 4px solid #dbeafe; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasty */
.toasts { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; padding: 0 12px; }
.toast { background: #1f2937; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: .3s; max-width: 92vw; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--err); }

/* Hotovo */
.done { text-align: center; padding: 40px 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.done-check { width: 70px; height: 70px; margin: 0 auto 14px; border-radius: 50%; background: #dcfce7; color: var(--ok); font-size: 2.2rem; display: grid; place-items: center; }
.done-id, .done-total { font-size: 1.05rem; }

/* Responzív */
@media (max-width: 560px) {
  .order-form { grid-template-columns: 1fr; }
  .file-card { grid-template-columns: 76px 1fr 26px; }
  .thumb { width: 76px; height: 76px; }
  .step-head h2 { font-size: 1.02rem; }
}
