/* ============================================================
   APARATO DESIGN — MAPA DE PONTOS DE LUZ
   Estética: minimalista, artístico, elegante.
   Fundo claro/creme fora do mapa; mapa noturno escuro preservado.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Paleta Aparato Design ── */
  --cream:       #F5F2EE;        /* fundo principal — papel creme */
  --cream-dark:  #EDE9E2;        /* bordas, divisores */
  --cream-mid:   #E0D9CF;        /* hover sutil */
  --ink:         #1A1714;        /* texto principal — quase preto quente */
  --ink-mid:     #4A4440;        /* texto secundário */
  --ink-light:   #8A8280;        /* placeholders, hints */

  /* ── Acento: dourado/âmbar Aparato ── */
  --gold:        #C8A96E;        /* dourado artesanal — botões, marcadores */
  --gold-bright: #D9BF8C;        /* hover dourado */
  --gold-dim:    #A8894E;        /* pressed / accent escuro */
  --gold-glow:   rgba(200,169,110,0.55);

  /* ── Mapa noturno ── */
  --map-bg:      #0E0B08;

  /* ── Utilitários ── */
  --line:        rgba(26, 23, 20, 0.12);
  --line-strong: rgba(26, 23, 20, 0.22);
  --shadow-sm:   0 2px 8px rgba(26, 23, 20, 0.10);
  --shadow-md:   0 8px 28px rgba(26, 23, 20, 0.16);
  --shadow-lg:   0 20px 60px rgba(26, 23, 20, 0.22);
  --radius:      2px;            /* cantos quase retos — minimalista */

  /* ── Tipografia ── */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout raiz ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ============================================================
   HEADER / TOPBAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  height: 64px;
  background: var(--cream);
  border-bottom: 1px solid var(--line-strong);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: lowercase;
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink-light);
  line-height: 1;
}

/* ── Stats counter ── */
.stats {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
}

.stats-number {
  font-size: 20px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.stats-label {
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* ── Admin controls ── */
.admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Primário — dourado sólido */
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* Secundário — contorno */
.btn-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-mid);
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}

/* Ghost — para o header (sobre creme) */
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-mid);
}
.btn-ghost:hover {
  background: var(--cream-mid);
  border-color: var(--line-strong);
  color: var(--ink);
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold-dim);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.hidden { display: none !important; }

/* ============================================================
   MAPA
   ============================================================ */
main {
  position: relative;
  flex: 1;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: var(--map-bg);
  z-index: 0; /* prende as camadas do Leaflet dentro do mapa */
}

/* ── Marcador individual de Ponto de Luz ── */
.sale-glow-wrapper { background: none !important; border: none !important; }
.sale-glow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background-color: var(--cream-dark);
  background-size: cover;
  background-position: center;
  box-shadow:
    0 0 0 3px rgba(200,169,110,0.18),
    0 0 14px 5px rgba(200,169,110,0.40),
    0 2px 8px rgba(0,0,0,0.55);
  transition: transform 0.15s ease;
}
.sale-glow:hover { transform: scale(1.12); }

/* ── Cluster ── */
.cluster-glow-wrapper { background: none !important; border: none !important; }
.cluster-glow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright) 0%, var(--gold) 60%, var(--gold-dim) 100%);
  border: 1.5px solid rgba(255,255,255,0.20);
  box-shadow:
    0 0 12px 4px rgba(200,169,110,0.50),
    0 0 32px 14px rgba(200,169,110,0.22),
    0 4px 12px rgba(0,0,0,0.50);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cluster-glow span {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -0.02em;
}

/* ── Popup Leaflet ── */
.leaflet-popup-content-wrapper {
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
  padding: 0;
}
.leaflet-popup-content { margin: 0; }
.leaflet-popup-tip { background: var(--cream); }

.popup-card { width: 220px; padding: 14px; box-sizing: border-box; }
.popup-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--line);
  display: block;
}
.popup-card h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--ink);
  line-height: 1.2;
}
.popup-card p {
  margin: 3px 0;
  font-size: 12px;
  color: var(--ink-mid);
  line-height: 1.4;
}
.popup-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-light);
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.popup-delete {
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8B3A3A;
  background: none;
  border: 1px solid rgba(139,58,58,0.35);
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.popup-delete:hover { background: rgba(139,58,58,0.08); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}
.empty-card {
  pointer-events: all;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 360px;
  text-align: left;
}
.empty-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}
.empty-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.2;
}
.empty-card p {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.6;
}
.empty-actions { margin-top: 20px; }

