/* =====================================================================
   Modo editor: apariencia FIJA e independiente de la tienda.
   Todo lo que está aquí solo afecta al editor (#ed), a su barra de abajo (#tb),
   a la paleta (#pal) y a los botones del editor. Los colores, fondos, tamaños y tipos de letra
   que cambies en la tienda NO modifican estos estilos.
   ===================================================================== */
#ed,#tb,#pal,#edtab{
  /* variables propias del editor: pisan las de la tienda solo dentro de estos elementos */
  --c1:#111111;--c2:#111111;--bg:#FFFFFF;--cd:#FFFFFF;--tx:#111111;--mu:#4B5563;--bd:#E5E7EB;--rad:8px;--ts:1;--sh:0 10px 30px #0000002e;
  --ed-ok:#047857;--ed-warn:#92400E;--ed-err:#B91C1C;
  color:#111111;font:15px/1.5 system-ui,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:normal;text-transform:none;text-align:left;
}
/* los estilos de «fondos» y «estilo de textos» de la tienda fuerzan colores en p, h1, a, small… ; aquí se vuelven a fijar */
#ed h1,#ed h2,#ed h3,#ed p,#ed a,#ed small,#ed label,#ed b,#ed summary,#ed span,#ed div,
#tb b,#tb span,#pal p,#pal small,#pal label,#pal b,#pal span{color:#111111!important;font-family:system-ui,"Segoe UI",Roboto,Arial,sans-serif!important}
#ed small,#ed .fl label,#ed label{color:#4B5563!important}
#ed h2{font-size:20px;margin:0;font-weight:700}
#ed h3{font-size:16px}
/* botones */
#ed .b,#tb .b,#pal .b,#edtab{font-family:system-ui,"Segoe UI",Roboto,Arial,sans-serif!important;border-radius:999px;font-size:15px;font-weight:700;transition:none}
#ed .b:hover,#tb .b:hover,#pal .b:hover{transform:none;box-shadow:0 2px 8px #0003}
#ed .b,#tb .b,#pal .b{background:#111111;color:#FFFFFF!important;border:1.5px solid #111111}
#ed .b.s,#tb .b.s,#pal .b.s{font-size:14px;padding:6px 12px}
#ed .b.g,#tb .b.g,#pal .b.g{background:#FFFFFF;color:#111111!important;border:1.5px solid #9CA3AF!important}
#ed .b.g:hover,#tb .b.g:hover,#pal .b.g:hover{background:#F3F4F6}
#ed .b.r,#tb .b.r{background:#B91C1C;color:#FFFFFF!important;border-color:#B91C1C!important}
#ed .b:disabled,#tb .b:disabled{opacity:.5}
/* pestañas: la elegida va en negro con texto blanco (los botones .b.s sin .g) */
#ed .tabs{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
/* campos */
#ed input,#ed select,#ed textarea,#pal input,#pal select{background:#FFFFFF!important;color:#111111!important;border:1px solid #D1D5DB;border-radius:8px;font:inherit;font-size:15px}
#ed .fl input,#ed .fl select,#ed .fl textarea{width:100%;padding:8px}
#ed input[type=checkbox],#ed input[type=radio]{width:auto}
#ed input[type=color]{padding:0;height:36px}
#ed input::placeholder,#ed textarea::placeholder{color:#6B7280}
#ed .fl label{display:block;margin:10px 0 3px;font-size:14px}
#ed details{border:1px solid #E5E7EB;border-radius:8px;padding:6px 10px;margin:6px 0;background:#FFFFFF}
#ed summary{cursor:pointer;font-weight:600}
#ed hr{border:0;border-top:1px solid #E5E7EB}
/* mensajes */
#ed .err,#tb .err{font-size:14px;color:var(--ed-err)!important}
#ed .err[style*="1f9d55"],#ed .err[style*="rgb(31, 157, 85)"],#tb .err[style*="1f9d55"],#tb .err[style*="rgb(31, 157, 85)"]{color:var(--ed-ok)!important}
#ed .nt{background:#FEF3C7;color:var(--ed-warn)!important;border:1px solid #FCD34D;padding:8px 10px;border-radius:8px;font-size:14px;margin:8px 0}
#ed .nt *{color:var(--ed-warn)!important}
/* barra de abajo del editor y paleta */
#tb{background:#FFFFFF;border-top:3px solid #111111;box-shadow:0 -4px 18px #0000001f}
#tb>b{color:#111111}
#pal{background:#FFFFFF;border:1px solid #E5E7EB;box-shadow:var(--sh)}

