/* ============================================================
   whatsventa — área del comerciante y administración
   ============================================================ */

body.app {
  display: flex;
  min-height: 100vh;
  background: var(--wv-bg);
}
body.app--limpia { display: block; }

/* ── Lateral ───────────────────────────────────────────────── */
.app-lateral {
  position: fixed;
  z-index: 60;
  top: 0; left: 0; bottom: 0;
  width: 264px;
  display: flex;
  flex-direction: column;
  background: var(--wv-surface);
  border-right: 1px solid var(--wv-border);
  overflow-y: auto;
}
.app-lateral__top { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.app-lateral__x { display: none; }

.app-marca { display: inline-flex; align-items: center; gap: 9px; color: var(--wv-ink); margin-right: auto; }
.app-marca:hover { color: var(--wv-ink); }
.app-marca__logo {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--wv-gradient);
  box-shadow: 0 4px 12px 0 rgba(79, 70, 229, .32);
  color: #fff; font-weight: 800; font-size: 15px;
}
.app-marca__txt { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }

.app-tienda {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 14px 18px;
  padding: 14px;
  border-radius: var(--wv-r-md);
  background: var(--wv-indigo-50);
  border: 1px solid var(--wv-indigo-100);
}
.app-tienda__nombre { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.app-tienda__sel { width: 100%; }
.app-tienda__sel .wv-select { padding: 8px 32px 8px 10px; min-height: 38px; font-size: 13.5px; font-weight: 700; }
.app-tienda__link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--wv-indigo-700); }
.app-tienda__link:hover { color: var(--wv-secondary); }

