/* Leal3D V52 — editor visual contextual */
.l3d-ve-ui,
.l3d-ve-ui * { box-sizing: border-box; }

body.l3d-ve-editing {
  padding-top: 70px !important;
}

body.l3d-ve-editing :where(.page, .site-footer, .saas-modal) {
  transition: outline-color .14s ease;
}

body.l3d-ve-editing :where(.page, .site-footer, .saas-modal) * {
  cursor: default;
}

body.l3d-ve-editing button,
body.l3d-ve-editing a,
body.l3d-ve-editing input,
body.l3d-ve-editing select,
body.l3d-ve-editing textarea,
body.l3d-ve-editing [role="button"] { cursor: pointer; }

.l3d-ve-toolbar {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 60000;
  width: min(1120px, calc(100% - 20px));
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 15px;
  background: rgba(20,20,23,.94);
  color: #f4f4f5;
  box-shadow: 0 18px 55px rgba(0,0,0,.46);
  backdrop-filter: blur(18px) saturate(1.2);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transform: translate(-50%, -82px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .22s ease, opacity .18s ease, visibility .18s ease;
}

.l3d-ve-toolbar.open {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.l3d-ve-brand {
  min-width: 188px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,.09);
}

.l3d-ve-brand > div { display: grid; gap: 1px; }
.l3d-ve-brand strong { color: #fff; font-size: 12px; line-height: 1.1; }
.l3d-ve-brand small { color: #a1a1aa; font-size: 9px; line-height: 1.2; }
.l3d-ve-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,.12), 0 0 13px rgba(16,185,129,.8);
}

.l3d-ve-theme {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
}

.l3d-ve-theme button,
.l3d-ve-icon-button,
.l3d-ve-exit,
.l3d-ve-save {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}

.l3d-ve-theme button {
  min-width: 67px;
  padding: 7px 10px;
  background: transparent;
  color: #a1a1aa;
}

.l3d-ve-theme button.active {
  background: #3f3f46;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}

.l3d-ve-toolbar-spacer { flex: 1 1 auto; }
.l3d-ve-status {
  max-width: 180px;
  overflow: hidden;
  color: #a1a1aa;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l3d-ve-status.dirty { color: #fbbf24; }

.l3d-ve-icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
  background: rgba(255,255,255,.06);
  color: #e4e4e7;
  font-size: 18px;
}
.l3d-ve-icon-button:hover:not(:disabled),
.l3d-ve-exit:hover { background: rgba(255,255,255,.11); }
.l3d-ve-icon-button:disabled { opacity: .28; cursor: default; }

.l3d-ve-save {
  padding: 7px 15px;
  background: #10b981;
  color: #fff;
  box-shadow: 0 5px 18px rgba(16,185,129,.24);
}
.l3d-ve-save:hover:not(:disabled) { background: #059669; transform: translateY(-1px); }
.l3d-ve-save:disabled { opacity: .38; cursor: default; box-shadow: none; }
.l3d-ve-exit { padding: 7px 12px; background: rgba(255,255,255,.06); color: #d4d4d8; }

.l3d-ve-outline {
  position: fixed;
  z-index: 58000;
  display: none;
  border-radius: 7px;
  pointer-events: none;
}

.l3d-ve-hover-outline {
  border: 1px dashed rgba(56,189,248,.72);
  background: rgba(56,189,248,.035);
  box-shadow: 0 0 0 2px rgba(56,189,248,.06);
}

.l3d-ve-selection-outline {
  border: 2px solid #38bdf8;
  background: rgba(56,189,248,.025);
  box-shadow: 0 0 0 3px rgba(56,189,248,.10), 0 0 22px rgba(56,189,248,.16);
}

.l3d-ve-selection-outline span {
  position: absolute;
  top: -25px;
  left: -2px;
  max-width: 240px;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 6px 6px 6px 0;
  background: #0284c7;
  color: #fff;
  font: 800 9px/1.2 Inter, "Segoe UI", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l3d-ve-inspector {
  position: fixed;
  z-index: 61000;
  width: 390px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 17px;
  background: rgba(24,24,27,.98);
  color: #f4f4f5;
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
  backdrop-filter: blur(20px) saturate(1.1);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.l3d-ve-inspector[hidden] { display: none !important; }
.l3d-ve-inspector.dragging { user-select: none; box-shadow: 0 34px 110px rgba(0,0,0,.70); }

.l3d-ve-inspector-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.018);
  cursor: grab;
}
.l3d-ve-inspector.dragging .l3d-ve-inspector-head { cursor: grabbing; }
.l3d-ve-inspector-head > div { min-width: 0; }
.l3d-ve-inspector-head span {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: #38bdf8;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.l3d-ve-inspector-head h2 { margin: 0; color: #fff; font-size: 15px; line-height: 1.2; }
.l3d-ve-inspector-head p { margin: 5px 0 0; color: #a1a1aa; font-size: 9.5px; line-height: 1.45; }
.l3d-ve-inspector-head button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.065);
  color: #e4e4e7;
  font-size: 18px;
  cursor: pointer;
}
.l3d-ve-inspector-head button:hover { background: rgba(255,255,255,.12); }

.l3d-ve-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.l3d-ve-tabs button {
  min-height: 33px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f8f99;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
}
.l3d-ve-tabs button:hover { background: rgba(255,255,255,.045); color: #d4d4d8; }
.l3d-ve-tabs button.active { background: rgba(56,189,248,.12); color: #7dd3fc; }

.l3d-ve-mode-note {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  background: rgba(255,255,255,.028);
}
.l3d-ve-mode-note strong { color: #e4e4e7; font-size: 9px; white-space: nowrap; }
.l3d-ve-mode-note span { color: #8f8f99; font-size: 8.5px; line-height: 1.35; }
.l3d-ve-mode-note.theme { border-color: rgba(56,189,248,.18); background: rgba(56,189,248,.055); }
.l3d-ve-mode-note.theme strong { color: #7dd3fc; }
.l3d-ve-mode-note.universal { border-color: rgba(16,185,129,.18); background: rgba(16,185,129,.045); }
.l3d-ve-mode-note.universal strong { color: #6ee7b7; }

.l3d-ve-fields {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.l3d-ve-fields::-webkit-scrollbar { width: 7px; }
.l3d-ve-fields::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.16); }

.l3d-ve-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
}
.l3d-ve-field:hover { border-color: rgba(255,255,255,.12); }
.l3d-ve-field > span { color: #d4d4d8; font-size: 9.5px; font-weight: 750; }
.l3d-ve-field small { color: #7f7f89; font-size: 8.5px; line-height: 1.45; }
.l3d-ve-field em { color: #8f8f99; font-size: 8.5px; font-style: normal; }

.l3d-ve-field input[type="text"],
.l3d-ve-field input[type="number"],
.l3d-ve-field select,
.l3d-ve-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #111113;
  color: #f4f4f5;
  font: 500 10px/1.35 Inter, "Segoe UI", sans-serif;
  outline: none;
}
.l3d-ve-field textarea { resize: vertical; min-height: 70px; }
.l3d-ve-field input:focus,
.l3d-ve-field select:focus,
.l3d-ve-field textarea:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.10); }

.l3d-ve-range-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 96px;
  align-items: center;
  gap: 10px;
}
.l3d-ve-range-row input[type="range"] { width: 100%; accent-color: #38bdf8; cursor: ew-resize; }
.l3d-ve-number-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}
.l3d-ve-number-wrap input { padding-right: 31px !important; text-align: right; }
.l3d-ve-number-wrap b {
  position: absolute;
  right: 8px;
  color: #71717a;
  font-size: 8px;
  pointer-events: none;
}

.l3d-ve-color-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; }
.l3d-ve-color-row input[type="color"] {
  width: 46px;
  height: 36px;
  padding: 3px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #111113;
  cursor: pointer;
}
.l3d-ve-color-row input[type="text"] { text-transform: uppercase; }

.l3d-ve-check > span {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.l3d-ve-check input { position: absolute; opacity: 0; pointer-events: none; }
.l3d-ve-check i {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 34px;
  border: 1px solid #52525b;
  border-radius: 999px;
  background: #27272a;
  transition: .18s ease;
}
.l3d-ve-check i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a1a1aa;
  transition: .18s ease;
}
.l3d-ve-check input:checked + i { border-color: #10b981; background: rgba(16,185,129,.18); }
.l3d-ve-check input:checked + i::after { transform: translateX(16px); background: #10b981; }
.l3d-ve-check b { color: #d4d4d8; font-size: 9.5px; }

.l3d-ve-file-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.l3d-ve-file-row label {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #27272a;
  cursor: pointer;
}
.l3d-ve-file-row label:hover { background: #303034; }
.l3d-ve-file-row label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.l3d-ve-file-row label b { color: #f4f4f5; font-size: 9px; }
.l3d-ve-file-row button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.l3d-ve-file-row button:hover:not(:disabled) { border-color: #fb7185; color: #fb7185; }
.l3d-ve-file-row button:disabled { opacity: .35; cursor: default; }
.l3d-ve-field.uploading { opacity: .62; pointer-events: none; }
.l3d-ve-field.uploading::after { content: "Enviando imagem…"; color: #7dd3fc; font-size: 9px; }

.l3d-ve-empty {
  padding: 28px 16px;
  border: 1px dashed rgba(255,255,255,.10);
  border-radius: 11px;
  color: #8f8f99;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.l3d-ve-confirm {
  position: fixed;
  inset: 0;
  z-index: 62000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(12px);
  font-family: Inter, "Segoe UI", sans-serif;
}
.l3d-ve-confirm[hidden] { display: none !important; }
.l3d-ve-confirm-card {
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 17px;
  background: #18181b;
  color: #f4f4f5;
  box-shadow: 0 30px 100px rgba(0,0,0,.68);
}
.l3d-ve-confirm-card > span { color: #fbbf24; font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.l3d-ve-confirm-card h2 { margin: 7px 0 8px; font-size: 18px; }
.l3d-ve-confirm-card p { margin: 0; color: #a1a1aa; font-size: 11px; line-height: 1.55; }
.l3d-ve-confirm-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.l3d-ve-confirm-card button { min-height: 40px; padding: 8px 11px; border: 1px solid #3f3f46; border-radius: 9px; background: #27272a; color: #f4f4f5; font-size: 10px; font-weight: 800; cursor: pointer; }
#l3dVeDiscard { border-color: rgba(251,113,133,.28); background: rgba(251,113,133,.09); color: #fb7185; }

.l3d-ve-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 63000;
  max-width: min(520px, calc(100% - 28px));
  padding: 11px 15px;
  border: 1px solid rgba(16,185,129,.28);
  border-radius: 10px;
  background: rgba(17,17,19,.95);
  color: #d1fae5;
  box-shadow: 0 16px 48px rgba(0,0,0,.48);
  font: 700 10.5px/1.45 Inter, "Segoe UI", sans-serif;
  text-align: center;
  transform: translate(-50%, 24px);
  opacity: 0;
  visibility: hidden;
  transition: .22s ease;
}
.l3d-ve-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.l3d-ve-toast.error { border-color: rgba(251,113,133,.32); color: #fecdd3; }

@media (max-width: 760px) {
  body.l3d-ve-editing { padding-top: 116px !important; }
  .l3d-ve-toolbar { top: 6px; width: calc(100% - 12px); min-height: 102px; flex-wrap: wrap; padding: 7px; border-radius: 13px; }
  .l3d-ve-brand { min-width: 0; flex: 1 1 190px; }
  .l3d-ve-theme { order: 2; }
  .l3d-ve-toolbar-spacer { display: none; }
  .l3d-ve-status { order: 2; flex: 1 1 120px; text-align: right; }
  .l3d-ve-icon-button { order: 3; }
  .l3d-ve-save { order: 3; flex: 1 1 150px; }
  .l3d-ve-exit { order: 3; }
  .l3d-ve-inspector { width: calc(100% - 16px) !important; max-height: calc(100vh - 126px); left: 8px !important; top: 116px !important; }
  .l3d-ve-selection-outline span { display: none; }
}

/* V52 REV7 — navegação por camadas e organização dos estados */
.l3d-ve-selection-tools {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto auto minmax(0,1fr);
  align-items: center;
  gap: 6px;
  padding: 8px 10px 0;
}
.l3d-ve-selection-tools button,
.l3d-ve-inspector-actions button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: #d4d4d8;
  font: 750 9px/1.2 Inter,"Segoe UI",sans-serif;
  cursor: pointer;
}
.l3d-ve-selection-tools button:hover:not(:disabled),
.l3d-ve-inspector-actions button:hover:not(:disabled) { background: rgba(255,255,255,.09); color: #fff; }
.l3d-ve-selection-tools button:disabled { opacity: .28; cursor: default; }
.l3d-ve-selection-tools span {
  min-width: 0;
  overflow: hidden;
  color: #71717a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.l3d-ve-field-heading {
  display: grid;
  gap: 3px;
  margin-top: 2px;
  padding: 10px 3px 3px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.l3d-ve-field-heading:first-child { margin-top: 0; border-top: 0; padding-top: 2px; }
.l3d-ve-field-heading strong {
  color: #7dd3fc;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.l3d-ve-field-heading small { color: #71717a; font-size: 8px; line-height: 1.4; }

.l3d-ve-inspector-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 9px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.065);
  background: rgba(0,0,0,.12);
}
.l3d-ve-inspector-actions button[hidden] { display: none !important; }
#l3dVeResetSelection { color: #fda4af; border-color: rgba(251,113,133,.2); }
#l3dVeCopyTheme { color: #7dd3fc; border-color: rgba(56,189,248,.2); }

@media (max-width: 760px) {
  .l3d-ve-selection-tools { grid-template-columns: 1fr 1fr; }
  .l3d-ve-selection-tools span { grid-column: 1 / -1; text-align: left; }
  .l3d-ve-inspector-actions { grid-template-columns: 1fr; }
}