/* =====================================================================
   Panel flotante, movible y que se puede minimizar u ocultar
   ===================================================================== */
#ed.modal{position:fixed;inset:auto;right:12px;top:12px;left:auto;bottom:auto;width:min(520px,calc(100vw - 16px));max-height:min(72vh,calc(100vh - 24px));max-height:min(72dvh,calc(100dvh - 24px));
  background:#FFFFFF;border:1px solid #D1D5DB;border-radius:14px;box-shadow:var(--sh);z-index:25;flex-direction:column;overflow:hidden;justify-content:flex-start}
#ed.modal.on{display:flex}
#ed.modal #ep{width:auto!important;height:auto;flex:1 1 auto;min-height:0;overflow:auto;padding:14px;background:#FFFFFF}
.edbar{display:flex;align-items:center;gap:6px;padding:8px 10px;background:#111111;color:#FFFFFF;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}
.edbar.dragging{cursor:grabbing}
#ed .edbar b,#ed .edbar span{color:#FFFFFF!important}
.edgrip{opacity:.7;letter-spacing:-2px;font-size:16px}
.edbar b{font-size:15px;white-space:nowrap}
.edst{flex:1;min-width:0;font-size:12px;opacity:.85;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ed .edbar button{flex:none;background:#FFFFFF1f;color:#FFFFFF;border:1px solid #ffffff55;border-radius:8px;min-width:34px;height:32px;padding:0 8px;font-size:15px;cursor:pointer;line-height:1}
#ed .edbar button:hover{background:#ffffff3a}
#ed .edbar button[aria-pressed=true]{background:#FFFFFF;color:#111111;border-color:#FFFFFF}
#ed.edmin{width:min(300px,calc(100vw - 16px))}
#ed.edmin #ep{display:none}
#ed.edhid{display:none!important}
#edtab{display:none;position:fixed;left:12px;bottom:calc(var(--tbh,90px) + 10px);z-index:26;background:#111111;color:#FFFFFF;border:0;border-radius:999px;padding:10px 16px;font-weight:700;cursor:pointer;box-shadow:var(--sh)}
body.edhidden #edtab{display:inline-flex;align-items:center;gap:6px}
#edtab,#edtab *{color:#FFFFFF!important}

/* modo de selección visual */
body.edsel.editing{cursor:crosshair}
body.edsel.editing .edhov{outline:2px dashed #2563EB!important;outline-offset:2px}
body.edsel.editing .edpick{outline:3px solid #2563EB!important;outline-offset:2px;box-shadow:0 0 0 6px #2563eb26}
body.edsel.editing [contenteditable]{outline:1px dashed #2563EB}

/* celular: el panel es una hoja inferior que se contrae; nunca ocupa toda la pantalla */
@media(max-width:700px){
  #ed.modal{left:8px!important;right:8px!important;width:auto!important;max-height:58vh;max-height:58dvh;border-radius:16px}
  #ed.edmin{max-height:none}
  .edbar{cursor:default}
  #ed .edbar button{min-width:40px;height:38px}
  #ed .tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
  #ed .tabs .b{flex:none}
}

/* celular: la barra del editor (#tb) es de una sola fila y la barra de navegación de la tienda (Inicio, Tienda, Eventos, Mis pedidos, Panel, Menú) queda visible justo encima */
@media(max-width:900px){body.editing #bb{bottom:calc(var(--tbh,54px) - 4px)}body.editing{padding-bottom:140px}}
@media(max-width:700px){
  #tb{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;gap:6px;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));scrollbar-width:none}
  #tb::-webkit-scrollbar{display:none}
  #tb>b,#tb #tbm:empty,#tb [data-a=pvm]{display:none}
  #tb .b{flex:none;white-space:nowrap;padding:7px 12px;font-size:13px}
  #tb #tbm{flex:none;max-width:70vw;white-space:normal;font-size:12px}
  #ed.modal{max-height:44vh;max-height:44dvh}
  #ed #ep{padding:10px}
  #ed .b{font-size:14px;padding:8px 14px}
  #ed [style*="sticky"]{display:flex;gap:6px;flex-wrap:nowrap;padding:6px 0}
  #ed [style*="sticky"] .b{flex:1;padding:8px 6px;font-size:13px;white-space:nowrap}
  #ed h2{font-size:17px}
}