.app-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.app-nav__i {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--wv-r-sm);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--wv-slate-700);
  transition: all .15s ease-out;
  min-height: 44px;
}
.app-nav__i:hover { background: var(--wv-bg); color: var(--wv-primary); }
.app-nav__i .mi { color: var(--wv-slate-400); transition: color .15s; }
.app-nav__i:hover .mi { color: var(--wv-primary); }
.app-nav__i.on { background: var(--wv-indigo-50); color: var(--wv-primary); font-weight: 700; }
.app-nav__i.on .mi { color: var(--wv-primary); }
.app-nav__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--wv-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.app-lateral__pie { margin-top: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.app-plan {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border-radius: var(--wv-r-md);
  background: var(--wv-gradient-dark);
  color: #fff;
}
.app-plan:hover { color: #fff; filter: brightness(1.12); }
.app-plan .mi { color: #C7D2FE; }
.app-plan strong { display: block; font-size: 13.5px; font-weight: 800; }
.app-plan span { font-size: 11.5px; color: #C7D2FE; }

.app-usuario {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: var(--wv-r-md);
  border: 1px solid var(--wv-border-soft);
}
.app-usuario__av {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--wv-indigo-100);
  color: var(--wv-indigo-700);
  font-size: 12px;
  font-weight: 800;
}
.app-usuario > div { min-width: 0; margin-right: auto; }
.app-usuario strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-usuario span { font-size: 11px; color: var(--wv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.app-salir {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--wv-muted);
  transition: all .15s;
}
.app-salir:hover { background: #FEF2F2; color: var(--wv-danger-ink); }

/* ── Cuerpo ────────────────────────────────────────────────── */
.app-cuerpo { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 26px;
  background: rgba(248, 250, 252, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wv-border);
}
.app-topbar__t { font-size: 15px; font-weight: 800; letter-spacing: -.01em; margin-right: auto; }
.app-burger { display: none; }

.app-main { flex: 1; padding: 26px; max-width: 1400px; width: 100%; }

.app-velo {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

/* ── Encabezado de página ──────────────────────────────────── */
.pg-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pg-head__txt { margin-right: auto; }
.pg-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.025em; margin-top: 6px; }
.pg-head p { font-size: 14.5px; color: var(--wv-muted); margin-top: 7px; max-width: 64ch; line-height: 1.55; }
.pg-acciones { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── KPIs ──────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  padding: 20px;
  border-radius: var(--wv-r-lg);
  background: var(--wv-surface);
  border: 1px solid var(--wv-border-soft);
  box-shadow: var(--wv-sh-card);
}
.kpi__top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kpi__ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--wv-indigo-50);
  color: var(--wv-primary);
}
.kpi__label { font-size: 12.5px; font-weight: 700; color: var(--wv-muted); }
.kpi__valor { font-size: 29px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi__delta { display: inline-flex; align-items: center; gap: 3px; margin-top: 7px; font-size: 12.5px; font-weight: 700; }
.kpi__delta--sube { color: var(--wv-success); }
.kpi__delta--baja { color: var(--wv-danger-ink); }
.kpi__delta--plano { color: var(--wv-muted); }

/* ── Paneles ───────────────────────────────────────────────── */
.panel {
  background: var(--wv-surface);
  border: 1px solid var(--wv-border-soft);
  border-radius: var(--wv-r-lg);
  box-shadow: var(--wv-sh-card);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wv-border-soft);
}
.panel__head h2 { font-size: 16px; font-weight: 800; margin-right: auto; }
.panel__cuerpo { padding: 20px; }
.panel__cuerpo--liso { padding: 0; }

.cols-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* Barras de productos más vistos */
.barra { margin-bottom: 15px; }
.barra:last-child { margin-bottom: 0; }
.barra__top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.barra__nom { font-size: 13.5px; font-weight: 700; margin-right: auto; }
.barra__val { font-size: 12.5px; font-weight: 800; color: var(--wv-muted); font-variant-numeric: tabular-nums; }
.barra__pista { height: 8px; border-radius: 99px; background: var(--wv-border-soft); overflow: hidden; }
.barra__fill { height: 100%; border-radius: 99px; background: var(--wv-gradient); transition: width .4s ease-out; }

/* Tarjeta de plan */
.plan-card {
  padding: 20px;
  border-radius: var(--wv-r-lg);
  background: var(--wv-gradient-dark);
  color: #fff;
  box-shadow: var(--wv-sh-panel-dark);
}
.plan-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.plan-card p { font-size: 13.5px; color: #C7D2FE; line-height: 1.55; margin-bottom: 16px; }
.plan-card .wv-btn { background: #fff; color: var(--wv-indigo-700); }
.plan-card .wv-btn:hover { background: #EEF2FF; color: var(--wv-indigo-700); }

/* Uso del plan */
.uso { margin-bottom: 14px; }
.uso__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.uso__top strong { font-weight: 700; }
.uso__top span { color: var(--wv-muted); font-variant-numeric: tabular-nums; }
.uso__pista { height: 7px; border-radius: 99px; background: var(--wv-border-soft); overflow: hidden; }
.uso__fill { height: 100%; border-radius: 99px; background: var(--wv-gradient); }
.uso__fill.lleno { background: linear-gradient(135deg, #F59E0B, #EF4444); }

/* Listado de pedidos */
.pedido-fila {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--wv-border-soft);
  transition: background .15s;
}
.pedido-fila:last-child { border-bottom: 0; }
.pedido-fila:hover { background: #FAFBFF; }
.pedido-fila__av {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--wv-indigo-100);
  color: var(--wv-indigo-700);
  font-size: 12.5px;
  font-weight: 800;
}
.pedido-fila__txt { min-width: 0; margin-right: auto; }
.pedido-fila__nom { font-size: 14px; font-weight: 700; }
.pedido-fila__meta { font-size: 12.5px; color: var(--wv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedido-fila__total { font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Buscador de listados ──────────────────────────────────── */
.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.filtros .wv-input, .filtros .wv-select { width: auto; min-width: 190px; }
.filtros form { display: contents; }

/* ── Paginación ────────────────────────────────────────────── */
.paginacion { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.paginacion a, .paginacion span {
  min-width: 38px;
  padding: 8px 12px;
  border-radius: var(--wv-r-sm);
  border: 1px solid var(--wv-border);
  background: var(--wv-surface);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--wv-slate-700);
  text-align: center;
}
.paginacion a:hover { border-color: var(--wv-primary); color: var(--wv-primary); }
.paginacion .on { background: var(--wv-primary); border-color: var(--wv-primary); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   EDITOR
   ══════════════════════════════════════════════════════════════ */
.ed { display: flex; flex-direction: column; height: 100vh; background: #F1F5F9; overflow: hidden; }

.ed__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 16px;
  flex: none;
  background: var(--wv-surface);
  border-bottom: 1px solid var(--wv-border);
  z-index: 30;
}
.ed__marca { display: inline-flex; align-items: center; gap: 9px; color: var(--wv-ink); }
.ed__marca:hover { color: var(--wv-ink); }
.ed__tienda { display: flex; flex-direction: column; min-width: 0; }
.ed__tienda strong { font-size: 14px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--wv-indigo-50);
  color: var(--wv-indigo-700);
  font-family: var(--wv-mono);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed__url:hover { background: var(--wv-indigo-100); color: var(--wv-indigo-700); }
/* El `text-overflow` de arriba no muerde en un inline-flex: los puntos
   suspensivos tienen que vivir en el trozo de texto, no en la píldora. */
.ed__url__dom, .ed__url__slug { overflow: hidden; text-overflow: ellipsis; }
.ed__url__slug { min-width: 0; }
.ed__acciones { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.ed__estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--wv-muted);
  white-space: nowrap;
}
.ed__estado[data-estado="guardando"] { color: var(--wv-warning); }
.ed__estado[data-estado="guardado"]  { color: var(--wv-success); }
.ed__estado[data-estado="error"]     { color: var(--wv-danger-ink); }

.ed__area { flex: 1; display: flex; min-height: 0; }

/* ── Panel izquierdo ───────────────────────────────────────── */
.ed__panel {
  width: 340px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--wv-surface);
  border-right: 1px solid var(--wv-border);
  min-height: 0;
}
.ed__tabs { display: flex; border-bottom: 1px solid var(--wv-border); flex: none; }
.ed__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 0 13px;
  border: 0;
  background: none;
  color: var(--wv-slate-400);
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s ease-out;
  min-height: 44px;
}
.ed__tab.on { color: var(--wv-primary); border-bottom-color: var(--wv-primary); }
.ed__tab .mi { color: currentColor; }

.ed__panel-cuerpo {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  /* El espacio de abajo es para la marca de agua: es fija, y sin
     este hueco taparía los últimos controles del panel. */
  padding: 16px 16px 62px;
}
.ed__grupo { margin-bottom: 22px; }
.ed__grupo:last-child { margin-bottom: 0; }
.ed__grupo-t {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wv-slate-400);
  margin-bottom: 11px;
}

/* Lista de bloques */
.ed__bloques { display: flex; flex-direction: column; gap: 7px; }
.ed__bloque {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border-radius: var(--wv-r-md);
  background: var(--wv-surface);
  border: 1px solid #EEF2F7;
  transition: all .15s ease-out;
  cursor: pointer;
}
.ed__bloque:hover { border-color: var(--wv-indigo-200); }
.ed__bloque.sel {
  background: #F5F6FF;
  border-color: var(--wv-indigo-200);
  box-shadow: 0 4px 14px -6px rgba(79, 70, 229, .4);
}
.ed__bloque.oculto { opacity: .55; }
.ed__bloque__ico {
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--wv-indigo-50);
  color: var(--wv-primary);
  transition: all .15s;
}
.ed__bloque.sel .ed__bloque__ico { background: var(--wv-primary); color: #fff; }
.ed__bloque__txt { min-width: 0; margin-right: auto; }
.ed__bloque__nom { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.ed__bloque__hint { font-size: 11px; color: var(--wv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__bloque__btns { display: flex; gap: 2px; flex: none; }
.ed__mini {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--wv-slate-400);
  transition: all .15s;
}
.ed__mini:hover { background: var(--wv-indigo-50); color: var(--wv-primary); }
.ed__mini--x:hover { background: #FEF2F2; color: var(--wv-danger-ink); }
.ed__mini[disabled] { opacity: .3; pointer-events: none; }

/* Ajustes del bloque */
.ed__ajustes {
  margin-top: 16px;
  padding: 15px;
  border-radius: var(--wv-r-md);
  background: var(--wv-bg);
  border: 1px solid var(--wv-border-soft);
}
.ed__ajustes .wv-field { margin-bottom: 13px; }
.ed__ajustes .wv-field:last-child { margin-bottom: 0; }
.ed__ajustes .wv-input, .ed__ajustes .wv-select { padding: 9px 12px; min-height: 40px; font-size: 14px; }
.ed__ajustes .wv-label { font-size: 11.5px; margin-bottom: 6px; }

/* Agregar bloque */
.ed__agregar { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ed__agregar button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px dashed var(--wv-border);
  border-radius: var(--wv-r-sm);
  background: transparent;
  color: var(--wv-slate-700);
  font-size: 12.5px;
  font-weight: 700;
  transition: all .15s ease-out;
  min-height: 42px;
}
.ed__agregar button:hover { border-style: solid; border-color: var(--wv-primary); color: var(--wv-primary); background: var(--wv-indigo-50); }
.ed__agregar button .mi { color: var(--wv-primary); }
.ed__agregar button[disabled] { opacity: .45; pointer-events: none; }

/* Diseño: paletas */
.ed__paletas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ed__paleta {
  padding: 9px;
  border-radius: var(--wv-r-sm);
  border: 1px solid var(--wv-border);
  background: var(--wv-surface);
  transition: all .15s ease-out;
  text-align: center;
}
.ed__paleta:hover { border-color: var(--wv-indigo-200); transform: translateY(-2px); }
.ed__paleta.on { border: 2px solid var(--wv-primary); box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .5); }
.ed__paleta__sw { display: flex; gap: 3px; margin-bottom: 6px; }
.ed__paleta__sw span { flex: 1; height: 20px; border-radius: 5px; }
.ed__paleta__n { font-size: 11px; font-weight: 700; color: var(--wv-slate-700); }

/* Diseño: tipografías */
.ed__fuentes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ed__fuente {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--wv-r-sm);
  border: 1px solid var(--wv-border);
  background: var(--wv-surface);
  text-align: left;
  transition: all .15s ease-out;
}
.ed__fuente:hover { border-color: var(--wv-indigo-200); }
.ed__fuente.on { border: 2px solid var(--wv-primary); }
.ed__fuente__aa { font-size: 21px; line-height: 1; flex: none; color: var(--wv-ink); }
.ed__fuente__n { font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.ed__fuente__d { font-size: 10px; color: var(--wv-muted); }

/* Diseño: color libre */
.ed__color { display: flex; align-items: center; gap: 10px; }
.ed__color input[type="color"] {
  width: 46px; height: 42px;
  padding: 3px;
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-sm);
  background: var(--wv-surface);
  cursor: pointer;
}
.ed__color .wv-input { font-family: var(--wv-mono); text-transform: uppercase; }

/* Diseño: sliders */
.ed__slider { margin-bottom: 14px; }
.ed__slider__top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.ed__slider__top label { font-size: 12.5px; font-weight: 700; color: var(--wv-slate-700); }
.ed__slider__top span { font-size: 12px; font-weight: 700; color: var(--wv-primary); font-variant-numeric: tabular-nums; }
.ed__slider input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  border-radius: 99px;
  background: var(--wv-border-soft);
  outline: none;
}
.ed__slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--wv-gradient);
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(79, 70, 229, .5);
  cursor: pointer;
}
.ed__slider input[type="range"]::-moz-range-thumb {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--wv-primary);
  border: 2px solid #fff;
  cursor: pointer;
}

/* Diseño: opciones en fila */
.ed__opciones { display: flex; gap: 6px; flex-wrap: wrap; }
.ed__opcion {
  flex: 1;
  min-width: 68px;
  padding: 9px 10px;
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-sm);
  background: var(--wv-surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--wv-slate-700);
  transition: all .15s;
  min-height: 40px;
}
.ed__opcion:hover { border-color: var(--wv-indigo-200); color: var(--wv-primary); }
.ed__opcion.on { background: var(--wv-primary); border-color: var(--wv-primary); color: #fff; }

.ed__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--wv-r-md);
  background: var(--wv-bg);
  border: 1px solid var(--wv-border-soft);
  margin-bottom: 10px;
}
.ed__toggle > div { margin-right: auto; }
.ed__toggle strong { display: block; font-size: 13.5px; font-weight: 700; }
.ed__toggle span { font-size: 11.5px; color: var(--wv-muted); }

/* Bloqueo por plan */
.ed__bloqueado { position: relative; }
.ed__bloqueado::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--wv-r-md);
  background: rgba(248, 250, 252, .62);
  cursor: not-allowed;
}
.ed__candado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #FFFBEB;
  color: #B45309;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Productos en el panel */
