/* ============================================================
   Editor minisitio — mobile-first (F1)
   Reusa tokens v2.0 de style.css. Reglas clave:
   - inputs ≥16px (anti-zoom iOS, hallazgo 9)
   - targets ≥44px (hallazgo 9)
   - barra sticky de guardado (hallazgo 10) + safe-area
   ============================================================ */

.editor-body { background: var(--color-bg); }

/* Scope .editor para no contaminar el resto del sitio */
.editor input, .editor textarea, .editor select { font-size: 16px; }
.editor input, .editor textarea, .editor select, .editor .btn { min-height: 44px; }
.editor .btn { padding: 12px 18px; }
.editor input, .editor textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid #d8cdbc;
  border-radius: 8px; font-family: var(--font-body); margin-bottom: 4px;
}
.editor input:focus, .editor textarea:focus { outline: none; border-color: var(--color-primary); }
.editor textarea { resize: vertical; min-height: 72px; }
.editor label { display: block; font-weight: 700; font-size: .85rem; margin: 14px 0 4px; color: var(--color-text); }
.editor .hint { font-size: .76rem; opacity: .6; margin-bottom: 6px; }

/* Login */
.editor-body .login-box { border-top: 4px solid var(--color-secondary); }

/* Dashboard */
.ed-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 28px 0 6px; }
.ed-dash-head h1 { font-family: var(--font-heading); color: var(--color-primary); font-size: 1.7rem; }
.ed-btn-logout { border-color: rgba(255,255,255,.5); }
.ed-dash-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.ed-dash-actions .btn { flex: 1; min-width: 160px; text-align: center; }
.ed-updated { font-size: .82rem; opacity: .6; margin: 6px 0 14px; }
.ed-sections { display: grid; gap: 12px; padding-bottom: 40px; }
.ms-section-card {
  background: #fff; border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow-card); border-top: 3px solid var(--color-secondary);
  display: flex; align-items: center; gap: 12px; min-height: 64px; cursor: pointer;
  border: none; width: 100%; text-align: left; font-family: var(--font-body);
  border-top: 3px solid var(--color-secondary);
}
.ms-section-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.ms-section-card .icono { font-size: 1.6rem; }
.ms-section-card h4 { font-family: var(--font-heading); color: var(--color-primary); font-size: 1.05rem; }
.ms-section-card .sub { font-size: .8rem; opacity: .65; }
.ms-section-card .estado { margin-left: auto; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.estado-ok { color: #2e7d32; }
.estado-pend { color: var(--color-secondary-strong); }

/* Editor de sección */
.ed-back {
  background: none; border: none; color: var(--color-primary); font-weight: 700;
  font-size: .95rem; padding: 16px 0 4px; cursor: pointer; font-family: var(--font-body);
}
#sec-titulo { font-family: var(--font-heading); color: var(--color-primary); font-size: 1.5rem; margin: 4px 0 6px; }

/* Bloque compartidos (D6: solo-lectura) */
.sec-compartidos-box {
  background: #fff; border: 1.5px dashed var(--color-secondary); border-radius: 10px;
  padding: 14px 16px; margin: 12px 0 4px; font-size: .88rem; opacity: .9;
}
.sec-compartidos-box .titulo { font-weight: 700; color: var(--color-primary); margin-bottom: 6px; font-size: .85rem; }
.sec-compartidos-box .fila { padding: 3px 0; }
.sec-compartidos-box .fila b { color: var(--color-text); }

/* Repetibles (cronograma, faq, timeline, tiendas, internacional) */
.rep-item {
  background: #fff; border: 1.5px solid #e6ddcc; border-radius: 10px;
  padding: 12px 12px 6px; margin-bottom: 10px;
}
.rep-item .row { display: flex; gap: 8px; align-items: flex-start; }
.rep-item .row .grow { flex: 1; min-width: 0; }
.rep-item .btn-quitar {
  min-width: 44px; min-height: 44px; border: 1.5px solid #d9534f; color: #d9534f;
  background: #fff; border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: 700;
}
.btn-agregar {
  background: none; border: 1.5px dashed var(--color-primary); color: var(--color-primary);
  border-radius: 8px; padding: 10px 14px; font-weight: 700; cursor: pointer;
  width: 100%; font-size: .92rem; font-family: var(--font-body); min-height: 44px;
}
.btn-agregar:disabled { opacity: .5; cursor: not-allowed; }

/* Toggle mesa de regalos */
.editor .toggle { min-height: 44px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.editor .toggle input { width: 22px; height: 22px; min-height: 22px; }

/* Galería */
.gal-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.gal-thumb { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-card); background: #eee; }
.gal-thumb img { width: 100%; height: auto; max-height: 120px; object-fit: cover; display: block; }
.gal-thumb .overlay {
  position: absolute; inset: 0; background: rgba(60,36,21,.55); color: #fff;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; padding: 4px;
}
.gal-thumb:hover .overlay, .gal-thumb.tocando .overlay { opacity: 1; }
.gal-thumb .overlay button {
  min-width: 40px; min-height: 40px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.92); color: var(--color-primary); font-weight: 700;
  cursor: pointer; font-size: .82rem;
}
.gal-thumb .portada-badge {
  position: absolute; top: 4px; left: 4px; background: var(--color-secondary);
  color: #fff; font-size: .62rem; font-weight: 700; border-radius: 6px; padding: 2px 6px;
}
.gal-contador { font-size: .8rem; opacity: .65; margin: 6px 0; }
.gal-progress { height: 6px; background: var(--color-track); border-radius: 99px; overflow: hidden; margin: 6px 0; display: none; }
.gal-progress .fill { height: 100%; background: var(--color-secondary); width: 0; transition: width .3s; }

/* Timeline imagen por hito (P1.6) */
.rep-item .r-imagen-thumb { margin: 6px 0; }
.rep-item .r-imagen-thumb img { width: 100%; height: auto; max-height: 140px; object-fit: cover; border-radius: 8px; display: block; }
.rep-item .r-imagen-file { font-size: .8rem; margin-top: 4px; }

/* Preview regalos */
.preview-box {
  background: var(--color-bg); border: 1.5px dashed var(--color-secondary);
  border-radius: 10px; padding: 14px 16px; margin-top: 18px; font-size: .88rem;
}
.preview-box summary { font-weight: 700; color: var(--color-primary); cursor: pointer; }
.preview-box .preview-inner { margin-top: 10px; }

/* Estados / banners */
.banner-draft { background: #e8f1fb; border: 1.5px solid #5b8dd9; color: #2c4f8a; }
.banner-offline { background: #fff7e6; border: 1.5px solid #e6a23c; color: #8a5a10; }
.banner-publicada { background: #eaf7ea; border: 1.5px solid #2e8b57; color: #1e6b3e; }
.banner-draft, .banner-offline, .banner-publicada { padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin-bottom: 12px; }
.editor-error { color: #d9534f; font-size: .85rem; font-weight: 700; margin-top: 10px; }
.editor .readonly-note { font-size: .78rem; opacity: .65; margin-top: 2px; }

/* Barra sticky de guardado — zona del pulgar (hallazgo 10) */
.editor-savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1.5px solid var(--color-secondary);
  box-shadow: 0 -4px 14px rgba(60,36,21,.10);
}
.editor-savebar .btn { flex: 1; min-height: 48px; }

/* Toast */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--color-text); color: #fff; padding: 12px 22px; border-radius: 8px; font-size: .9rem; opacity: 0; transition: opacity .3s; z-index: 200; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }

@media (min-width: 821px) {
  .gal-thumbs { grid-template-columns: repeat(5, 1fr); }
  .editor .container { max-width: 720px; }
}
