/* ==========================================================================
   3D ART Designer - prodavnica
   ========================================================================== */
.tad-widget,
.tad-modal {
  --tad-accent: #E30613;
  --tad-ink: #111827;
  --tad-muted: #6b7280;
  --tad-line: #e5e7eb;
  --tad-soft: #f4f5f7;
  --tad-radius: 12px;
}

/* ---------- Dugme i rezime na proizvodu ---------- */
.tad-widget { margin: 14px 0 10px; width: 100%; flex-basis: 100%; }
.tad-widget .tad-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px; min-height: 48px; padding: 10px 18px;
  background: var(--tad-accent); border-color: var(--tad-accent); color: #fff;
  border-radius: 8px; font-weight: 600; text-transform: none; letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); transition: transform .15s ease, filter .15s ease;
}
.tad-widget .tad-open:hover,
.tad-widget .tad-open:focus { filter: brightness(1.07); color: #fff; }
.tad-widget .tad-open:active { transform: translateY(1px); }
.tad-widget .tad-open[hidden] { display: none; }
.tad-ico { width: 20px; height: 20px; flex: 0 0 20px; }
.tad-note { margin: 8px 0 0; font-size: .875rem; color: var(--tad-muted); }
.tad-note strong { color: var(--tad-ink); }

.tad-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 520px; padding: 10px; border: 1px solid #b7e1c1; background: #f0faf3;
  border-radius: 10px;
}
.tad-summary.is-incart { border-color: var(--tad-line); background: var(--tad-soft); }
.tad-summary-img { flex: 0 0 72px; }
.tad-summary-img img { display: block; width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--tad-line); border-radius: 8px; }
.tad-summary-txt { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; font-size: .875rem; color: var(--tad-muted); line-height: 1.35; }
.tad-summary-txt strong { color: #1b7f3b; font-size: .95rem; }
.tad-summary.is-incart .tad-summary-txt strong { color: var(--tad-ink); }
.tad-summary-act { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Opšta dugmad ---------- */
.tad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: filter .15s ease, background .15s ease;
}
.tad-btn-primary { background: var(--tad-accent); color: #fff; }
.tad-btn-primary:hover { filter: brightness(1.07); }
.tad-btn-primary:disabled { opacity: .6; cursor: progress; }
.tad-btn-ghost { background: #fff; color: var(--tad-ink); border-color: #d1d5db; }
.tad-btn-ghost:hover { background: var(--tad-soft); }
.tad-btn-sm { min-height: 34px; padding: 6px 12px; font-size: .82rem; }
.tad-link { background: none; border: 0; padding: 4px; font: inherit; font-size: .85rem; color: var(--tad-accent); cursor: pointer; text-decoration: underline; }
.tad-danger { color: #b91c1c; }

/* ---------- Modal ---------- */
html.tad-lock, html.tad-lock body { overflow: hidden !important; }
.tad-modal {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(17, 24, 39, .62); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  color: var(--tad-ink); font-size: 15px; line-height: 1.4;
}
.tad-modal[hidden] { display: none; }
.tad-modal *, .tad-modal *::before, .tad-modal *::after { box-sizing: border-box; }
.tad-dialog {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 1120px; max-height: 100%;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .28); overflow: hidden; outline: none;
}
.tad-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--tad-line); }
.tad-head-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.tad-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tad-ink); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: -.3px; }
.tad-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 28px; line-height: 1; color: var(--tad-muted); cursor: pointer; }
.tad-x:hover { background: var(--tad-soft); color: var(--tad-ink); }