.ed__productos { display: flex; flex-direction: column; gap: 6px; }
.ed__producto {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--wv-r-md);
  border: 1px solid #EEF2F7;
  background: var(--wv-surface);
  transition: all .15s;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.ed__producto:hover { border-color: var(--wv-indigo-200); background: #FAFBFF; }
.ed__producto__img {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 9px;
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, .07) 0 6px, transparent 6px 12px);
  background-size: cover;
  background-position: center;
}
.ed__producto__txt { min-width: 0; margin-right: auto; }
.ed__producto__nom { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__producto__meta { font-size: 11px; color: var(--wv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Lienzo ────────────────────────────────────────────────── */
.ed__lienzo {
  flex: 1;
  min-width: 0;
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px 24px;
  overflow: auto;
  background: radial-gradient(circle at 50% 0%, #E7EAFF 0%, #F1F5F9 60%);
}
.ed__lienzo[data-modo="publico"] { background: linear-gradient(180deg, #1E1B4B, #0F172A); }

.ed__pista {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--wv-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--wv-muted);
  white-space: nowrap;
  box-shadow: 0 6px 18px -8px rgba(15, 23, 42, .3);
}
.ed__lienzo[data-modo="publico"] .ed__pista {
  background: rgba(15, 23, 42, .8);
  border-color: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .85);
}

/* ── Móvil del editor ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .ed__panel { width: 300px; }
}

@media (max-width: 880px) {
  .app-lateral {
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    box-shadow: 0 0 40px rgba(15, 23, 42, .3);
  }
  .app-lateral.abierta { transform: none; }
  .app-lateral__x {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border: 0;
    border-radius: var(--wv-r-sm);
    background: var(--wv-border-soft);
    color: var(--wv-muted);
  }
  .app-cuerpo { margin-left: 0; }
  .app-burger {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border: 1px solid var(--wv-border);
    border-radius: var(--wv-r-sm);
    background: var(--wv-surface);
    color: var(--wv-ink);
  }
  .app-main { padding: 18px 16px 40px; }
  .app-topbar { padding: 11px 16px; }
  /* minmax(0,…) y no «1fr» pelado: «1fr» es minmax(auto,1fr) y la
     columna no baja del ancho mínimo de su contenido. Con una tabla
     dentro, eso desbordaba la pantalla del teléfono. */
  .cols-2 { grid-template-columns: minmax(0, 1fr); }

  .ed__area { flex-direction: column-reverse; }
  .ed__panel { width: 100%; max-height: 46%; border-right: 0; border-top: 1px solid var(--wv-border); }
  .ed__lienzo { padding: 18px 12px; }
  .ed__toolbar { height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .ed__url { max-width: 160px; }
  .ed__url__dom { display: none; }   /* sólo el nombre de la tienda */
  .ed__pista { display: none; }
  .ed__agregar { grid-template-columns: minmax(0, 1fr); }
  .ed__paletas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .pg-head h1 { font-size: 23px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .kpi { padding: 15px; }
  .kpi__valor { font-size: 24px; }
  .ed__acciones .ed__solo-ancho { display: none; }
}

/* ── Slots de imagen en los ajustes del editor ─────────────── */
.ed__imagenes { display: flex; flex-direction: column; gap: 9px; }
.ed__imagen-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--wv-r-sm);
  border: 1px solid var(--wv-border-soft);
  background: var(--wv-surface);
}
.ed__imagen-prev {
  width: 54px; height: 40px;
  flex: none;
  border-radius: 7px;
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, .08) 0 6px, transparent 6px 12px);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--wv-border-soft);
}
.ed__imagen-acc { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ed__imagen-acc .wv-btn { padding: 6px 11px; min-height: 34px; font-size: 12.5px; }

/* ── Miniaturas en tablas ──────────────────────────────────── */
.tabla-thumb {
  display: block;
  width: 40px; height: 40px;
  border-radius: 9px;
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, .08) 0 6px, transparent 6px 12px);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--wv-border-soft);
}
/* El producto que sólo tiene video: su fotograma si Bunny lo generó, y
   si no el icono, que es mejor que un cuadro en blanco. */
.tabla-thumb--video {
  display: grid;
  place-items: center;
  color: var(--wv-muted);
}

/* ── Variantes ─────────────────────────────────────────────── */
.var-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 3px 3px 10px;
  border-radius: var(--wv-r-pill);
  border: 1px solid var(--wv-border);
  background: var(--wv-surface);
  transition: border-color .15s;
}
.var-chip:focus-within { border-color: var(--wv-primary); }
.var-chip input {
  width: 92px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
}

/* ── Medios del producto ───────────────────────────────────── */
.medios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.medio {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--wv-r-md);
  overflow: hidden;
  border: 1px solid var(--wv-border-soft);
  background: var(--wv-bg);
}
.medio__img, .medio__video {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}
/* Con fotograma de portada el icono queda encima de la imagen, así que
   necesita sombra para no perderse en un video claro. */
.medio__video { background: var(--wv-ink); color: #fff; }
.medio__video .mi { text-shadow: 0 1px 6px rgba(15, 23, 42, .6); }
.medio__x {
  position: absolute;
  top: 5px; right: 5px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  transition: background .15s;
}
.medio__x:hover { background: var(--wv-danger); }
.medio--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--wv-border);
  background: transparent;
  color: var(--wv-muted);
  font-size: 12px;
  font-weight: 700;
  transition: all .15s;
}
.medio--add:hover { border-style: solid; border-color: var(--wv-primary); color: var(--wv-primary); background: var(--wv-indigo-50); }
.medio--add[disabled] { opacity: .5; pointer-events: none; }
.medio--subiendo { display: grid; place-items: center; }

