/* =========================================================
   VIBEINKS STUDIO — DESIGNER STYLES
========================================================= */
:root {
  --vibe-primary: #08a9e6;
  --vibe-primary-hover: #0693c9;
  --vibe-ink: #2c3a47;
  --vibe-muted: #7a8b99;
  --vibe-border: #e6ecf0;
  --vibe-surface: #f7fafc;
  --vibe-bg: #ffffff;
  --vibe-danger: #dc2626;
  --vibe-shadow: 0 10px 30px rgba(46, 72, 88, 0.08);
  --vibe-radius: 14px;
  --vibe-font: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  --toolbar-h: 58px;
  --bottom-h: 60px;
  --left-w: 300px;
  --right-w: 180px;
}

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

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--vibe-font);
  color: var(--vibe-ink);
  background: var(--vibe-surface);
  -webkit-font-smoothing: antialiased;
}

/* Phase 2: when embedded in Elementor iframe, kill page scrollbars */
html.is-iframe,
html.is-iframe body,
body.is-iframe {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}

.vibe-app {
  display: grid;
  grid-template-rows: var(--toolbar-h) 1fr var(--bottom-h);
  height: 100dvh;
  overflow: hidden;
}

.vibe-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--vibe-primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
}
.vibe-skip:focus { left: 8px; top: 8px; }

button, select, input { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--vibe-primary);
  outline-offset: 2px;
}

/* Toolbar */
.vibe-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--vibe-bg);
  border-bottom: 1px solid var(--vibe-border);
  z-index: 40;
}

.vibe-toolbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vibe-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--vibe-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.vibe-brand-text {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.vibe-brand-text span { color: var(--vibe-primary); }

.vibe-toolbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.vibe-toolbar__sep {
  width: 1px;
  height: 22px;
  background: var(--vibe-border);
  margin: 0 6px;
}

.vibe-toolbtn,
.vibe-iconbtn,
.vibe-chip,
.vibe-btn {
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.vibe-toolbtn {
  background: transparent;
  color: var(--vibe-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
}
.vibe-toolbtn:hover { color: var(--vibe-ink); background: var(--vibe-surface); }
.vibe-toolbtn.is-active {
  background: rgba(8, 169, 230, 0.12);
  color: var(--vibe-primary);
}

.vibe-iconbtn {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  color: var(--vibe-ink);
  font-weight: 700;
}
.vibe-iconbtn:hover { background: var(--vibe-surface); color: var(--vibe-primary); }

.vibe-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--vibe-muted);
}

.vibe-toolbar__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.vibe-btn {
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.vibe-btn--primary {
  background: var(--vibe-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 169, 230, 0.28);
}
.vibe-btn--primary:hover {
  background: var(--vibe-primary-hover);
  transform: translateY(-1px);
}
.vibe-btn--ghost {
  background: transparent;
  border: 1px solid var(--vibe-border);
  color: var(--vibe-ink);
}
.vibe-btn--ghost:hover { border-color: var(--vibe-primary); color: var(--vibe-primary); }
.vibe-btn--block { width: 100%; margin-bottom: 12px; }

.vibe-mobile-menu {
  display: none;
  border: 0;
  background: var(--vibe-surface);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* Workspace */
.vibe-workspace {
  display: grid;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
  min-height: 0;
  overflow: hidden;
}

.vibe-sidebar {
  background: var(--vibe-bg);
  border-right: 1px solid var(--vibe-border);
  overflow: auto;
  padding: 14px;
}
.vibe-sidebar--right {
  border-right: 0;
  border-left: 1px solid var(--vibe-border);
}

.vibe-panel__title {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.vibe-panel__subtitle {
  margin: 16px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vibe-muted);
  font-weight: 700;
}

.vibe-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--vibe-muted);
}

.vibe-select,
input[type="color"],
input[type="range"] {
  width: 100%;
}

.vibe-select {
  border: 1px solid var(--vibe-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--vibe-ink);
  font-weight: 600;
}

.vibe-product-summary {
  border: 1px solid var(--vibe-border);
  border-radius: var(--vibe-radius);
  padding: 12px;
  background: var(--vibe-surface);
  margin-bottom: 12px;
}
.vibe-product-summary strong { display: block; font-size: 15px; }
.vibe-product-summary span { color: var(--vibe-muted); font-size: 12px; }

.vibe-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vibe-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--vibe-border);
  cursor: pointer;
  padding: 0;
}
.vibe-swatch.is-active {
  box-shadow: 0 0 0 2px var(--vibe-primary);
  transform: scale(1.08);
}