.tad-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); min-height: 0; flex: 1 1 auto; overflow: hidden; }
.tad-stage-col { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--tad-soft); min-height: 0; overflow: auto; }
.tad-stage { position: relative; display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 260px; }
.tad-canvas { position: relative; display: inline-block; line-height: 0; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tad-mockup {
  display: block; max-width: 100%; max-height: min(64vh, 680px); width: auto; height: auto;
  border-radius: 10px; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.tad-layer { position: absolute; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tad-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tad-loading[hidden] { display: none; }
.tad-loading span { width: 34px; height: 34px; border: 3px solid #d1d5db; border-top-color: var(--tad-accent); border-radius: 50%; animation: tad-spin .8s linear infinite; }
@keyframes tad-spin { to { transform: rotate(360deg); } }

/* Vodilice za centar */
.tad-guide { position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 5; }
.tad-guide.is-on { opacity: 1; }
.tad-guide-v { left: 50%; top: 0; bottom: 0; border-left: 1px dashed #ec4899; }
.tad-guide-h { top: 50%; left: 0; right: 0; border-top: 1px dashed #ec4899; }

/* Elementi na proizvodu */
.tad-el { position: absolute; left: 0; top: 0; cursor: move; touch-action: none; transform-origin: 50% 50%; z-index: 2; line-height: 1; }
.tad-el[hidden] { display: none; }
.tad-el::before { content: ''; position: absolute; inset: -4px; border: 1.5px dashed transparent; border-radius: 4px; pointer-events: none; }
.tad-el:hover::before { border-color: rgba(17, 24, 39, .35); }
.tad-el.is-sel { z-index: 4; }
.tad-el.is-sel::before { border-color: var(--tad-accent); }
.tad-el-logo img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.tad-txt { white-space: pre; text-align: center; line-height: 1.15; pointer-events: none; }
.tad-el-text.is-light .tad-txt { text-shadow: 0 0 1px rgba(0, 0, 0, .35); }

.tad-h { position: absolute; display: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--tad-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); z-index: 6; }
.tad-el.is-sel .tad-h { display: block; }
.tad-el.is-moving .tad-h { opacity: .5; }
.tad-h-scale { right: -17px; bottom: -17px; cursor: nwse-resize; }
.tad-h-scale::after { content: ''; position: absolute; inset: 6px; border-right: 2px solid var(--tad-accent); border-bottom: 2px solid var(--tad-accent); }
.tad-h-rot { left: 50%; top: -48px; margin-left: -13px; cursor: grab; }
.tad-h-rot::after { content: '⟳'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--tad-accent); line-height: 1; }
.tad-h-rot::before { content: ''; position: absolute; left: 50%; top: 100%; height: 20px; border-left: 1.5px dashed var(--tad-accent); }
.tad-h-del { left: -17px; top: -17px; cursor: pointer; border-color: #b91c1c; }
.tad-h-del::after { content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #b91c1c; line-height: 1; }

.tad-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.tad-thumbs[hidden] { display: none; }
.tad-thumb { flex: 0 0 56px; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; }
.tad-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tad-thumb.is-active { border-color: var(--tad-accent); }
.tad-hint { margin: 0; font-size: .8rem; color: var(--tad-muted); text-align: center; }

/* Panel sa kontrolama */
.tad-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; overflow: auto; min-height: 0; border-left: 1px solid var(--tad-line); }
.tad-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--tad-soft); border-radius: 10px; }
.tad-tab { min-height: 40px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; color: var(--tad-muted); cursor: pointer; }
.tad-tab.is-active { background: #fff; color: var(--tad-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.tad-pane { display: flex; flex-direction: column; gap: 12px; }
.tad-pane[hidden] { display: none; }

.tad-drop {
  position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px;
  border: 2px dashed #cbd5e1; border-radius: var(--tad-radius); background: #fafbfc; cursor: pointer; transition: border-color .15s, background .15s;
}
.tad-drop:hover, .tad-drop.is-over { border-color: var(--tad-accent); background: #fff; }
.tad-drop.has-logo { padding: 10px 14px; }
.tad-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tad-drop-ico { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--tad-accent); color: #fff; font-size: 18px; }
.tad-drop-txt { display: flex; flex-direction: column; gap: 2px; }
.tad-drop-txt strong { font-size: .95rem; }
.tad-drop-txt small { color: var(--tad-muted); font-size: .78rem; }

.tad-logo-ctrl, .tad-text-ctrl { display: flex; flex-direction: column; gap: 10px; }
.tad-logo-ctrl[hidden], .tad-text-ctrl[hidden] { display: none; }
.tad-file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .85rem; }
.tad-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tad-muted); }
.tad-range { display: grid; grid-template-columns: 78px 1fr 42px; align-items: center; gap: 8px; margin: 0; font-size: .85rem; font-weight: 600; }
.tad-range output { font-weight: 400; color: var(--tad-muted); text-align: right; font-size: .8rem; }
.tad-range input[type="range"] { width: 100%; accent-color: var(--tad-accent); height: 28px; margin: 0; }
.tad-pane .tad-btn-sm { align-self: flex-start; }

.tad-text {
  width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px;
  font: inherit; font-size: 16px; resize: vertical; color: var(--tad-ink); background: #fff;
}
.tad-text:focus { outline: none; border-color: var(--tad-accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.tad-counter { margin-top: -8px; text-align: right; font-size: .75rem; color: var(--tad-muted); }
.tad-field-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tad-muted); margin-bottom: -4px; }
.tad-fonts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tad-font { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 17px; color: var(--tad-ink); cursor: pointer; white-space: nowrap; }
.tad-font.is-active { border-color: var(--tad-accent); box-shadow: inset 0 0 0 1px var(--tad-accent); }
.tad-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.tad-color { position: relative; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); cursor: pointer; margin: 0; }
.tad-color.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tad-accent); }
.tad-color-custom { display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); overflow: hidden; }
.tad-color-custom span { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; font-weight: 700; font-size: 15px; color: var(--tad-ink); pointer-events: none; }
.tad-color-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.tad-instructions { margin: auto 0 0; padding: 10px 12px; font-size: .8rem; color: var(--tad-muted); background: var(--tad-soft); border-radius: 10px; }

