﻿/* ==========================================================================
   Modo Editor â€” estilos
   Paleta escura + dourado, alinhada ao painel /admin/
   ========================================================================== */

/* variaveis globais: o painel /admin/ usa os mesmos tokens sem ter #ed-root.
   prefixo --ed- evita conflito com o tema do site publico. */
:root {
  --ed-bg: #14161c;
  --ed-bg2: #1c1f27;
  --ed-lin: #2c303b;
  --ed-txt: #eceef2;
  --ed-mut: #969db0;
  --ed-gold: #d4af37;
  --ed-gold2: #b58751;
  --ed-ok: #4ade80;
  --ed-er: #f87171;
  --ed-raio: 10px;
  --ed-sombra: 0 18px 50px rgba(0, 0, 0, .55);
}

#ed-root {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ------------------------------------------------------------------ barra */
.ed-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2147483001;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px; background: var(--ed-bg); border-bottom: 1px solid var(--ed-lin);
  transform: translateY(-110%); transition: transform .25s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.ed-bar.ed-show { transform: translateY(0); }
.ed-bar-brand { display: flex; align-items: baseline; gap: 12px; color: var(--ed-txt); min-width: 0; }
.ed-bar-brand b { color: var(--ed-gold); letter-spacing: .3px; white-space: nowrap; }
.ed-bar-brand span { color: var(--ed-mut); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-bar-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.ed-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--ed-lin); background: var(--ed-bg2); color: var(--ed-txt);
  font-size: 13px; font-weight: 600; text-decoration: none; line-height: 1.4;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.ed-btn:hover { border-color: var(--ed-gold); transform: translateY(-1px); }
.ed-btn-primary { background: linear-gradient(135deg, var(--ed-gold), var(--ed-gold2)); color: #14161c; border-color: transparent; }
.ed-btn-primary:hover { filter: brightness(1.08); }
.ed-btn-ghost { background: transparent; color: var(--ed-mut); }
.ed-btn-ghost:hover { color: var(--ed-txt); }

/* ------------------------------------------------------------------ alvos */
body.ed-on [data-ed-key],
body.ed-on .ed-target {
  outline: 1px dashed rgba(212, 175, 55, .5);
  outline-offset: 3px; border-radius: 4px; cursor: pointer;
  transition: outline-color .15s ease, background .15s ease;
}
body.ed-on .ed-target:hover { outline: 2px solid var(--ed-gold); background: rgba(212, 175, 55, .08); }
body.ed-on .ed-target-img { outline-offset: 4px; border-radius: 4px; cursor: pointer; }
body.ed-on .ed-target-img:hover { outline: 2px solid var(--ed-gold); }

/* Background targets no modo editor */
body.ed-on .ed-target-bg {
  outline: 2px dashed rgba(212, 175, 55, .45);
  outline-offset: -2px;
  position: relative;
  transition: outline-color .15s ease;
}
body.ed-on .ed-target-bg:hover {
  outline: 2px solid var(--ed-gold);
}

.ed-bg-badge {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10000;
  background: var(--ed-bg2);
  border: 1px solid var(--ed-gold);
  color: var(--ed-gold);
  border-radius: 8px;
  padding: 6px 12px;
  font: 700 12px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
  align-items: center;
  gap: 6px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.ed-bg-badge:hover {
  background: var(--ed-gold);
  color: #14161c;
  transform: scale(1.05);
}
body.ed-on .ed-target-bg > .ed-bg-badge {
  display: inline-flex;
}

/* Imagens e fundos ocultados */
.ed-hidden {
  display: none !important;
}
body.ed-on img.ed-hidden {
  display: inline-block !important;
  opacity: 0.35 !important;
  filter: grayscale(100%) !important;
  outline: 2px dashed #f87171 !important;
  outline-offset: 3px;
  min-width: 48px;
  min-height: 48px;
}
body.ed-on .ed-bg-hidden {
  outline: 2px dashed #f87171 !important;
}
body.ed-on .ed-bg-hidden > .ed-bg-badge {
  border-color: #f87171;
  color: #f87171;
}

/* ------------------------------------------- cards/blocos ocultos */
/* Para o visitante o card some por completo. No modo editor ele vira um
   "fantasma" tracejado, para o admin conseguir reexibir sem adivinhar onde
   ficava. O display usa --display para devolver o flex dos containers do
   Elementor em vez de forcar block. */
.ed-card-hidden {
  display: none !important;
}
body.ed-on .ed-card-hidden {
  display: var(--display, block) !important;
  opacity: .4 !important;
  filter: grayscale(100%) !important;
  outline: 2px dashed #f87171 !important;
  outline-offset: -4px;
}
body.ed-on [data-ed-block-key] {
  position: relative;
}

.ed-block-badge {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10000;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ed-gold);
  background: var(--ed-bg2);
  color: var(--ed-gold);
  font: 700 12px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.ed-block-badge:hover {
  background: var(--ed-gold);
  color: #14161c;
  transform: scale(1.05);
}
.ed-block-badge-secao {
  left: 12px;
  right: auto;
}
body.ed-on .ed-block-badge {
  display: inline-flex;
  opacity: 1 !important;
  filter: none !important;
}

.ed-btn-danger {
  border-color: rgba(248, 113, 113, .4) !important;
  color: #f87171 !important;
}
.ed-btn-danger:hover {
  border-color: #f87171 !important;
  background: rgba(248, 113, 113, .12) !important;
}

/* ------------------------------------------------------------------ modais */
.ed-modal {
  position: fixed; inset: 0; z-index: 2147483002;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8, 9, 12, .72); backdrop-filter: blur(4px);
}
.ed-modal.ed-open { display: flex; }
.ed-card {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--ed-bg); border: 1px solid var(--ed-lin); border-radius: 14px;
  padding: 24px; color: var(--ed-txt); box-shadow: var(--ed-sombra);
}
.ed-card h2 { margin: 0 0 6px; font-size: 19px; color: var(--ed-gold); }
.ed-muted { margin: 0 0 18px; color: var(--ed-mut); font-size: 13px; }
.ed-card label { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ed-mut); }
.ed-card input, .ed-card textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  background: #0f1116; border: 1px solid var(--ed-lin); border-radius: 8px;
  color: var(--ed-txt); font: inherit; font-size: 14px; text-transform: none; letter-spacing: normal;
}
.ed-card input:focus, .ed-card textarea:focus { outline: none; border-color: var(--ed-gold); }
.ed-card textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.ed-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.ed-img-prev { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #0f1116; border: 1px solid var(--ed-lin); border-radius: 8px; margin-bottom: 16px; }
.ed-card input[type=file] { padding: 8px; font-size: 13px; }

/* Botão de Delivery no widget (info) */
.delivery-widget-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .42rem .9rem;
  border-radius: 999px;
  background: var(--aux-accent, #d8a95f);
  color: #111 !important;
  font-weight: 600;
  text-decoration: none !important;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 24px -18px rgba(216,169,95,.95);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.delivery-widget-btn:hover,
.delivery-widget-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -18px rgba(216,169,95,1);
  filter: brightness(1.02);
  outline: none;
}
.delivery-widget-btn:active { transform: translateY(0); }
.delivery-widget-btn span { color: inherit !important; }

/* BotÃ£o de Delivery (CTA) */
.delivery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .48rem 1.25rem;
  border-radius: 999px;
  background: var(--aux-accent, #d8a95f);
  color: #111 !important;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 24px -18px rgba(216,169,95,.95);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
  line-height: 1;
}
.delivery-btn:hover,
.delivery-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px -18px rgba(216,169,95,1);
  filter: brightness(1.02);
  outline: none;
}
.delivery-btn:active { transform: translateY(0); }
.delivery-btn .aux-menu-label,
.delivery-btn span { color: inherit !important; }
@media (max-width: 768px) {
  .delivery-btn { padding: .42rem .95rem; font-size: .98rem; }
}