/* ── Categorías ────────────────────────────────────────────── */
.cat-fila {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--wv-border-soft);
}
.cat-fila:last-child { border-bottom: 0; }
.cat-fila__ico {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--wv-indigo-50);
  color: var(--wv-primary);
}
.cat-fila__txt { margin-right: auto; min-width: 0; }
.cat-fila__txt strong { display: block; font-size: 14px; font-weight: 700; }
.cat-fila__txt span { font-size: 12.5px; color: var(--wv-muted); }

.cat-iconos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-sm);
}
.cat-icono {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--wv-r-sm);
  border: 1px solid transparent;
  color: var(--wv-muted);
  cursor: pointer;
  transition: all .15s;
}
.cat-icono:hover { background: var(--wv-bg); color: var(--wv-primary); }
.cat-icono input { position: absolute; opacity: 0; width: 0; height: 0; }
.cat-icono:has(input:checked) {
  background: var(--wv-indigo-50);
  border-color: var(--wv-primary);
  color: var(--wv-primary);
}

/* ── Biblioteca de medios ──────────────────────────────────── */
.biblioteca {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.bib-item {
  position: relative;
  margin: 0;
  border-radius: var(--wv-r-lg);
  overflow: hidden;
  background: var(--wv-surface);
  border: 1px solid var(--wv-border-soft);
  box-shadow: var(--wv-sh-card);
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.bib-item:hover { transform: translateY(-3px); box-shadow: var(--wv-sh-card-hover); }
.bib-item__prev {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--wv-bg);
}
.bib-item__prev--video { display: grid; place-items: center; background: var(--wv-ink); color: #fff; }
.bib-item__pie { display: flex; flex-direction: column; gap: 4px; padding: 12px 13px 13px; align-items: flex-start; }
.bib-item__nom {
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bib-item__meta { font-size: 11.5px; color: var(--wv-muted); }
.bib-item__acc {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .18s;
}
.bib-item:hover .bib-item__acc,
.bib-item:focus-within .bib-item__acc { opacity: 1; }
.bib-item__btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, .8);
  color: #fff;
  transition: background .15s;
}
.bib-item__btn:hover { background: var(--wv-primary); color: #fff; }
.bib-item__btn--x:hover { background: var(--wv-danger); }

/* ── Detalle de pedido ─────────────────────────────────────── */
.pedido-mensaje {
  margin: 0;
  padding: 16px;
  border-radius: var(--wv-r-md);
  background: #0B141A;
  color: #E9EDEF;
  font-family: var(--wv-mono);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.datos { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: baseline; }
.datos dt { font-size: 12px; font-weight: 700; color: var(--wv-muted); white-space: nowrap; }
.datos dd { margin: 0; font-size: 13.5px; font-weight: 600; word-break: break-word; }

/* ── Planes dentro de la app ───────────────────────────────── */
.planes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
  align-items: stretch;
}
.planes-grid .lp-plan { transform: none; }
.planes-grid .lp-plan--pop { transform: none; }
.plan--actual { outline: 2px solid var(--wv-success); outline-offset: -2px; }

/* ── Ajustes ───────────────────────────────────────────────── */
.campo-prefijo { display: flex; align-items: stretch; }
.campo-prefijo > span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--wv-border);
  border-right: 0;
  border-radius: var(--wv-r-sm) 0 0 var(--wv-r-sm);
  background: var(--wv-bg);
  color: var(--wv-muted);
  font-family: var(--wv-mono);
  font-size: 13px;
  white-space: nowrap;
}
.campo-prefijo .wv-input { border-radius: 0 var(--wv-r-sm) var(--wv-r-sm) 0; font-family: var(--wv-mono); }

.logo-prev {
  width: 74px; height: 74px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 20px;
  overflow: hidden;
  background: var(--wv-gradient);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }

.enlace-caja {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--wv-r-md);
  background: var(--wv-indigo-50);
  border: 1px solid var(--wv-indigo-100);
  color: var(--wv-indigo-700);
}
.enlace-caja .mi { flex: none; }

/* ── Administración ────────────────────────────────────────── */
.app-tienda--admin { flex-direction: row; align-items: center; gap: 11px; }
.app-tienda--admin .mi { color: var(--wv-primary); flex: none; }
.app-tienda--admin strong { display: block; font-size: 13.5px; font-weight: 800; }
.app-tienda--admin span { font-size: 11.5px; color: var(--wv-muted); }

.admin-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.admin-mini__i {
  padding: 16px;
  border-radius: var(--wv-r-md);
  background: var(--wv-surface);
  border: 1px solid var(--wv-border-soft);
  box-shadow: var(--wv-sh-card);
}
.admin-mini__i strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.admin-mini__i span { font-size: 12.5px; color: var(--wv-muted); }

/* ── Bloques del landing (acordeón del admin) ──────────────── */
.lb-item {
  border: 1px solid var(--wv-border-soft);
  border-radius: var(--wv-r-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color .15s;
}
.lb-item[open] { border-color: var(--wv-indigo-200); }
.lb-item[data-inactivo] summary { opacity: .6; }
.lb-item summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  background: var(--wv-surface);
  transition: background .15s;
}
.lb-item summary::-webkit-details-marker { display: none; }
.lb-item summary:hover { background: #FAFBFF; }
.lb-item summary .mi { color: var(--wv-primary); flex: none; }
.lb-item__t { flex: 1; font-size: 14px; font-weight: 700; }
.lb-item__chev { color: var(--wv-slate-400) !important; transition: transform .2s ease-out; }
.lb-item[open] .lb-item__chev { transform: rotate(180deg); }
.lb-item__cuerpo { padding: 16px 15px 15px; border-top: 1px solid var(--wv-border-soft); background: var(--wv-bg); }

/* ── Paletas en el admin ───────────────────────────────────── */
.pal-sw { display: flex; gap: 3px; flex: none; }
.pal-sw span {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(15, 23, 42, .12);
}
.colores-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }

/* Interruptores del admin en fila */
.flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* ══════════════════════════════════════════════════════════════
   BARRA INFERIOR (sólo móvil)
   Los destinos principales a un toque, sin abrir el menú.
   ══════════════════════════════════════════════════════════════ */
.app-barra { display: none; }

