/*
 * AERON Lotes — estilos base. Sem película global: só os lotes recebem cor.
 * A ficha do lote usa variáveis (--aeron-lotes-*) que cada skin define no seu tema.
 */

.aeron-lotes-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.aeron-lotes-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.aeron-lotes-lot path {
  fill-opacity: 0.32;
  stroke: #ffffff;
  stroke-opacity: 0.95;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: fill-opacity 0.12s ease;
}

.aeron-lotes-lot.is-hover path {
  fill-opacity: 0.55;
  stroke-width: 2.5;
}

.aeron-lotes-lot.is-selected path {
  fill-opacity: 0.6;
  stroke: #ffd60a;
  stroke-width: 3;
}

.aeron-lotes-lot text,
.aeron-lotes-draft text,
.aeron-lotes-debug text {
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  paint-order: stroke;
  stroke-linejoin: round;
}

.aeron-lotes-lot text {
  fill: #ffffff;
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 3px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* ---------- Edição ---------- */

.aeron-lotes-quadra {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.aeron-lotes-handle {
  pointer-events: all;
  cursor: grab;
  touch-action: none;
  stroke: #111111;
  stroke-width: 2;
}

.aeron-lotes-handle:active {
  cursor: grabbing;
}

.aeron-lotes-handle--canto {
  fill: #ffffff;
}

.aeron-lotes-handle--divisao {
  fill: #ffd60a;
}

.aeron-lotes-handle--meio {
  fill: #ff8a00;
}

.aeron-lotes-draft line {
  stroke: #ffd60a;
  stroke-width: 2;
}

.aeron-lotes-draft line.rubber {
  stroke-dasharray: 6 5;
  stroke-opacity: 0.85;
}

.aeron-lotes-draft path.preview {
  fill: rgba(255, 214, 10, 0.16);
  stroke: #ffd60a;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.aeron-lotes-draft circle {
  fill: #ffd60a;
  stroke: #111111;
  stroke-width: 1.5;
}

.aeron-lotes-draft text {
  fill: #ffd60a;
  stroke: #000000;
  stroke-width: 3px;
}

.aeron-lotes-debug circle {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 2;
}

.aeron-lotes-debug line {
  stroke: #00e5ff;
  stroke-width: 1.5;
}

.aeron-lotes-debug text {
  fill: #00e5ff;
  stroke: #000000;
  stroke-width: 3px;
}

/* ---------- Barra do editor ---------- */

.aeron-lotes-toolbar,
.aeron-lotes-panel {
  font: 500 13px/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #ffffff;
}

.aeron-lotes-toolbar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2147483000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.aeron-lotes-toolbar__title {
  font-weight: 700;
  margin-right: 4px;
}

.aeron-lotes-toolbar button,
.aeron-lotes-panel button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #2a2a2a;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.aeron-lotes-toolbar button:hover,
.aeron-lotes-panel button:hover {
  background: #3a3a3a;
}

.aeron-lotes-toolbar button:disabled {
  opacity: 0.45;
  cursor: default;
}

.aeron-lotes-toolbar button[aria-pressed="true"],
.aeron-lotes-panel button[aria-pressed="true"] {
  background: #ffd60a;
  border-color: #ffd60a;
  color: #111111;
}

.aeron-lotes-toolbar button:focus-visible,
.aeron-lotes-toolbar input:focus-visible,
.aeron-lotes-panel button:focus-visible,
.aeron-lotes-panel input:focus-visible,
.aeron-lotes-panel select:focus-visible,
.aeron-lotes-panel textarea:focus-visible,
.aeron-lotes-panel summary:focus-visible {
  outline: 2px solid #ffd60a;
  outline-offset: 2px;
}

.aeron-lotes-toolbar [hidden],
.aeron-lotes-panel [hidden] {
  display: none !important;
}

.aeron-lotes-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.aeron-lotes-field input {
  width: 52px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: #000000;
  color: #ffffff;
  font: inherit;
}

.aeron-lotes-toolbar__saved {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.aeron-lotes-hint {
  position: fixed;
  left: 50%;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 72px);
  transform: translateX(-50%);
  z-index: 2147483000;
  max-width: calc(100vw - 32px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font: 500 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center;
  pointer-events: none;
}

.aeron-lotes-hint[hidden] {
  display: none;
}

/* ---------- Painel de propriedades (editor) ---------- */

.aeron-lotes-panel {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2147483000;
  width: min(300px, calc(100vw - 24px));
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.aeron-lotes-panel__toggle {
  margin: 8px;
  font-weight: 700 !important;
}

.aeron-lotes-panel__body {
  overflow-y: auto;
  padding: 0 14px 14px;
}

.aeron-lotes-panel.is-closed .aeron-lotes-panel__body {
  display: none;
}

.aeron-lotes-panel section,
.aeron-lotes-panel details {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.aeron-lotes-panel details[open] {
  display: grid;
}

.aeron-lotes-panel h3 {
  margin: 0;
  font-size: 15px;
}

.aeron-lotes-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.aeron-lotes-panel label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.aeron-lotes-panel input,
.aeron-lotes-panel select,
.aeron-lotes-panel textarea {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: #000000;
  color: #ffffff;
  font: inherit;
}

.aeron-lotes-panel textarea {
  resize: vertical;
}

.aeron-lotes-panel .aeron-lotes-panel__check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aeron-lotes-panel .aeron-lotes-panel__check input {
  width: auto;
  min-height: 0;
}

.aeron-lotes-panel__grid,
.aeron-lotes-panel__grid3 {
  display: grid;
  gap: 8px;
}

.aeron-lotes-panel__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aeron-lotes-panel__grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aeron-lotes-panel__status,
.aeron-lotes-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aeron-lotes-panel__code {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.aeron-lotes-panel__note {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.aeron-lotes-panel .aeron-lotes-panel__danger {
  border-color: rgba(229, 72, 77, 0.6);
  color: #ffb4b6;
}

/* ---------- Ficha do lote (modo tour) ---------- */

.aeron-lotes-card {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2147483000;
  display: grid;
  gap: 6px;
  width: min(300px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 18px 20px;
  border: var(--aeron-lotes-card-border, 0);
  border-radius: var(--aeron-lotes-card-radius, 14px);
  background: var(--aeron-lotes-card-bg, #ffffff);
  color: var(--aeron-lotes-card-fg, #111111);
  font-family: var(--aeron-lotes-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  line-height: 1.35;
  box-shadow: var(--aeron-lotes-card-shadow, 0 12px 32px rgba(0, 0, 0, 0.35));
}

.aeron-lotes-card[hidden] {
  display: none;
}

.aeron-lotes-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.aeron-lotes-card__close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.aeron-lotes-card__close:focus-visible,
.aeron-lotes-card__cta:focus-visible {
  outline: 2px solid var(--aeron-lotes-accent, #111111);
  outline-offset: 2px;
}

.aeron-lotes-card__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--aeron-lotes-eyebrow, #666666);
}

.aeron-lotes-card__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.aeron-lotes-card__status {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.aeron-lotes-card__dados {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 0;
}

.aeron-lotes-card__dados[hidden] {
  display: none;
}

.aeron-lotes-card__dados dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aeron-lotes-card-muted, #666666);
}

.aeron-lotes-card__dados dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.aeron-lotes-card__cta {
  display: block;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--aeron-lotes-accent, #111111);
  color: var(--aeron-lotes-accent-fg, #ffffff);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.aeron-lotes-card__cta[hidden],
.aeron-lotes-card__vendido[hidden] {
  display: none;
}

.aeron-lotes-card__vendido {
  margin: 6px 0 0;
  color: var(--aeron-lotes-card-muted, #666666);
  font-size: 13px;
}

/* ---------- Legenda (modo tour) ---------- */

.aeron-lotes-legend {
  position: fixed;
  left: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2147482000;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.82);
  color: #ffffff;
  font: 500 12px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}

.aeron-lotes-legend[hidden] {
  display: none;
}

.aeron-lotes-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aeron-lotes-legend__item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* Celular vertical: a base da tela costuma ser do crédito da skin. */
@media (max-width: 600px) {
  .aeron-lotes-legend {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px);
  }

  .aeron-lotes-card {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 96px);
  }
}