.vibe-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vibe-size {
  min-width: 42px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--vibe-border);
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.vibe-size.is-active {
  border-color: var(--vibe-primary);
  color: var(--vibe-primary);
  background: rgba(8, 169, 230, 0.08);
}

.vibe-qty-matrix {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.vibe-qty-head,
.vibe-qty-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  align-items: center;
}
.vibe-qty-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--vibe-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vibe-qty-row {
  padding: 6px 8px;
  border: 1px solid var(--vibe-border);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
}
.vibe-qty-row input {
  width: 100%;
  border: 1px solid var(--vibe-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 700;
  text-align: center;
}
.vibe-price-breakdown {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--vibe-border);
  background: var(--vibe-surface);
  font-size: 12px;
}
.vibe-price-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--vibe-muted);
}
.vibe-price-breakdown strong {
  color: var(--vibe-ink);
}
.vibe-price-breakdown .is-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--vibe-border);
  font-size: 13px;
}
.vibe-price-breakdown .is-total strong {
  color: var(--vibe-primary);
  font-size: 15px;
}

.vibe-product-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--vibe-muted);
  line-height: 1.5;
}
.vibe-product-meta p { margin: 0 0 8px; }

.vibe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.vibe-chip {
  border-radius: 999px;
  border: 1px solid var(--vibe-border);
  background: #fff;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--vibe-ink);
}
.vibe-chip:hover,
.vibe-chip.is-active {
  border-color: var(--vibe-primary);
  color: var(--vibe-primary);
  background: rgba(8, 169, 230, 0.08);
}

.vibe-dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 140px;
  border: 2px dashed rgba(8, 169, 230, 0.45);
  border-radius: 18px;
  background: rgba(8, 169, 230, 0.05);
  text-align: center;
  padding: 16px;
  cursor: pointer;
  font-weight: 700;
}
.vibe-dropzone small {
  color: var(--vibe-muted);
  font-weight: 500;
}
.vibe-dropzone.is-drag {
  background: rgba(8, 169, 230, 0.12);
  border-color: var(--vibe-primary);
}

.vibe-clipart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.vibe-clipart-grid button {
  border: 1px solid var(--vibe-border);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}
.vibe-clipart-grid img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}
.vibe-clipart-grid span {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.vibe-templates button {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--vibe-border);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.vibe-templates button:hover {
  border-color: var(--vibe-primary);
  color: var(--vibe-primary);
}
.vibe-template-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
}
.vibe-template-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.vibe-template-card strong {
  display: block;
  font-size: 13px;
  color: var(--vibe-ink);
}
.vibe-template-card small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--vibe-muted);
  margin-top: 2px;
}
.vibe-template-cat {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--vibe-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vibe-textarea {
  width: 100%;
  border: 1px solid var(--vibe-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 96px;
  margin-bottom: 12px;
  color: var(--vibe-ink);
  background: #fff;
}
.vibe-textarea:focus {
  outline: 2px solid rgba(8, 169, 230, 0.35);
  border-color: var(--vibe-primary);
}

.vibe-layers {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vibe-layers li {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--vibe-border);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 6px;
  background: #fff;
  cursor: grab;
}
.vibe-layers li.is-selected {
  border-color: var(--vibe-primary);
  background: rgba(8, 169, 230, 0.06);
}
.vibe-layers .layer-name {
  flex: 1;
  border: 0;
  background: transparent;
  font-weight: 700;
  font-size: 12px;
  min-width: 0;
}
.vibe-layers li.is-locked {
  opacity: 0.72;
}
.vibe-layers .layer-actions button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--vibe-muted);
  font-size: 12px;
  padding: 2px 4px;
}
.vibe-layers .layer-actions button:hover { color: var(--vibe-primary); }

.vibe-object-tools,
.vibe-align-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.vibe-tools-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--vibe-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
  margin-top: 2px;
}
.vibe-object-tools .vibe-chip,
.vibe-align-tools .vibe-chip {
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
}

/* Stage / canvas */
.vibe-stage {
  position: relative;
  min-width: 0;
  background: #eef2f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.vibe-stage__controls {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.vibe-canvas-wrap {
  position: relative;
  width: min(100%, 720px);
  height: 100%;
  max-height: calc(100dvh - var(--toolbar-h) - var(--bottom-h) - 24px);
  margin: 28px auto 12px;
  display: grid;
  place-items: center;
}

.vibe-mockup {
  position: absolute;
  inset: 8% 12%;
  width: auto;
  height: auto;
  max-width: 76%;
  max-height: 84%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(46, 72, 88, 0.12));
  z-index: 1;
  transition: filter 0.25s ease;
}

#vibe-canvas {
  position: relative;
  z-index: 2;
  max-width: 100%;
}

.vibe-stage__hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--vibe-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 6;
}