@media (max-width: 880px) {
  .app-barra {
    position: fixed;
    z-index: 50;
    bottom: 0; left: 0; right: 0;
    display: flex;
    padding: 8px 4px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--wv-border);
    box-shadow: 0 -6px 22px -12px rgba(15, 23, 42, .3);
  }

  .app-barra__i {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--wv-slate-400);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: color .15s;
    min-height: 44px;
  }
  .app-barra__i:hover { color: var(--wv-primary); }
  .app-barra__i.on { color: var(--wv-primary); }
  .app-barra__i > span:last-child {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-barra__ico { position: relative; display: block; line-height: 1; }
  .app-barra__badge {
    position: absolute;
    top: -5px; right: -9px;
    min-width: 17px; height: 17px;
    padding: 0 4px;
    display: grid; place-items: center;
    border-radius: 99px;
    background: var(--wv-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid #fff;
  }

  /* El contenido no debe quedar debajo de la barra. */
  .app-main { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

  /* El lateral también respeta el notch. */
  .app-lateral { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ══════════════════════════════════════════════════════════════
   TABLAS → TARJETAS EN MÓVIL
   Cada fila se convierte en una tarjeta con sus etiquetas.
   Los <td> llevan data-etiqueta con el nombre de su columna.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 880px) {
  .wv-tabla-wrap {
    border: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  .wv-tabla, .wv-tabla tbody, .wv-tabla td { display: block; width: 100%; }
  .wv-tabla thead { display: none; }

  .wv-tabla tr {
    /* flex para poder subir la celda principal al encabezado de la tarjeta */
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: var(--wv-r-lg);
    background: var(--wv-surface);
    border: 1px solid var(--wv-border-soft);
    box-shadow: var(--wv-sh-card);
  }
  .wv-tabla tbody tr:hover { background: var(--wv-surface); }

  .wv-tabla td {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--wv-border-soft);
    text-align: left;
    min-height: 34px;
    /* Un correo o un slug largo no debe desbordar la tarjeta. */
    overflow-wrap: anywhere;
    white-space: normal !important;
  }
  .wv-tabla td:last-child { border-bottom: 0; padding-bottom: 0; }
  .wv-tabla td:first-child { padding-top: 0; }

  /* El nombre de la columna, a la izquierda. */
  .wv-tabla td[data-etiqueta]::before {
    content: attr(data-etiqueta);
    flex: none;
    width: 38%;
    max-width: 130px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--wv-muted);
  }

  /* La celda destacada encabeza la tarjeta, sin etiqueta. */
  .wv-tabla td[data-principal] {
    order: -2;              /* encabeza la tarjeta */
    display: block;
    padding: 0 0 11px;
    margin-bottom: 4px;
    font-size: 15px;
  }
  .wv-tabla td[data-miniatura] { order: -3; }
  .wv-tabla td[data-acciones]  { order: 2; border-bottom: 0; }
  .wv-tabla td[data-principal]::before { content: none; }

  /* Las celdas numéricas dejan de alinearse a la derecha. */
  .wv-tabla td.num { text-align: left; justify-content: flex-start; }

  /* Las acciones ocupan el ancho completo, abajo de la tarjeta. */
  .wv-tabla td[data-acciones] { padding-top: 12px; }
  .wv-tabla td[data-acciones]::before { content: none; }
  .wv-tabla td[data-acciones] .acciones {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .wv-tabla td[data-acciones] .acciones > * { flex: 1; }
  .wv-tabla td[data-acciones] .acciones form { display: flex; }
  .wv-tabla td[data-acciones] .acciones .wv-btn { width: 100%; justify-content: center; }

  /* Una celda vacía no deja hueco. */
  .wv-tabla td:empty { display: none; }

  /* La miniatura va junto al nombre. */
  .wv-tabla td[data-miniatura] {
    display: inline-flex;
    width: auto;
    padding: 0 0 10px;
    border-bottom: 0;
  }
  .wv-tabla td[data-miniatura]::before { content: none; }
  .wv-tabla td[data-miniatura] + td { padding-top: 0; }

  /* El estado vacío no se convierte en tarjeta. */
  .wv-tabla td[colspan] { display: block; padding: 0; border: 0; }
  .wv-tabla td[colspan]::before { content: none; }
  .wv-tabla tr:has(td[colspan]) { padding: 0; }

  .filtros { gap: 8px; }
  .filtros .wv-input, .filtros .wv-select { min-width: 0; width: 100%; }
  .filtros form { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .filtros form > .wv-btn { flex: 1; }
}

/* ── Reordenar arrastrando ─────────────────────────────────── */
.ed__asa {
  display: grid;
  place-items: center;
  width: 22px;
  flex: none;
  margin-left: -4px;
  color: var(--wv-slate-300);
  cursor: grab;
  touch-action: none;          /* el gesto lo maneja el JS, no el scroll */
  transition: color .15s;
}
.ed__asa:hover { color: var(--wv-primary); }
.ed__asa:active { cursor: grabbing; }
.ed__bloque.sel .ed__asa { color: var(--wv-indigo-200); }

.ed__bloque.arrastrando {
  opacity: .92;
  box-shadow: 0 14px 32px -10px rgba(15, 23, 42, .45);
  border-color: var(--wv-primary);
  cursor: grabbing;
  pointer-events: none;
}

.ed__hueco {
  border-radius: var(--wv-r-md);
  border: 2px dashed var(--wv-indigo-200);
  background: var(--wv-indigo-50);
  margin-bottom: 7px;
  transition: height .12s ease-out;
}

/* Mientras se arrastra, nada más se selecciona. */
body.wv-arrastrando { user-select: none; -webkit-user-select: none; }
body.wv-arrastrando * { cursor: grabbing !important; }

/* ══════════════════════════════════════════════════════════════
   GRÁFICOS
   El SVG lo genera el servidor; aquí sólo viven la leyenda,
   la tipografía de los ejes y la barra de partes.
   ══════════════════════════════════════════════════════════════ */
.gr { margin: 0; }
.gr__svg { width: 100%; height: auto; display: block; overflow: visible; }

.gr__leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}
.gr__serie {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wv-slate-700);
}
.gr__serie i { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* El texto nunca lleva el color de la serie: identidad la da la marca. */
.gr__tick  { font-size: 11px; fill: var(--wv-slate-400); font-family: var(--wv-font); }
.gr__eje   { font-size: 11px; fill: var(--wv-muted); font-family: var(--wv-font); }
.gr__valor { font-size: 11.5px; font-weight: 800; fill: var(--wv-ink); font-family: var(--wv-font); }

/* La tabla de datos, siempre disponible bajo el gráfico. */
.gr-tabla { margin-top: 18px; }
.gr-tabla summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--wv-r-sm);
  background: var(--wv-bg);
  border: 1px solid var(--wv-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--wv-slate-700);
  cursor: pointer;
  list-style: none;
}
.gr-tabla summary::-webkit-details-marker { display: none; }
.gr-tabla summary::before { content: '▸'; color: var(--wv-primary); }
.gr-tabla[open] summary::before { content: '▾'; }
.gr-tabla summary:hover { border-color: var(--wv-primary); color: var(--wv-primary); }

/* ── Barra de partes ───────────────────────────────────────── */
.gr-partes__barra {
  display: flex;
  height: 30px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--wv-border-soft);
  margin-bottom: 16px;
}
/* 2px de superficie separan cada tramo: el aire hace la separación. */
.gr-partes__seg + .gr-partes__seg { box-shadow: -2px 0 0 0 var(--wv-surface); }

.gr-partes__lista { display: flex; flex-direction: column; gap: 10px; }
.gr-partes__lista li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.gr-partes__lista i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.gr-partes__nom { flex: 1; min-width: 0; color: var(--wv-slate-700); }
.gr-partes__val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-partes__pct {
  min-width: 52px;
  text-align: right;
  font-size: 12.5px;
  color: var(--wv-muted);
  font-variant-numeric: tabular-nums;
}

/* Las fichas financieras admiten valores largos. */
.datos--finanzas dd { font-size: 14.5px; }
.datos--finanzas dt { padding-top: 2px; }

@media (max-width: 880px) {
  .gr__eje { font-size: 9.5px; }
  .gr-partes__pct { min-width: 44px; }
}