.tad-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--tad-line); background: #fff; }
.tad-price { font-weight: 600; font-size: .95rem; }
.tad-foot-btns { display: flex; gap: 8px; }
.tad-modal.is-busy .tad-layer { pointer-events: none; }

/* Obaveštenje */
.tad-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100001; max-width: calc(100% - 32px); padding: 12px 18px;
  border-radius: 10px; background: #111827; color: #fff; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.tad-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.tad-toast.is-err { background: #b91c1c; }
.tad-toast.is-ok { background: #166534; }

/* ---------- Dodir: veće ručice ---------- */
@media (pointer: coarse) {
  .tad-h { width: 34px; height: 34px; }
  .tad-h-scale { right: -21px; bottom: -21px; }
  .tad-h-rot { top: -56px; margin-left: -17px; }
  .tad-h-del { left: -21px; top: -21px; }
  .tad-h-rot::after { font-size: 18px; }
  .tad-h-del::after { font-size: 22px; }
}

/* ---------- Telefon / tablet ---------- */
@media (max-width: 860px) {
  .tad-modal { padding: 0; align-items: stretch; }
  .tad-dialog { max-width: none; height: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .tad-head { padding: 8px 8px 8px 14px; }
  .tad-body { display: flex; flex-direction: column; overflow: hidden; }
  .tad-stage-col { flex: 0 0 auto; padding: 10px 10px 8px; gap: 8px; overflow: visible; }
  .tad-stage { min-height: 0; }
  .tad-mockup { max-height: 44vh; max-height: 44dvh; }
  .tad-thumb { flex-basis: 46px; width: 46px; height: 46px; }
  .tad-panel { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--tad-line); padding: 12px 14px; }
  .tad-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .tad-price { width: 100%; text-align: center; font-size: .9rem; }
  .tad-foot-btns { width: 100%; }
  .tad-foot-btns .tad-btn { flex: 1 1 0; min-height: 46px; }
  .tad-foot-btns .tad-save { flex-grow: 2; }
  .tad-instructions { display: none; }
}
@media (max-width: 380px) {
  .tad-range { grid-template-columns: 66px 1fr 38px; }
}

/* ==========================================================================
   v1.1 - kartica na proizvodu, izbor tehnike, gravura
   ========================================================================== */
.tad-widget .tad-card-info { display: none; }
.tad-summary-tech { font-style: normal; font-size: .8rem; color: var(--tad-ink); }

/* Izbor tehnike - prvi korak */
.tad-techscreen { position: absolute; inset: 61px 0 0 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px; background: #fff; overflow: auto; }
.tad-techscreen[hidden] { display: none; }
.tad-modal.is-choosing .tad-foot { visibility: hidden; }
.tad-techscreen-in { width: 100%; max-width: 640px; text-align: center; }
.tad-tech-title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 700; color: var(--tad-ink); }
.tad-tech-sub { margin: 0 0 22px; color: var(--tad-muted); }
.tad-tech-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tad-tech-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px 18px;
  border: 2px solid var(--tad-line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--tad-ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tad-tech-card:hover, .tad-tech-card:focus-visible { border-color: var(--tad-accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); outline: none; }
.tad-tech-card.is-active { border-color: var(--tad-accent); box-shadow: inset 0 0 0 1px var(--tad-accent); }
.tad-tech-name { font-size: 1.1rem; font-weight: 700; }
.tad-tech-desc { font-size: .85rem; color: var(--tad-muted); line-height: 1.35; }
.tad-tech-price { margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: var(--tad-soft); font-size: .85rem; font-weight: 700; }
.tad-tech-ico { position: relative; width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.tad-tech-ico-print { background: #fff; border: 1px solid var(--tad-line); display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 13px; }
.tad-tech-ico-print i { display: block; width: 15px; height: 15px; border-radius: 50%; }
.tad-tech-ico-print i:nth-child(1) { background: #00AEEF; }
.tad-tech-ico-print i:nth-child(2) { background: #EC008C; }
.tad-tech-ico-print i:nth-child(3) { background: #FFD100; }
.tad-tech-ico-print i:nth-child(4) { background: #1f2937; }
.tad-tech-ico-engrave { background: linear-gradient(135deg, #4b5563, #9ca3af 55%, #6b7280); }
.tad-tech-ico-engrave i { width: 34px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.85); box-shadow: 0 9px 0 rgba(255,255,255,.55), 0 -9px 0 rgba(255,255,255,.55); transform: rotate(-20deg); }

.tad-techbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--tad-soft); font-size: .88rem; }
.tad-techbar[hidden] { display: none; }
.tad-tabs[hidden], .tad-tab[hidden] { display: none; }
.tad-tabs:has(.tad-tab[hidden]) { grid-template-columns: 1fr; }

/* Gravura */
.tad-engrave-note { display: none; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--tad-soft); font-size: .8rem; color: var(--tad-muted); }
.tad-modal.is-engrave .tad-engrave-note { display: block; }
.tad-modal.is-engrave .tad-color-wrap { display: none; }
.tad-el-logo.is-engrave-fallback img { filter: grayscale(1) contrast(1.15); opacity: .85; }

@media (max-width: 860px) {
  .tad-techscreen { inset: 57px 0 0 0; padding: 18px 14px; align-items: flex-start; }
  .tad-tech-cards { grid-template-columns: 1fr; gap: 10px; }
  .tad-tech-card { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; padding: 14px; column-gap: 14px; }
  .tad-tech-ico { width: 52px; height: 52px; margin: 0; flex: 0 0 52px; }
  .tad-tech-card .tad-tech-name { flex: 1; }
  .tad-tech-card .tad-tech-desc { flex-basis: 100%; }
  .tad-tech-card .tad-tech-price { margin: 0; }
}

/* ==========================================================================
   Rasporedi dugmadi na proizvodu (A / B / C)
   ========================================================================== */
.tad-buybox { --tad-btn: #263238; display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 14px 0 6px; clear: both; }
.tad-bb-row { display: flex; gap: 10px; align-items: stretch; width: 100%; }
.tad-bb-row > * { margin: 0 !important; }
.tad-bb-grow { flex: 1 1 0; min-width: 0; }
.tad-emptied { display: none !important; }

.tad-buybox .tad-bb-btn {
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px;
  height: 52px !important; min-height: 52px !important; padding: 0 18px !important; margin: 0 !important;
  border-radius: 10px !important; border: 2px solid var(--tad-btn) !important; box-shadow: none !important;
  font-size: 1rem !important; font-weight: 700 !important; line-height: 1 !important; text-transform: none !important; letter-spacing: 0 !important;
  width: auto; max-width: none !important; white-space: nowrap; text-decoration: none !important; cursor: pointer;
  transition: filter .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.tad-buybox .tad-bb-btn:active { transform: translateY(1px); }
.tad-buybox .tad-bb-primary { background: var(--tad-btn) !important; color: #fff !important; }
.tad-buybox .tad-bb-primary:hover { filter: brightness(1.15); }
.tad-buybox .tad-bb-secondary { background: #fff !important; color: var(--tad-btn) !important; }
.tad-buybox .tad-bb-secondary:hover { background: var(--tad-btn) !important; color: #fff !important; }
.tad-buybox .tad-bb-full { width: 100% !important; }
.tad-buybox .tad-bb-btn i, .tad-buybox .tad-bb-btn svg { color: inherit !important; fill: currentColor; }
.tad-buybox .tad-bb-link {
  display: inline-flex !important; align-items: center; gap: 6px; height: auto !important; min-height: 0 !important; padding: 6px 2px !important;
  border: 0 !important; background: none !important; box-shadow: none !important; color: var(--tad-btn) !important;
  font-size: .95rem !important; font-weight: 600 !important; text-decoration: underline !important; text-underline-offset: 3px; width: auto !important;
}

.tad-buybox .tad-bb-qty { flex: 0 0 136px; width: 136px !important; height: 52px; margin: 0 !important; display: flex !important; align-items: stretch; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; background: #fff; }
.tad-buybox .tad-bb-qty.tad-bb-grow { flex: 1 1 0; width: auto !important; }
.tad-buybox .tad-bb-qty > *, .tad-buybox .tad-bb-qty .input-group { height: 100% !important; border-radius: 0 !important; }
.tad-buybox .tad-bb-qty input { height: 100% !important; border: 0 !important; text-align: center; font-size: 1.05rem !important; font-weight: 700; box-shadow: none !important; }
.tad-buybox .tad-bb-qty button, .tad-buybox .tad-bb-qty .btn { border: 0 !important; background: #f6f7f8 !important; height: 100% !important; }

.tad-buybox .tad-bb-icon {
  flex: 0 0 52px; width: 52px !important; height: 52px !important; padding: 0 !important; margin: 0 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  border: 1px solid #d1d5db !important; border-radius: 10px !important; background: #fff !important; box-shadow: none !important; position: static !important;
}
.tad-buybox .tad-bb-icon:hover { border-color: var(--tad-btn) !important; }
.tad-buybox .tad-bb-link.tad-bb-icon { flex: 0 0 auto; width: auto !important; height: auto !important; border: 0 !important; }

/* Widget unutar rasporeda */
.tad-buybox .tad-widget { margin: 0; }
.tad-buybox .tad-widget .tad-open { max-width: none; width: 100%; height: 52px; border-radius: 10px; font-size: 1rem; }

/* A: kartica brendiranja */
.tad-lay-a .tad-widget {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 14px;
  padding: 12px 12px 12px 14px; border: 1.5px dashed var(--tad-accent); border-radius: 12px;
  background: color-mix(in srgb, var(--tad-accent) 6%, #fff);
}
.tad-lay-a .tad-widget .tad-card-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tad-lay-a .tad-card-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--tad-accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.tad-lay-a .tad-card-ico svg { width: 22px; height: 22px; }
.tad-lay-a .tad-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tad-lay-a .tad-card-title { font-size: 1rem; color: var(--tad-ink); }
.tad-lay-a .tad-card-sub { font-size: .82rem; color: var(--tad-muted); }
.tad-lay-a .tad-widget .tad-open { width: auto; height: 44px; min-height: 44px; padding: 0 16px; font-size: .92rem; }
.tad-lay-a .tad-widget .tad-open .tad-ico { display: none; }
.tad-lay-a .tad-widget .tad-note { display: none; }
.tad-lay-a .tad-widget .tad-summary-slot { grid-column: 1 / -1; }
.tad-lay-a .tad-widget .tad-summary-slot:empty { display: none; }
.tad-lay-a .tad-widget:has(.tad-summary) .tad-card-info { display: none; }
.tad-lay-a .tad-summary { max-width: none; border: 0; background: transparent; padding: 0; }

/* C: brendiranje u prvom planu */
.tad-lay-c .tad-widget .tad-open { height: 58px; font-size: 1.08rem; }
.tad-lay-c .tad-widget .tad-note { text-align: center; margin-top: 6px; }
.tad-lay-c .tad-bb-links { justify-content: space-between; align-items: center; }

@media (max-width: 480px) {
  .tad-buybox .tad-bb-qty { flex-basis: 118px; width: 118px !important; }
  .tad-buybox .tad-bb-btn { padding: 0 12px !important; font-size: .95rem !important; }
  .tad-lay-a .tad-widget { grid-template-columns: 1fr; }
  .tad-lay-a .tad-widget .tad-open { width: 100%; }
  .tad-lay-b .tad-bb-pair { flex-direction: column; }
}

/* Ispravke širine (teme bez box-sizing: border-box) */
.tad-widget, .tad-widget *, .tad-buybox, .tad-buybox * { box-sizing: border-box; }
.tad-buybox .tad-bb-qty .input-group, .tad-buybox .tad-bb-qty .bootstrap-touchspin { display: flex !important; flex-wrap: nowrap !important; width: 100% !important; border: 0 !important; }
.tad-buybox .tad-bb-qty input { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; padding: 0 !important; }
.tad-buybox .tad-bb-qty button, .tad-buybox .tad-bb-qty .btn, .tad-buybox .tad-bb-qty .input-group-btn { flex: 0 0 38px !important; width: 38px !important; min-width: 0 !important; padding: 0 !important; display: flex !important; align-items: center; justify-content: center; }
.tad-buybox .tad-bb-qty .input-group-btn-vertical { flex: 0 0 auto !important; }
.tad-buybox .tad-bb-row > .tad-bb-btn { min-width: 0; }
.tad-buybox .tad-bb-btn.tad-bb-grow { width: auto !important; }
@media (max-width: 480px) { .tad-lay-b .tad-bb-pair > .tad-bb-btn { width: 100% !important; flex: 0 0 auto; } }

/* ==========================================================================
   v1.1.1 - količina | Dodaj u korpu | Kupi odmah u jednom redu
   ========================================================================== */
.tad-buybox .tad-widget .tad-note { display: none; }
.tad-buybox .tad-bb-main > * { min-width: 0; }
.tad-buybox .tad-bb-main .tad-bb-qty { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
.tad-buybox .tad-bb-main.has-3 .tad-bb-btn { flex: 2 1 0 !important; width: auto !important; }
.tad-buybox .tad-bb-main.has-2 .tad-bb-btn { flex: 1 1 0 !important; width: auto !important; }

/* Naša − / + dugmad; strelice teme sakrivene */
.tad-buybox .tad-bb-qty button:not(.tad-q-btn),
.tad-buybox .tad-bb-qty .input-group-btn-vertical,
.tad-buybox .tad-bb-qty .input-group-btn,
.tad-buybox .tad-bb-qty .input-group-append,
.tad-buybox .tad-bb-qty .input-group-prepend { display: none !important; }
.tad-buybox .tad-bb-qty .tad-q-btn {
  display: flex !important; align-items: center; justify-content: center; flex: 0 0 34px !important; width: 34px !important; height: 100% !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: #f3f4f6 !important;
  color: var(--tad-btn) !important; font-size: 20px !important; font-weight: 700; line-height: 1; cursor: pointer; user-select: none;
}
.tad-buybox .tad-bb-qty .tad-q-btn:hover { background: #e5e7eb !important; }
.tad-buybox .tad-bb-qty .tad-q-input, .tad-buybox .tad-bb-qty input { -moz-appearance: textfield; appearance: textfield; }
.tad-buybox .tad-bb-qty input::-webkit-outer-spin-button,
.tad-buybox .tad-bb-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tad-buybox .tad-bb-qty > :not(.tad-q-btn) { flex: 1 1 auto; min-width: 0; display: flex; }

/* Lista želja kao diskretan link */
.tad-buybox .tad-bb-extra { justify-content: flex-end; margin-top: -2px; }
.tad-buybox .tad-bb-wish {
  display: inline-flex !important; align-items: center; gap: 6px; width: auto !important; height: auto !important; min-height: 0 !important;
  padding: 4px 2px !important; border: 0 !important; background: none !important; box-shadow: none !important;
  color: var(--tad-btn) !important; font-size: .9rem !important; font-weight: 600; cursor: pointer; position: static !important;
}
.tad-buybox .tad-bb-wish::after { content: attr(data-tad-label); }
.tad-buybox .tad-bb-wish:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .tad-buybox .tad-bb-main.has-3 { flex-wrap: wrap; }
  .tad-buybox .tad-bb-main.has-3 .tad-bb-qty { flex: 1 1 0 !important; }
  .tad-buybox .tad-bb-main.has-3 .tad-bb-cart { flex: 2 1 0 !important; }
  .tad-buybox .tad-bb-main.has-3 .tad-bb-buy { flex: 1 1 100% !important; }
  .tad-buybox .tad-bb-btn { font-size: .95rem !important; padding: 0 10px !important; }
}

/* v1.1.2 - stabilan prikaz na svim rezolucijama */
@media (min-width: 861px) {
  .tad-dialog { height: min(880px, 100%); }
  .tad-stage-col { overflow: hidden; }
  .tad-stage { flex: 1 1 0; min-height: 160px; overflow: hidden; }
  .tad-mockup { max-height: 100%; }
  .tad-thumbs, .tad-hint { flex: 0 0 auto; }
}
.tad-thumbs { position: relative; z-index: 1; padding: 4px 2px; }
.tad-field-label { margin: 4px 0 0 !important; line-height: 1.3; }
.tad-colors { padding: 6px 4px; margin: 0; }
.tad-modal .tad-color { flex: 0 0 34px; margin: 0 !important; }
.tad-modal label.tad-color { display: inline-flex !important; }
.tad-pane { gap: 10px; }

/* v1.1.4 - lista želja kao kvadratna ikonica na kraju reda */
.tad-buybox .tad-hide { display: none !important; }
.tad-buybox .tad-bb-main .tad-bb-wish {
  flex: 0 0 52px !important; width: 52px !important; height: 52px !important; padding: 0 !important; gap: 0;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  border: 1px solid #d1d5db !important; border-radius: 10px !important; background: #fff !important; font-size: 22px !important;
  text-decoration: none !important;
}
.tad-buybox .tad-bb-main .tad-bb-wish::after { content: none !important; }
.tad-buybox .tad-bb-main .tad-bb-wish:hover { border-color: var(--tad-btn) !important; text-decoration: none; }
.tad-buybox .tad-bb-wish i, .tad-buybox .tad-bb-wish svg { margin: 0 !important; font-size: 22px; }
.tad-buybox .tad-heart { width: 22px; height: 22px; }
@media (max-width: 560px) {
  .tad-buybox .tad-bb-main.has-3 .tad-bb-wish { order: 2; }
  .tad-buybox .tad-bb-main.has-3 .tad-bb-buy { order: 3; }
}
.tad-buybox .tad-bb-main .tad-bb-wish { overflow: hidden; }

/* v1.1.5 - polje za količinu uvek prikazuje ceo broj (npr. 2500) */
.tad-buybox .tad-bb-main .tad-bb-qty { flex: 1.25 1 0 !important; min-width: 150px !important; }
.tad-buybox .tad-bb-qty .tad-q-btn { flex: 0 0 40px !important; width: 40px !important; max-width: 40px !important; }
.tad-buybox .tad-bb-qty > .input-group,
.tad-buybox .tad-bb-qty > .bootstrap-touchspin,
.tad-buybox .tad-bb-qty > :not(.tad-q-btn) { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; max-width: none !important; }
.tad-buybox .tad-bb-qty input,
.tad-buybox .tad-bb-qty .input-group input,
.tad-buybox .tad-bb-qty input.form-control { flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; max-width: none !important; padding: 0 2px !important; }
@media (max-width: 560px) {
  .tad-buybox .tad-bb-main .tad-bb-qty { min-width: 130px !important; }
}
.tad-buybox .tad-bb-btn { overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   v1.2 - dizajner na telefonu: A fioka / B koraci / C traka alata
   ========================================================================== */
.tad-prev, .tad-next, .tad-ctx, .tad-mbar, .tad-stepsbar, .tad-sheet-handle, .tad-panel-done { display: none; }

@media (max-width: 860px) {
  /* Zajedničko: slika zauzima sav slobodan prostor */
  .tad-modal .tad-body { display: flex; flex-direction: column; position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .tad-modal .tad-stage-col { flex: 1 1 0; min-height: 0; overflow: hidden; padding: 8px 10px 6px; gap: 6px; }
  .tad-modal .tad-stage { flex: 1 1 0; min-height: 0; }
  .tad-modal .tad-mockup { max-height: none; }
  .tad-modal .tad-thumbs { flex: 0 0 auto; }
  .tad-modal .tad-thumb { flex-basis: 42px; width: 42px; height: 42px; }
  .tad-modal .tad-hint { font-size: .72rem; flex: 0 0 auto; }
  .tad-modal .tad-panel { padding: 10px 14px 12px; gap: 10px; }

  /* Kompaktno dno: cena levo, Sačuvaj desno (zatvaranje je na X gore) */
  .tad-modal .tad-foot { flex-wrap: nowrap; gap: 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .tad-modal .tad-price { width: auto; flex: 1 1 auto; text-align: left; font-size: .82rem; line-height: 1.25; }
  .tad-modal .tad-foot-btns { width: auto; flex: 0 0 auto; }
  .tad-modal .tad-foot-btns .tad-btn { flex: 0 0 auto; min-height: 46px; padding: 8px 18px; }
  .tad-modal .tad-cancel { display: none; }

  /* Plutajuća traka za izabrani element */
  .tad-ctx.is-on { display: flex; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 8; gap: 4px; padding: 4px; background: #fff; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
  .tad-ctx button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f3f4f6; color: var(--tad-ink); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
  .tad-ctx button svg { width: 19px; height: 19px; }
  .tad-ctx .tad-ctx-del { color: #b91c1c; }
  .tad-ctx .tad-ctx-edit { background: var(--tad-accent); color: #fff; }
  .tad-m-sheet .tad-ctx.is-on { display: none; }

  /* ---------- A · Donja fioka ---------- */
  .tad-m-sheet .tad-panel { flex: 0 0 auto; border-left: 0; border-top: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.10); padding-top: 0; position: relative; z-index: 3; background: #fff; }
  .tad-m-sheet.is-sheet-open .tad-panel { flex: 0 0 56%; overflow-y: auto; }
  .tad-m-sheet .tad-sheet-handle { display: flex; position: sticky; top: 0; z-index: 2; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 8px 0 4px; margin: 0; border: 0; background: #fff; font: inherit; font-size: .78rem; color: var(--tad-muted); cursor: pointer; }
  .tad-grip { width: 40px; height: 5px; border-radius: 3px; background: #d1d5db; }
  .tad-m-sheet.is-sheet-open .tad-sheet-label { display: none; }
  .tad-m-sheet:not(.is-sheet-open) .tad-panel > :not(.tad-sheet-handle):not(.tad-tabs):not(.tad-techbar) { display: none !important; }
  .tad-m-sheet .tad-instructions { display: none; }

  /* ---------- B · Korak po korak ---------- */
  .tad-m-steps .tad-stepsbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; font-size: .82rem; font-weight: 700; color: var(--tad-ink); }
  .tad-step-dots { display: flex; gap: 4px; flex: 0 1 140px; }
  .tad-step-dots i { flex: 1; height: 4px; border-radius: 2px; background: #e5e7eb; }
  .tad-step-dots i.is-on { background: var(--tad-accent); }
  .tad-m-steps .tad-tabs { display: none !important; }
  .tad-m-steps .tad-instructions { display: none; }
  .tad-m-steps.is-step-edit .tad-stage-col { flex: 0 0 40%; }
  .tad-m-steps.is-step-edit .tad-hint { display: none; }
  .tad-m-steps.is-step-edit .tad-panel { flex: 1 1 0; min-height: 0; overflow-y: auto; border-left: 0; border-top: 1px solid var(--tad-line); }
  .tad-m-steps.is-step-place .tad-panel { display: none; }
  .tad-m-steps .tad-prev, .tad-m-steps .tad-next { display: inline-flex; }
  .tad-m-steps .tad-save { display: none; }
  .tad-m-steps.is-step-last .tad-next { display: none; }
  .tad-m-steps.is-step-last .tad-save { display: inline-flex; }
  .tad-m-steps .tad-foot { flex-wrap: wrap; }
  .tad-m-steps .tad-price { flex-basis: 100%; text-align: center; }
  .tad-m-steps .tad-foot-btns { width: 100%; }
  .tad-m-steps .tad-foot-btns .tad-btn { flex: 1 1 0; }
  .tad-m-steps .tad-foot-btns .tad-next, .tad-m-steps .tad-foot-btns .tad-save { flex-grow: 2; }

  /* ---------- C · Traka alata ---------- */
  .tad-m-toolbar .tad-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 15; max-height: 64%; overflow-y: auto; background: #fff; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.2); padding-top: 0; transform: translateY(105%); transition: transform .22s ease; }
  .tad-m-toolbar.is-panel-open .tad-panel { transform: none; }
  .tad-m-toolbar .tad-tabs, .tad-m-toolbar .tad-techbar, .tad-m-toolbar .tad-instructions { display: none !important; }
  .tad-m-toolbar .tad-panel-done { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 2; background: #fff; padding: 10px 0 4px; }
  .tad-m-toolbar .tad-mbar { display: flex; flex: 0 0 auto; justify-content: space-around; padding: 4px 6px; border-top: 1px solid var(--tad-line); background: #fff; }
  .tad-mbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 6px 0; border: 0; background: none; font: inherit; font-size: .74rem; font-weight: 600; color: var(--tad-ink); cursor: pointer; }
  .tad-mbar button[hidden] { display: none; }
  .tad-mbar svg { width: 23px; height: 23px; }
  .tad-m-toolbar .tad-thumbs { justify-content: center; }
}
@media (max-width: 860px) {
  .tad-m-steps:not(.is-step-place) .tad-ctx.is-on { display: none; }
}

.tad-widget.is-loading .tad-open { opacity: .7; cursor: progress; }

/* v1.3 - zona brendiranja i strane */
.tad-zone { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.tad-zone-dim { fill: rgba(17, 24, 39, .28); }
.tad-zone-line { fill: none; stroke: var(--tad-accent); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.tad-thumbs.is-sides { gap: 10px; justify-content: center; }
.tad-side-btn { position: relative; display: flex !important; align-items: center; gap: 8px; width: auto !important; height: 52px !important; flex: 0 0 auto !important; padding: 4px 12px 4px 4px !important; border: 2px solid var(--tad-line) !important; border-radius: 10px !important; background: #fff; font: inherit; font-size: .85rem; font-weight: 600; color: var(--tad-ink); cursor: pointer; }
.tad-side-btn img { width: 40px !important; height: 40px !important; object-fit: contain; border-radius: 6px; }
.tad-side-btn.is-active { border-color: var(--tad-accent) !important; }
.tad-side-dot { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: #16a34a; border: 2px solid #fff; display: none; }
.tad-side-btn.has-design .tad-side-dot { display: block; }
@media (max-width: 860px) {
  .tad-side-btn { height: 44px !important; font-size: .8rem; padding-right: 10px !important; }
  .tad-side-btn img { width: 34px !important; height: 34px !important; }
}