.vibe-locations {
  display: grid;
  gap: 8px;
}
.vibe-location {
  border: 1px solid var(--vibe-border);
  border-radius: 14px;
  background: #fff;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.vibe-location.is-active {
  border-color: var(--vibe-primary);
  color: var(--vibe-primary);
  background: rgba(8, 169, 230, 0.08);
}
.vibe-location .thumb {
  height: 42px;
  border-radius: 8px;
  background: var(--vibe-surface);
  margin-bottom: 6px;
}

.vibe-help-inline {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--vibe-muted);
  line-height: 1.45;
}

.vibe-save-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--vibe-surface);
  color: var(--vibe-muted);
  border: 1px solid var(--vibe-border);
}
.vibe-save-badge.is-account {
  background: rgba(8, 169, 230, 0.12);
  color: var(--vibe-primary);
  border-color: rgba(8, 169, 230, 0.35);
}

.vibe-empty {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--vibe-surface);
  color: var(--vibe-muted);
  font-size: 12px;
  line-height: 1.45;
}

.vibe-saved-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.vibe-saved-card {
  border: 1px solid var(--vibe-border);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}
.vibe-saved-card.is-active {
  border-color: var(--vibe-primary);
  box-shadow: 0 0 0 1px rgba(8, 169, 230, 0.2);
}
.vibe-saved-card__body {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}
.vibe-saved-card__body strong {
  font-size: 13px;
}
.vibe-saved-card__body span,
.vibe-saved-card__body small {
  color: var(--vibe-muted);
  font-size: 11px;
}
.vibe-saved-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.vibe-saved-card__actions button {
  border: 1px solid var(--vibe-border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.vibe-saved-card__actions button:hover {
  border-color: var(--vibe-primary);
  color: var(--vibe-primary);
}
.vibe-saved-card__actions .is-danger:hover {
  border-color: var(--vibe-danger);
  color: var(--vibe-danger);
}

.vibe-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--vibe-border);
  font-size: 12px;
}
.vibe-version-row small {
  display: block;
  color: var(--vibe-muted);
}
.vibe-version-row button {
  border: 1px solid var(--vibe-border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  #btn-continue-later,
  .vibe-save-badge {
    display: none;
  }
}

/* Bottom bar */
.vibe-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: var(--vibe-bg);
  border-top: 1px solid var(--vibe-border);
}
.vibe-bottombar__center,
.vibe-bottombar__right,
.vibe-bottombar__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vibe-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--vibe-primary);
}
.vibe-muted { color: var(--vibe-muted); font-size: 12px; font-weight: 600; }

.vibe-toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  background: var(--vibe-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 80;
  box-shadow: var(--vibe-shadow);
}

.vibe-menu {
  position: absolute;
  right: 16px;
  top: calc(var(--toolbar-h) + 8px);
  background: #fff;
  border: 1px solid var(--vibe-border);
  border-radius: 14px;
  box-shadow: var(--vibe-shadow);
  padding: 6px;
  z-index: 70;
  min-width: 200px;
}
.vibe-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.vibe-menu button:hover {
  background: rgba(8, 169, 230, 0.1);
  color: var(--vibe-primary);
}

/* Dark mode ready tokens */
[data-theme="dark"] {
  --vibe-ink: #e8eef3;
  --vibe-muted: #9aabba;
  --vibe-border: #2a3641;
  --vibe-surface: #151b21;
  --vibe-bg: #0f1419;
}

/* Responsive */
@media (max-width: 1100px) {
  :root { --right-w: 150px; --left-w: 260px; }
  .vibe-brand-text { display: none; }
}

@media (max-width: 900px) {
  .vibe-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .vibe-sidebar {
    position: fixed;
    top: var(--toolbar-h);
    bottom: var(--bottom-h);
    width: min(100%, 320px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: var(--vibe-shadow);
  }
  .vibe-sidebar--right {
    right: 0;
    left: auto;
    transform: translateX(105%);
  }
  .vibe-app.panels-open .vibe-sidebar--left,
  .vibe-app.panels-open .vibe-sidebar--right {
    transform: translateX(0);
  }
  .vibe-mobile-menu { display: inline-grid; place-items: center; }
  .vibe-toolbar__nav .vibe-toolbtn { padding: 8px; font-size: 11px; }
  .vibe-toolbar__actions .vibe-btn--ghost:not(#btn-save) { display: none; }
}

@media (max-width: 640px) {
  .vibe-toolbar__nav .vibe-toolbtn[data-tool="templates"],
  .vibe-toolbar__nav .vibe-toolbtn[data-tool="clipart"] { display: none; }
  .vibe-bottombar__left { display: none; }
}

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