/* En móvil, la cabecera del panel apila su título y sus controles. */
@media (max-width: 880px) {
  .panel__head { flex-wrap: wrap; }
  .panel__head h2 { flex: 1 1 100%; }
  .panel__head .wv-seg {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .panel__head .wv-seg::-webkit-scrollbar { display: none; }
  .panel__head .wv-seg .wv-btn { flex: 1; white-space: nowrap; }
}

/* ══════════════════════════════════════════════════════════════
   AVISO DEL PERIODO DE PRUEBA
   ══════════════════════════════════════════════════════════════ */
.aviso-prueba {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  margin-bottom: 22px;
  border-radius: var(--wv-r-lg);
  border: 1px solid;
  animation: wvIn .22s ease-out;
}
.aviso-prueba__txt { flex: 1; min-width: 0; }
.aviso-prueba strong { display: block; font-size: 14.5px; font-weight: 800; margin-bottom: 2px; }
.aviso-prueba span:not(.mi) { font-size: 13px; line-height: 1.5; }
.aviso-prueba .mi { flex: none; }
.aviso-prueba .wv-btn { flex: none; }

.aviso-prueba--info  { background: var(--wv-indigo-50); border-color: var(--wv-indigo-100); color: var(--wv-indigo-700); }
.aviso-prueba--warn  { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.aviso-prueba--error { background: #FEF2F2; border-color: #FECACA; color: var(--wv-danger-ink); }

.app-plan--prueba { background: linear-gradient(135deg, #B45309, #92400E); }
.app-plan--prueba .mi, .app-plan--prueba span { color: #FDE68A; }

@media (max-width: 880px) {
  .aviso-prueba { flex-wrap: wrap; }
  .aviso-prueba__txt { flex: 1 1 calc(100% - 40px); }
  .aviso-prueba .wv-btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   RESEÑAS
   ══════════════════════════════════════════════════════════════ */
.resena-estrellas { display: inline-flex; gap: 1px; color: var(--wv-warning); line-height: 1; }

/* Calificar con estrellas: se pintan en orden inverso para que el
   hover encienda de la primera hasta la que el cursor toca. */
.resena-calificar { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.resena-calificar input { position: absolute; opacity: 0; width: 0; height: 0; }
.resena-calificar label {
  color: var(--wv-border);
  cursor: pointer;
  transition: color .12s, transform .12s;
  line-height: 1;
}
.resena-calificar label:hover,
.resena-calificar label:hover ~ label,
.resena-calificar input:checked ~ label { color: var(--wv-warning); }
.resena-calificar label:hover { transform: scale(1.12); }
.resena-calificar input:focus-visible + label { outline: 2px solid var(--wv-primary); outline-offset: 3px; border-radius: 4px; }

.resena-preview h3 { font-size: 16px; font-weight: 800; margin: 10px 0 6px; }
.resena-preview p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--wv-slate-700);
  margin: 8px 0 16px;
  white-space: pre-wrap;
}
.resena-preview__pie { display: flex; align-items: center; gap: 11px; }
.resena-preview__av {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--wv-gradient);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
}
.resena-preview__pie strong { display: block; font-size: 14px; font-weight: 700; }
.resena-preview__pie span { font-size: 12.5px; color: var(--wv-muted); }

/* Fila del listado de moderación */
.resena-fila { display: flex; align-items: stretch; }
.resena-fila__cuerpo { flex: 1; min-width: 0; padding: 18px 20px; }
.resena-fila__top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.resena-fila__titulo { font-size: 15.5px; font-weight: 800; margin-bottom: 6px; }
.resena-fila__texto { font-size: 14px; line-height: 1.6; color: var(--wv-slate-700); margin-bottom: 14px; }
.resena-fila__pie { display: flex; align-items: center; gap: 10px; }
.resena-fila__pie strong { display: block; font-size: 13.5px; font-weight: 700; }
.resena-fila__pie span { font-size: 12px; color: var(--wv-muted); }
.resena-fila__acciones {
  flex: none;
  width: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border-left: 1px solid var(--wv-border-soft);
  background: var(--wv-bg);
}

@media (max-width: 880px) {
  .resena-fila { flex-direction: column; }
  .resena-fila__acciones {
    width: 100%;
    flex-direction: row;
    border-left: 0;
    border-top: 1px solid var(--wv-border-soft);
  }
  .resena-fila__acciones > * { flex: 1; }
}

/* ══════════════════════════════════════════════════════════════
   EDITOR DE PLANES — los límites, explicados
   Un plan es un contrato: quien lo edita tiene que entender qué
   está prometiendo sin adivinar. Por eso cada número lleva al
   lado lo que significa para el comerciante.
   ══════════════════════════════════════════════════════════════ */
.plan-limites {
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-lg);
  background: var(--wv-bg);
  padding: 16px;
  margin-bottom: 18px;
}

.plan-limites__intro {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--wv-muted);
}
.plan-limites__intro .mi { color: var(--wv-primary); flex: none; }
.plan-limites__intro strong { color: var(--wv-ink); font-family: var(--wv-mono); }

.plan-limites__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  align-items: start;
}
.plan-limites__grid .wv-field { margin-bottom: 0; }
.plan-limites__grid .wv-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-limites__grid .wv-help { line-height: 1.55; }

/* Desplegable con los tipos de bloque que existen de verdad */
.plan-ayuda { margin-top: 10px; }
.plan-ayuda summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--wv-primary);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.plan-ayuda summary::-webkit-details-marker { display: none; }
.plan-ayuda summary::before {
  content: 'expand_more';
  font-family: 'Material Symbols Rounded';
  font-size: 17px;
  transition: transform .18s ease;
}
.plan-ayuda[open] summary::before { transform: rotate(180deg); }

.plan-ayuda__lista {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px;
  display: grid;
  gap: 11px;
  background: var(--wv-surface);
  border: 1px solid var(--wv-border-soft);
  border-radius: var(--wv-r-md);
}
.plan-ayuda__lista li { display: flex; align-items: flex-start; gap: 10px; }
.plan-ayuda__lista .mi { color: var(--wv-primary); flex: none; margin-top: 1px; }
.plan-ayuda__lista strong { display: block; font-size: 13px; }
.plan-ayuda__lista span:not(.mi) { font-size: 12px; color: var(--wv-muted); }

/* Interruptores con su explicación debajo */
.wv-switch--ayuda {
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--wv-border-soft);
  border-radius: var(--wv-r-md);
  background: var(--wv-surface);
  transition: border-color .15s ease, background .15s ease;
}
.wv-switch--ayuda:hover { border-color: var(--wv-slate-300); }
.wv-switch--ayuda .wv-switch__track { margin-top: 2px; flex: none; }
.wv-switch--ayuda:has(input:checked) {
  border-color: var(--wv-indigo-200);
  background: var(--wv-indigo-50);
}
.wv-switch__txt { display: grid; gap: 3px; }
.wv-switch__txt strong { font-size: 13.5px; font-weight: 700; }
.wv-switch__txt span { font-size: 12px; color: var(--wv-muted); line-height: 1.5; }

