/* ════════════════════════════════════════════════════════════
   CAL-BIN — Editor de textos/imágenes para el administrador
   ════════════════════════════════════════════════════════════ */

#admin-edit-bar {
  position: fixed; left: 14px; bottom: 14px; z-index: 3000;
  background: #11141b; border: 1px solid #ff8c00; border-radius: 10px;
  padding: 9px 14px; display: none; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 12px; color: #c8d6e5;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5); flex-wrap: wrap; max-width: 92vw;
}
#admin-edit-bar.show { display: flex; }
#admin-edit-bar .aeb-title { color: #ff8c00; font-weight: 700; letter-spacing: 1px; }
#admin-edit-bar button {
  background: #1d222d; color: #ff8c00; border: 1px solid #ff8c00;
  padding: 6px 14px; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 12px; transition: all .15s;
}
#admin-edit-bar button:hover { background: #ff8c00; color: #1a1500; }
#admin-edit-bar #aeb-save { border-color: #2ecc71; color: #2ecc71; }
#admin-edit-bar #aeb-save:hover { background: #2ecc71; color: #04210f; }
#admin-edit-bar #aeb-msg { color: #8a91a3; }

/* Texto editable resaltado en modo edición */
body.edit-mode [data-ed] {
  outline: 1px dashed #ff8c00; outline-offset: 2px;
  cursor: text; background: rgba(255,140,0,0.08); border-radius: 2px;
}
body.edit-mode [data-ed]:focus { outline: 2px solid #ff8c00; background: rgba(255,140,0,0.16); }

/* ── Edición de listas (marcas / modelos / tipos) en el index ── */
.list-box .item { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.list-box .item .item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-box .item .item-actions { display: none; gap: 2px; flex-shrink: 0; }
body.edit-mode .list-box .item .item-actions { display: flex; }
body.edit-mode .list-box .item { outline: 1px dashed rgba(255,140,0,0.4); outline-offset: -1px; }
.list-box .item .ia-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; padding: 2px 5px; opacity: 0.85; border-radius: 3px; line-height: 1;
}
.list-box .item .ia-btn:hover { opacity: 1; background: rgba(255,255,255,0.15); }
.list-box .item.selected .ia-btn:hover { background: rgba(0,0,0,0.2); }
.list-box .item .ia-btn.del:hover { background: rgba(255,91,91,0.3); }
/* Botón "+ Agregar" al final de la lista */
.list-box .item.add-item {
  justify-content: center; color: #2ecc71; font-weight: 600;
  border: 1px dashed #2ecc71; margin: 6px; border-radius: 5px;
  background: rgba(46,204,113,0.06); cursor: pointer;
}
.list-box .item.add-item:hover { background: rgba(46,204,113,0.16); padding-left: 0 !important; }

/* Imágenes reemplazables en modo edición */
body.edit-mode [data-ed-img] {
  outline: 2px dashed #00b8ff; outline-offset: 3px; cursor: pointer;
}
.ed-img-wrap { position: relative; }
.ed-img-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 50; background: rgba(0,0,0,0.78); color: #00b8ff;
  border: 1px solid #00b8ff; border-radius: 6px; padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; cursor: pointer;
  display: none; white-space: nowrap;
}
body.edit-mode .ed-img-wrap:hover .ed-img-btn { display: block; }
.ed-img-btn:hover { background: #00b8ff; color: #001722; }