/* ============================================================
   FAB — botão flutuante de adicionar Ponto de Luz
   ============================================================ */
.fab {
  position: absolute;
  bottom: 32px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-size: 26px;
  border: none;
  box-shadow:
    0 0 0 1px rgba(200,169,110,0.30),
    0 8px 24px rgba(14,11,8,0.55);
  cursor: pointer;
  z-index: 15;
  transition: background 0.18s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fab:hover {
  background: var(--gold);
  color: var(--ink);
  transform: scale(1.06);
}
.fab:active { transform: scale(0.95); }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.50);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px 32px 36px;
  position: relative;
}
.modal-small { max-width: 360px; }

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--ink); }

.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 6px;
  display: block;
}

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 22px;
  line-height: 1.15;
}

/* ── Campos de formulário ── */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}

.field-inline { display: flex; gap: 8px; }
.field-inline input { flex: 1; }
.field-hint {
  font-size: 11.5px;
  color: var(--ink-light);
  margin: -6px 0 14px;
  line-height: 1.5;
}
.field-error {
  font-size: 11.5px;
  color: #8B3A3A;
  margin: -6px 0 12px;
}

/* ── Tabs de localização ── */
.location-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.tab-btn {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line-strong);
  cursor: pointer;
  color: var(--ink-mid);
  transition: background 0.15s, color 0.15s;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active {
  background: var(--ink);
  color: var(--cream);
}
.tab-btn:not(.active):hover {
  background: var(--cream-mid);
  color: var(--ink);
}

/* ── Mini-mapa no modal ── */
.mini-map {
  height: 230px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  margin-bottom: 8px;
  cursor: crosshair;
  overflow: hidden;
}

.coords-readout {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-light);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

/* ── Lista de Pontos de Luz (catálogo) ── */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}
.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.product-row:hover { border-color: var(--gold); }
.product-row img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
  flex-shrink: 0;
  background: var(--cream-dark);
}
.product-info { flex: 1; min-width: 0; }
.product-info strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-info span {
  font-size: 11px;
  color: var(--ink-light);
}
.product-row-actions { display: flex; gap: 6px; }
.icon-btn {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--ink-mid);
  font-family: var(--font-body);
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn.danger { color: #8B3A3A; border-color: rgba(139,58,58,0.35); }
.icon-btn.danger:hover { background: rgba(139,58,58,0.06); }

.image-preview-wrap { margin: -4px 0 16px; }
.image-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.empty-note {
  font-size: 12.5px;
  color: var(--ink-light);
  text-align: center;
  padding: 16px 0;
  font-style: italic;
  font-family: var(--font-display);
}

/* ============================================================
   FOOTER — idêntico ao site original aparatodesign.store
   ============================================================ */
.site-footer {
  background: #4B181B; /* vermelho vinho mais escuro */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 40px;
  height: 52px;
  flex-shrink: 0;
  gap: 16px;
  border-top: 2px solid rgba(255,255,255,0.06);
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
}

.footer-links a,
.footer-instagram {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: text-decoration 0.15s;
}

.footer-links a:hover,
.footer-instagram:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-instagram {
  flex-shrink: 0;
  font-style: italic;
}

/* crédito do mapa (leaflet) — escondido, coberto pelo footer */
.map-credit { display: none; }


/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 768px) {
  .topbar {
    padding: 0 18px;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }
  .brand-sub { display: none; }
  .stats {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-top: 2px;
  }
  .modal-card { padding: 24px 20px 28px; }
  .fab { bottom: 90px; right: 18px; width: 48px; height: 48px; font-size: 22px; }

  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 22px 18px;
  }
  .footer-copy { text-align: center; }
}

@media (max-width: 480px) {
  .admin-controls .btn-ghost span { display: none; }
  .footer-links { gap: 16px; }
}

/* Respeita usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
  .btn, .fab, .sale-glow { transition: none; }
}

/* ── Upload de imagem no catálogo ── */
.file-input {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-light);
  padding: 8px 0;
  background: none;
  border: none;
}
.file-input::file-selector-button {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 7px 14px;
  margin-right: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}
.file-input::file-selector-button:hover { background: var(--gold); color: var(--ink); }

.field-or {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-align: center;
  margin: 14px 0 10px;
}