@media (max-width: 560px) {
  .plan-limites { padding: 14px; }
  .plan-limites__grid { gap: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   CRÉDITO DE AUTORÍA

   Discreto y al final de todo: informa sin competir con lo que la
   persona vino a hacer. En móvil queda por encima de la barra
   inferior para que la barra no lo tape.
   ══════════════════════════════════════════════════════════════ */
.app-pie {
  padding: 22px var(--wv-gutter, 20px) 26px;
  text-align: center;
  border-top: 1px solid var(--wv-border-soft);
  margin-top: 8px;
}

.wv-credito {
  font-size: 12.5px;
  color: var(--wv-slate-400);
}
.wv-credito a {
  color: var(--wv-muted);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid var(--wv-border);
  transition: color .15s ease, border-color .15s ease;
}
.wv-credito a:hover { color: var(--wv-primary); border-color: var(--wv-primary); }
.wv-credito a:focus-visible { outline: 2px solid var(--wv-primary); outline-offset: 2px; }

@media (max-width: 880px) {
  /* La barra inferior flota sobre el contenido: el crédito necesita
     espacio propio para no quedar debajo de ella. */
  .app-pie { padding-bottom: calc(26px + 68px + env(safe-area-inset-bottom, 0px)); }
}

/* ══════════════════════════════════════════════════════════════
   MARCA DE AGUA DEL EDITOR

   El editor ocupa la pantalla completa a propósito y no lleva pie,
   así que el crédito va flotando en la esquina inferior izquierda:
   el lado donde no hay controles. Se atenúa hasta que el cursor
   pasa cerca, para no competir con el trabajo.
   ══════════════════════════════════════════════════════════════ */
.ed__credito {
  position: fixed;
  left: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--wv-r-pill);
  background: var(--wv-surface);
  border: 1px solid var(--wv-border);
  box-shadow: var(--wv-sh-card);
  font-size: 11.5px;
  color: var(--wv-slate-400);
  text-decoration: none;
  opacity: .55;
  transition: opacity .18s ease, border-color .18s ease, color .18s ease;
}
.ed__credito:hover,
.ed__credito:focus-visible {
  opacity: 1;
  border-color: var(--wv-primary);
  color: var(--wv-primary);
}
.ed__credito:focus-visible { outline: 2px solid var(--wv-primary); outline-offset: 2px; }
.ed__credito strong { font-weight: 750; color: var(--wv-muted); }
/* Sobre el lienzo, deja pasar el cursor salvo en su propia píldora. */
.ed__credito { pointer-events: auto; }
.ed__credito:hover strong { color: var(--wv-primary); }

@media (max-width: 900px) {
  /* En el teléfono el panel del editor se despliega desde abajo:
     la marca se reduce al icono para no quedar encima. */
  .ed__credito { left: 10px; bottom: 10px; padding: 6px; opacity: .4; }
  .ed__credito__txt { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   DÓNDE VENDES — ubicación de la tienda

   Un bloque aparte dentro de «Mi tienda», porque son varias
   preguntas encadenadas y mezcladas con el resto se pierden.
   Nada aquí es obligatorio: quien vende a todo el país lo deja
   en blanco y sigue.
   ══════════════════════════════════════════════════════════════ */
.ubic {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-lg);
  background: var(--wv-bg);
}

.ubic__t {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.ubic__t .mi { color: var(--wv-primary); flex: none; margin-top: 1px; }
.ubic__t strong { display: block; font-size: 15px; margin-bottom: 3px; color: var(--wv-ink); }
.ubic__t span { font-size: 13px; line-height: 1.55; color: var(--wv-muted); }

.ubic__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.ubic__grid .wv-field { margin-bottom: 0; }
.ubic__grid .wv-label { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ubic__grid [hidden] { display: none !important; }

.ubic__local { margin-top: 18px; width: 100%; }

.ubic__dir {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--wv-border);
  display: grid;
  gap: 14px;
}
.ubic__dir[hidden] { display: none; }
.ubic__dir .wv-field { margin-bottom: 0; }

@media (max-width: 560px) {
  .ubic { padding: 15px; }
  .ubic__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Chips de ubicación, reutilizables ────────────────────── */
.wv-lugar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--wv-muted);
}
.wv-lugar .mi { color: var(--wv-slate-400); font-size: 15px; }

/* ══════════════════════════════════════════════════════════════
   LUGARES — departamentos, ciudades y zonas

   Tres columnas que se van abriendo: eliges departamento y
   aparecen sus ciudades; eliges ciudad y aparecen sus zonas.
   Es la misma forma del árbol, para no tener que explicarla.
   ══════════════════════════════════════════════════════════════ */
.lug-buscar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.lug-buscar .dir-buscar { flex: 1 1 260px; }

.lug-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  align-items: start;
}
.lug-cols .panel { min-width: 0; }

.lug-lista {
  max-height: 460px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 2px;
}

.lug-i {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--wv-r-sm);
  color: var(--wv-slate-700);
  font-size: 13.5px;
  text-decoration: none;
  transition: background .13s ease;
}
.lug-i:hover { background: var(--wv-bg); }
.lug-i.on { background: var(--wv-indigo-50); color: var(--wv-indigo-700); font-weight: 700; }

.lug-i__nom {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.lug-i__n {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--wv-slate-400);
  font-family: var(--wv-mono);
}
.lug-i .ed__mini { flex: none; }
/* El chip con la palabra de la ciudad («Comuna», «Localidad») no se
   encoge: si se corta deja de decir nada. */
.lug-i .wv-chip { flex: none; font-size: 10px; padding: 2px 7px; }

.lug-vacio {
  padding: 26px 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--wv-slate-400);
}

@media (max-width: 900px) {
  .lug-cols { grid-template-columns: minmax(0, 1fr); }
  .lug-lista { max-height: 320px; }
}

/* ── Vista previa del enlace compartido ───────────────────── */
.og-prev { margin: 0 0 20px; }
.og-prev img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--wv-r-lg);
  border: 1px solid var(--wv-border);
  box-shadow: var(--wv-sh-card);
  background: var(--wv-bg);
}
.og-prev figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--wv-slate-400);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   CERRAR SESIÓN

   Antes era un icono de 34px sin texto, metido al lado del correo.
   Se leía como adorno y en el teléfono nadie lo encontraba. Ahora
   es una fila con su nombre escrito, debajo de la cuenta.
   ══════════════════════════════════════════════════════════════ */
.app-salir-form { margin-top: 8px; }

.app-salir {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--wv-border-soft);
  border-radius: var(--wv-r-md);
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--wv-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.app-salir .mi { flex: none; }
.app-salir:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: var(--wv-danger-ink);
}
.app-salir:focus-visible { outline: 2px solid var(--wv-primary); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   AVISOS EN EL EDITOR

   El editor ocupa la pantalla entera y no tiene flujo normal donde
   colocar un aviso, así que flota bajo la barra. Se va solo a los
   pocos segundos: el trabajo es el catálogo, no el mensaje.
   ══════════════════════════════════════════════════════════════ */
.ed__avisos {
  position: fixed;
  z-index: 50;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  pointer-events: none;
  animation: edAvisoEntra .32s cubic-bezier(.3, 1.2, .5, 1);
}
.ed__avisos .wv-flash {
  margin: 0;
  pointer-events: auto;
  box-shadow: 0 16px 40px -14px rgba(15, 23, 42, .32);
}
.ed__avisos.yendose { animation: edAvisoSale .4s ease-in forwards; }

@keyframes edAvisoEntra {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes edAvisoSale {
  to { opacity: 0; transform: translate(-50%, -14px); }
}

@media (prefers-reduced-motion: reduce) {
  .ed__avisos, .ed__avisos.yendose { animation: none; }
}

/* ── «Mantener la sesión abierta», en el ingreso ──────────── */
.auth__recordar {
  margin: 4px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wv-muted);
}

/* ── Inventario opcional, en la ficha de producto ──────────── */
.prod-stock {
  margin-top: 6px;
  padding: 14px;
  border-radius: var(--wv-r-md, 12px);
  border: 1px solid var(--wv-border-soft);
  background: var(--wv-bg);
}
.prod-stock .wv-switch { margin: 0; align-items: flex-start; }
.prod-stock__t {
  display: grid;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
}
.prod-stock__t small {
  font-size: 12px;
  font-weight: 500;
  color: var(--wv-muted);
  line-height: 1.5;
}
.prod-stock__campo {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--wv-border-soft);
  max-width: 260px;
}
.prod-stock__campo[hidden] { display: none; }

/* ── Editor ocupado: una acción estructural en camino ──────────
   Agregar o borrar un bloque tarda lo que tarde el servidor. Sin
   señal, en el celular se vuelve a tocar el botón —y antes eso
   creaba otra sección—. Ahora se ve que está trabajando. */
body.ed-ocupado .ed__agregar button,
body.ed-ocupado .ed__bloque__btns button {
  opacity: .5;
  pointer-events: none;
}
body.ed-ocupado .ed__agregar { cursor: progress; }

