/* ==========================================================================
   EDITOR.CSS — Estilos para modo edición inline
   Solo se carga cuando se activa el editor (?edit=true o Ctrl+Shift+E)
   ========================================================================== */

/* Body con editor activo */
.editor-active {
  padding-top: 56px;
}

/* ---------- TOOLBAR ---------- */
.editor-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: hsl(20, 18%, 11%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 10000;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  border-bottom: 1px solid hsl(73, 78%, 59%);
}

.editor-toolbar__left,
.editor-toolbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.editor-toolbar__label {
  background: hsl(73, 78%, 59%);
  color: hsl(20, 18%, 11%);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.editor-toolbar__page {
  opacity: 0.7;
  font-size: 0.8rem;
}

.editor-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.editor-btn:hover { background: rgba(255,255,255,0.15); }
.editor-btn:active { transform: scale(0.97); }

.editor-btn--primary {
  background: hsl(73, 78%, 59%);
  border-color: hsl(73, 78%, 59%);
  color: hsl(20, 18%, 11%);
  font-weight: 700;
}
.editor-btn--primary:hover {
  background: hsl(73, 80%, 65%);
  border-color: hsl(73, 80%, 65%);
}

.editor-btn--ghost { background: transparent; }

/* ---------- ELEMENTOS EDITABLES ---------- */
.editor-active [data-editable] {
  position: relative;
  transition: outline 0.15s ease;
  border-radius: 4px;
}

.editor-active [data-editable="text"]:hover {
  outline: 2px dashed hsla(73, 78%, 59%, 0.7);
  outline-offset: 4px;
  cursor: text;
}

.editor-active [data-editable="image"] {
  cursor: pointer;
}
.editor-active [data-editable="image"]:hover {
  outline: 3px dashed hsl(73, 78%, 59%);
  outline-offset: 4px;
}
.editor-active [data-editable="image"]:hover::after {
  content: '📷 Click para cambiar imagen';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.editor-active [data-editable="link"]:hover {
  outline: 2px dotted hsl(33, 78%, 60%);
  outline-offset: 4px;
}

.editor-editing {
  outline: 3px solid hsl(73, 78%, 59%) !important;
  outline-offset: 4px;
  background: hsla(73, 78%, 59%, 0.1);
  border-radius: 4px;
  min-height: 1em;
}

/* ---------- SIDEBAR (estilos) ---------- */
.editor-sidebar {
  position: fixed;
  top: 56px;
  right: 0;
  width: 340px;
  height: calc(100vh - 56px);
  background: hsl(20, 18%, 13%);
  color: white;
  overflow-y: auto;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.editor-sidebar--open { transform: translateX(0); }

.editor-sidebar__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: hsl(20, 18%, 13%);
  z-index: 1;
}
.editor-sidebar__header h3 {
  margin: 0;
  font-size: 1rem;
  font-family: inherit;
}
.editor-sidebar__close {
  background: none; border: none; color: white;
  font-size: 1.25rem; cursor: pointer; padding: 0.25rem 0.5rem;
}

.editor-sidebar__section {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.editor-sidebar__section h4 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsl(73, 78%, 59%);
  font-family: inherit;
  font-weight: 700;
}

.editor-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  gap: 1rem;
}
.editor-field:last-child { margin-bottom: 0; }
.editor-field > span {
  flex: 1;
  color: rgba(255,255,255,0.8);
}

.editor-field input[type="color"] {
  width: 44px; height: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

.editor-field select,
.editor-field input[type="text"],
.editor-field input[type="email"],
.editor-field input[type="tel"],
.editor-field input[type="url"] {
  flex: 0 0 auto;
  width: 180px;
  padding: 0.45rem 0.7rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: white;
  font-size: 0.8rem;
  font-family: inherit;
}
.editor-field input:focus, .editor-field select:focus {
  outline: none;
  border-color: hsl(73, 78%, 59%);
}

/* ---------- NOTIFICATION TOAST ---------- */
.editor-notification {
  position: fixed;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120px);
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  z-index: 10001;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.editor-notification--visible {
  transform: translateX(-50%) translateY(0);
}
.editor-notification--success { background: hsl(142, 70%, 38%); color: white; }
.editor-notification--error { background: hsl(0, 70%, 50%); color: white; }
.editor-notification--info { background: hsl(220, 70%, 50%); color: white; }

/* ---------- HELP HINT ---------- */
.editor-hint {
  position: fixed;
  bottom: 5rem; right: 2rem;
  background: hsl(20, 18%, 13%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: system-ui, sans-serif;
  max-width: 220px;
  z-index: 9998;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1px solid hsl(73, 78%, 59%);
}
.editor-hint strong { color: hsl(73, 78%, 59%); }

/* En modo edición, ocultar WhatsApp para que no estorbe */
.editor-active .whatsapp-btn { display: none; }