/* ------------------------------------------- banco de imagens no modo editor */
.ed-bank-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: -2px 0 14px; }
.ed-bank-count { font-size: 11px; color: var(--ed-mut); }
.ed-bank {
  margin: 0 0 14px; padding: 10px; border: 1px solid var(--ed-lin);
  border-radius: 8px; background: #0f1116;
}
.ed-bank-search { margin: 0 0 10px !important; }
.ed-bank-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px; max-height: 230px; overflow-y: auto;
}
.ed-bank-item {
  display: block; width: 100%; padding: 4px; cursor: pointer;
  background: #171a21; border: 1px solid var(--ed-lin); border-radius: 6px;
  text-align: left; transition: border-color .15s;
}
.ed-bank-item:hover, .ed-bank-item:focus { border-color: var(--ed-gold); outline: none; }
.ed-bank-item img { display: block; width: 100%; height: 62px; object-fit: cover; border-radius: 4px; background: #0a0c10; }
.ed-bank-item span { display: block; margin-top: 5px; font-size: 10px; line-height: 1.2; color: var(--ed-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-bank-info { margin: 8px 0 0; font-size: 11px; color: var(--ed-mut); }

/* ------------------------------------------------------------------ toast */
.ed-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px);
  z-index: 2147483003; padding: 11px 20px; border-radius: 999px;
  background: var(--ed-bg2); border: 1px solid var(--ed-lin); color: var(--ed-txt);
  font: 600 13px/1.3 "Segoe UI", system-ui, sans-serif; box-shadow: var(--ed-sombra);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.ed-toast.ed-show { opacity: 1; transform: translate(-50%, 0); }
.ed-toast.ed-ok { border-color: var(--ed-ok); color: var(--ed-ok); }
.ed-toast.ed-erro { border-color: var(--ed-er); color: var(--ed-er); }

/* ------------------------------------------------------------------ galeria (admin) */
.gal-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.gal-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.gal-filtros button { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--ed-lin); background: transparent; color: var(--ed-mut); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.gal-filtros button.on { background: var(--ed-gold); color: #14161c; border-color: transparent; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.gal-card { background: var(--ed-bg2); border: 1px solid var(--ed-lin); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s ease; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.gal-card:hover { border-color: #434958; transform: translateY(-2px); }
.gal-thumb-wrap { position: relative; width: 100%; height: 160px; background: #0c0e13; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gal-thumb { width: 100%; height: 100%; object-fit: contain; cursor: pointer; transition: transform .2s ease; }
.gal-thumb:hover { transform: scale(1.04); }
.gal-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gal-nome { font-size: 13px; font-weight: 600; color: var(--ed-txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-meta { font-size: 11px; color: var(--ed-mut); display: flex; justify-content: space-between; align-items: center; }
.gal-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.gal-badge.upload { background: rgba(212, 175, 55, .15); color: var(--ed-gold); border: 1px solid rgba(212, 175, 55, .3); }
.gal-badge.site { background: rgba(150, 157, 176, .12); color: var(--ed-mut); border: 1px solid rgba(150, 157, 176, .2); }
.gal-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.05); }
.gal-actions button { flex: 1; padding: 7px 10px; font-size: 12px; border-radius: 7px; cursor: pointer; }

@media (max-width: 640px) {
  .ed-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ed-bar-actions { justify-content: stretch; }
  .ed-bar-actions .ed-btn { flex: 1; justify-content: center; }
  .gal-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