/* ── Conceder membresía a mano (admin) ─────────────────────────
   Plegado por defecto: es una acción de excepción, no el trabajo
   diario de la pantalla. */
.admin-conceder { margin-bottom: 18px; padding: 0; }
.admin-conceder > summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}
.admin-conceder > summary::-webkit-details-marker { display: none; }
.admin-conceder > summary .mi { color: var(--wv-primary); flex: none; }
.admin-conceder > summary strong { display: block; font-size: 14.5px; }
.admin-conceder > summary small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--wv-muted);
}
.admin-conceder[open] > summary { border-bottom: 1px solid var(--wv-border-soft); }
.admin-conceder__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.admin-conceder__pie {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.wv-input--sm { padding: 6px 9px; font-size: 13px; }

/* ── «Qué tamaño debe tener esta imagen» ───────────────────── */
.wv-medida {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--wv-indigo-50);
  border: 1px solid var(--wv-indigo-100);
  font-size: 12px;
  line-height: 1.55;
  color: var(--wv-indigo-700);
}
.wv-medida .mi { flex: none; margin-top: 1px; }
.wv-medida b { font-weight: 800; }

/* ── Variantes con precio propio ───────────────────────────────
   Una fila por variante: nombre, precio, oferta, unidades y foto.
   La columna de unidades sólo se ve si el producto lleva inventario;
   la esconde `productos.js` según el interruptor de arriba. */
.var-lista { display: flex; flex-direction: column; gap: 8px; }

.var-cabecera,
.var-fila {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.var-cabecera {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--wv-muted);
  padding: 0 2px;
}
.var-fila .wv-input { padding: 8px 10px; font-size: 13.5px; }

/* Sin inventario, la columna de unidades no existe para nadie. */
.var-lista[data-lleva-stock="0"] .var-col-stock { display: none; }
.var-lista[data-lleva-stock="0"] .var-cabecera,
.var-lista[data-lleva-stock="0"] .var-fila {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.var-acc { display: flex; gap: 4px; }
.var-foto {
  background-size: cover;
  background-position: center;
}
.var-foto.con .mi { opacity: 0; }
.var-foto.con:hover .mi { opacity: 1; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.var-foto.subiendo { opacity: .5; pointer-events: none; }

@media (max-width: 620px) {
  .var-cabecera { display: none; }
  .var-fila,
  .var-lista[data-lleva-stock="0"] .var-fila {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 11px;
    border: 1px solid var(--wv-border-soft);
    border-radius: 11px;
    background: var(--wv-bg);
  }
  .var-fila input[name="var_nombre[]"] { grid-column: 1 / -1; }
  .var-acc { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ── Plantilla del mensaje de WhatsApp ─────────────────────────
   Los huecos se tocan para insertarlos: escribir «{productos}» a
   mano invita a equivocarse en una llave y romper el mensaje. */
.msg-plantilla textarea {
  font-family: var(--wv-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.msg-huecos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
  margin: 10px 0 4px;
}
.msg-hueco {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--wv-border-soft);
  border-radius: 9px;
  background: var(--wv-bg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.msg-hueco:hover { border-color: var(--wv-primary); background: var(--wv-indigo-50); }
.msg-hueco code {
  font-family: var(--wv-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--wv-primary);
}
.msg-hueco span { font-size: 11.5px; color: var(--wv-muted); line-height: 1.45; }

/* ── Qué categorías muestra un bloque ──────────────────────── */
.ed__cats { display: flex; flex-direction: column; gap: 4px; }
.ed__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
}
.ed__cat:hover { background: var(--wv-bg); }
.ed__cat:has(input:checked) {
  background: var(--wv-indigo-50);
  border-color: var(--wv-indigo-100);
}
.ed__cat input { accent-color: var(--wv-primary); flex: none; }
.ed__cat .mi { color: var(--wv-muted); flex: none; }
.ed__cat__nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed__cat__n { font-size: 11.5px; font-weight: 700; color: var(--wv-muted); }

/* ── Adiciones y opciones del producto ─────────────────────── */
.grp-atajos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.grp-atajos .wv-chip {
  border: 1px dashed var(--wv-border);
  background: var(--wv-surface);
  color: var(--wv-slate-700);
  border-radius: 999px;
  padding: 6px 12px;
  font: 600 12.5px var(--wv-font);
  cursor: pointer;
}
.grp-atajos .wv-chip:hover { border-color: var(--wv-primary); color: var(--wv-primary); background: var(--wv-indigo-50); }
.grp-copiar { width: auto; min-width: 0; flex: 1 1 180px; padding: 6px 10px; font-size: 13px; }

.grp-lista { display: flex; flex-direction: column; gap: 12px; }
.grp {
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-md);
  padding: 12px;
  background: var(--wv-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grp__head { display: flex; gap: 8px; align-items: center; }
.grp__nombre { font-weight: 700; }
.grp__reglas { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.grp__t { font-size: 13.5px; font-weight: 600; }
.grp__cuantas { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--wv-slate-700); }
.grp__max { width: 70px; padding: 6px 8px; }
.grp__cab,
.grp-op {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.grp__cab {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--wv-muted); padding: 0 2px;
}
.grp__ops { display: flex; flex-direction: column; gap: 6px; }
.grp-op .wv-input { padding: 8px 10px; font-size: 13.5px; background: var(--wv-surface); }
.grp-op__precio { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--wv-muted); }
.grp-op__disp { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--wv-muted); cursor: pointer; }
.grp-op__disp input { accent-color: var(--wv-primary); }
.grp > .wv-btn { align-self: flex-start; }

/* ── Ajustes del restaurante ───────────────────────────────── */
.rest-modos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.rest-modo {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border: 1.5px solid var(--wv-border);
  border-radius: var(--wv-r-md);
  cursor: pointer;
  background: var(--wv-surface);
}
.rest-modo input { position: absolute; opacity: 0; pointer-events: none; }
.rest-modo .mi { color: var(--wv-muted); flex: none; }
.rest-modo strong { display: block; font-size: 13.5px; }
.rest-modo small { display: block; font-size: 11.5px; color: var(--wv-muted); line-height: 1.35; }
.rest-modo:has(input:checked) { border-color: var(--wv-primary); background: var(--wv-indigo-50); }
.rest-modo:has(input:checked) .mi { color: var(--wv-primary); }
.rest-modo:has(input:focus-visible) { outline: 2px solid var(--wv-primary); outline-offset: 2px; }
.rest-num { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.rest-horario { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 16px; }
.rest-dia { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.rest-dia .wv-input { padding: 7px 8px; font-size: 13.5px; }
.rest-dia__n { display: flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.rest-dia__n input { accent-color: var(--wv-primary); }
.rest-dia:has(.rest-dia__n input:not(:checked)) .wv-input { opacity: .45; }
.rest-dia__a { font-size: 12px; color: var(--wv-muted); }

/* Adiciones y nota de cada línea de un pedido. */
.ped-op { font-size: 12.5px; color: var(--wv-muted); margin-top: 2px; font-weight: 500; }
.ped-op--nota { font-style: italic; }

/* Planes: los medios de pago bajo el botón y el débito automático aparte. */
.plan-medios { margin: 7px 0 0; text-align: center; font-size: 12px; color: var(--wv-muted); }
.plan-auto { margin-top: 4px; text-align: center; }
.plan-auto__btn {
  border: 0; background: none; padding: 4px;
  font: 600 12px var(--wv-font); color: var(--wv-primary);
  text-decoration: underline; cursor: pointer;
}
