/* =====================================================================
   Page Builder — FRONT styles (DEC-023, TRACK B / W7)
   ---------------------------------------------------------------------
   Loaded ONCE by BuilderPageRenderer::render() on builder pages only
   (published + preview iframe). Additive to the tenant theme (avante
   main.css etc.) — never overrides theme rules.

   Prefix: .hsb-  ·  mobile-first  ·  no !important.
   Design tokens use var(--hs-*, fallback) so they degrade gracefully on
   tenants that expose --eb-*/--brand-* instead of the Highstar tokens.
   ===================================================================== */

/* ── Section design pack (instance-level `design`) ─────────────────────
   The wrapper (`.hsb-sec--{space}`) is emitted ONLY when a block's design differs from default;
   `normal` emits no wrapper at all → byte-identity when space=normal. The wrapper's own padding is
   the spacing lever for blocks that bring NO vertical padding of their own (spacer, engine embed). */
.hsb-sec--compact { padding-block: 0.5rem; }
.hsb-sec--wide    { padding-block: 2.5rem; }

/* W10 · Vertical spacing that ACTUALLY shows. Almost every content block roots in the theme's
   `.eb-section` (own `padding: 3rem 0`), which swallowed the wrapper's padding → compact looked like
   normal. So the design pack drives the block's OWN vertical padding directly: compact tightens and
   wide loosens, clearly, against the theme's normal. `normal` still emits no wrapper → theme spacing
   untouched. Direct-child (`>`) + block class = strictly scoped, no !important. */
.hsb-sec--compact > .eb-section { padding-block: 0.75rem; }
.hsb-sec--wide    > .eb-section { padding-block: 4.5rem; }

/* search_widget roots in a denser `.eb-section--search` (~1.3rem): it needs tighter/looser values
   than the generic 3rem blocks to read as compact/wide. Declared AFTER the generic so it wins at
   equal specificity (element carries both `.eb-section` and `.hsb-search-widget`). */
.hsb-sec--compact > .hsb-search-widget { padding-block: 0.4rem; }
.hsb-sec--wide    > .hsb-search-widget { padding-block: 3.5rem; }

/* announcement_bar keeps its own thin inner padding (`.hsb-annc__inner`) — the design pack nudges it
   too so compact/wide are not inert on the bar. */
.hsb-sec--compact > .hsb-annc .hsb-annc__inner { padding-block: 0.25rem; }
.hsb-sec--wide    > .hsb-annc .hsb-annc__inner { padding-block: 1.5rem; }

/* Blocks whose full-bleed inner section owns the background (search widget, engines) let a wrapper
   background show through instead of hiding it behind the theme colour. */
.hsb-sec[style]   > .hsb-search-widget { background: transparent; }
.hsb-engine-embed { display: block; }
.hsb-sec[style]   > .hsb-engine-embed,
.hsb-sec[style]   > .hsb-engine-embed > .eb-section { background: transparent; }

/* T6 (H-027) — bloques cuyo root pinta su PROPIO fondo con .eb-section--alt (features,
   testimonials) dejaban tapado el fondo elegido por el operador en "Diseño de sección": el control
   de Fondo no hacía NADA en esos bloques. Cuando hay un fondo de wrapper (`.hsb-sec[style]`), el
   root se vuelve transparente y el fondo del operador se ve. Sin fondo de wrapper (el 99% de los
   casos) el selector no aplica → `.eb-section--alt` conserva su color y el publicado queda idéntico. */
.hsb-sec[style]   > .eb-section--alt { background: transparent; }

/* ── Hero: full-screen variant ─────────────────────────────────────────
   `hsb-hero--full` is added by the hero template when variant=full. */
.hsb-hero--full { min-height: 100svh; display: flex; align-items: center; }
.hsb-hero--full > .container-xl,
.hsb-hero--full > .eb-hero__inner { width: 100%; }

/* ── Video block ───────────────────────────────────────────────────────
   The .ratio-* aspect is Bootstrap's; here we only round + frame it. */
.hsb-video__inner { max-width: 100%; }
.hsb-video__title {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary, var(--hs-primary, #1a2f5e));
}
.hsb-video__frame {
  overflow: hidden;
  border-radius: var(--hs-radius-md, var(--eb-radius-lg, 12px));
  box-shadow: var(--hs-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.15));
  background: #000;
}
.hsb-video__frame > iframe { border: 0; }
.hsb-video__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hs-radius-md, var(--eb-radius-lg, 12px));
  background: var(--eb-bg-alt, #f2f4f8);
  color: var(--eb-text-muted, #6b7280);
}
.hsb-video__placeholder-msg { font-size: 0.95rem; }

/* ── Gallery: hueco de foto (SOLO preview del builder) ────────────────
   Mismo criterio que [data-hsb-txt]:empty: un ítem sin cargar tiene que gritar "cargame",
   no desaparecer. El publicado nunca emite este markup. */
.hsb-gallery__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--eb-border, #d7dbe3);
  background: var(--eb-bg-alt, #f2f4f8);
  color: var(--eb-text-muted, #6b7280);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.hsb-gallery__ph:hover {
  border-color: var(--hs-accent, #e8a020);
  background: color-mix(in srgb, var(--hs-accent, #e8a020) 8%, #fff);
  color: var(--eb-text, #111827);
}
.hsb-gallery__ph-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
}
.hsb-gallery__ph-in .bi { font-size: 1.6rem; }

/* ── Search widget: optional heading + width + elevation ──────────────── */
.hsb-sw-heading { margin-bottom: 1rem; }
.hsb-sw-title {
  font-weight: 700;
  color: var(--brand-primary, var(--hs-primary, #1a2f5e));
  margin-bottom: 0.25rem;
}
.hsb-sw-subtitle {
  color: var(--eb-text-muted, #6b7280);
  margin-bottom: 0;
}

/* Width: narrow constrains + centres the bar; boxed keeps the theme width. */
.hsb-sw--w-narrow { max-width: 760px; margin-inline: auto; }

/* Elevation: raised adds the shared shadow; flat removes it. */
.hsb-sw--raised { box-shadow: var(--hs-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.15)); }
.hsb-sw--flat   { box-shadow: none; }

/* ── W8.9 · announcement_bar: franja de aviso (colores inline desde props) ── */
.hsb-annc { font-size: 0.95rem; }
.hsb-annc__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: relative;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  /* deja lugar al botón de cierre absoluto en pantallas chicas */
  padding-inline: 2.5rem;
}
.hsb-annc__text { margin: 0; text-align: center; }
.hsb-annc__text a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hsb-annc__link { white-space: nowrap; margin-left: 0.35rem; }
.hsb-annc__close {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: inherit;
  line-height: 1;
  padding: 0.3rem;
  opacity: 0.75;
  cursor: pointer;
}
.hsb-annc__close:hover,
.hsb-annc__close:focus-visible { opacity: 1; }
/* Badge "fuera de fechas" — el markup solo existe en preview (templateData lo emite ahí). */
.hsb-annc__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff3cd;
  color: #664d03;
  border: 1px solid #ffe69c;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── W8.5 · Affordance de edición de BLOQUES en preview ─────────────────
   `.hsb-preview-on` la agrega builder-preview.js (jamás carga en publicado);
   `.hsb-outline`/`.hsb-selected` solo las agrega ese runtime. El outline va
   HACIA ADENTRO (offset negativo) para que se vea también en bloques
   full-bleed con fondo propio (hero, buscador, engine). */
.hsb-preview-on [data-hs-block] { cursor: pointer; }
[data-hs-block].hsb-outline {
  outline: 2px dashed var(--hs-accent, #e8a020);
  outline-offset: -2px;
}
[data-hs-block].hsb-selected {
  outline: 3px solid var(--hs-accent, #e8a020);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 3px rgba(232, 160, 32, 0.22);
}

/* Chip flotante con el nombre del bloque al hover (builder-preview.js lo posiciona). */
.hsb-block-chip {
  position: absolute;
  z-index: 2147483000;
  display: none;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  background: #1a2f5e;
  color: #fff;
  /* W12 — agarre más grande (pedido del dueño: costaba agarrar el tag) */
  font: 600 12.5px/1 system-ui, -apple-system, sans-serif;
  padding: 8px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  white-space: nowrap;
}
.hsb-block-chip.is-visible { display: inline-flex; }
.hsb-block-chip:hover { background: #e8a020; color: #3a2a05; }

/* ── W8 · Hover-edit de textos (SOLO preview: los data-hsb-txt no existen en publicado) ── */
[data-hsb-txt] { transition: box-shadow .12s ease; border-radius: 3px; }
[data-hsb-txt]:hover { box-shadow: 0 0 0 2px rgba(232, 160, 32, .55); cursor: text; }

.hsb-txt-pencil {
  position: absolute;
  z-index: 2147483000;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #1a2f5e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  cursor: pointer;
  padding: 0;
}
.hsb-txt-pencil.is-visible { display: inline-flex; }
.hsb-txt-pencil:hover { background: #e8a020; }

/* ═══════════ W8.7 · Edición hiper-granular en preview (SOLO preview) ═══════════
   Todos los selectores dependen de atributos/clases que solo existen cuando
   builder-preview.js corre (nunca en publicado): data-hsb-sitetxt / data-hsb-siteattr /
   .hsb-img-pencil / .hsb-lock-chip / .hsb-chrome-locklight. */

/* C — site texts (labels/placeholders de buscadores): mismo aro de hover que data-hsb-txt. */
[data-hsb-sitetxt] { transition: box-shadow .12s ease; border-radius: 3px; }
[data-hsb-sitetxt]:hover { box-shadow: 0 0 0 2px rgba(232, 160, 32, .55); cursor: text; }
[data-hsb-siteattr]:hover { box-shadow: 0 0 0 2px rgba(232, 160, 32, .55); }

/* B — lapicito de IMAGEN (hover sobre [data-hsb-img]; builder-preview.js lo posiciona). */
.hsb-img-pencil {
  position: absolute;
  z-index: 2147483000;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #1a2f5e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  cursor: pointer;
  padding: 0;
}
.hsb-img-pencil.is-visible { display: inline-flex; }
.hsb-img-pencil:hover { background: #e8a020; color: #3a2a05; }

/* D — chrome bloqueado en preview de página normal: navbar/footer con overlay sutil al hover
   (el candado/label los pinta el chip .hsb-lock-chip). En modo chrome (W8.6) no se aplica. */
.hsb-chrome-locklight {
  outline: 2px dashed rgba(103, 114, 138, .75);
  outline-offset: -2px;
  cursor: not-allowed;
}
.hsb-lock-chip { background: #67728a; }
.hsb-lock-chip:hover { background: #1a2f5e; color: #fff; }
/* ═══════════ fin W8.7 ═══════════ */

/* ═══════════ W10-A · Edición de ICONO en preview (SOLO preview) ═══════════
   `[data-hsb-icon]` lo emite el bloque únicamente en preview (nunca en publicado), y
   `.hsb-icon-hot` / `.hsb-icon-pencil` sólo los agrega builder-preview.js (que jamás corre en
   publicado). Al pasar el mouse sobre un icono editable aparece un aro + un lapicito; el click sobre
   el icono o el lapicito abre el selector de icono de ese campo. */
[data-hsb-icon] { transition: box-shadow .12s ease; }
[data-hsb-icon]:hover,
[data-hsb-icon].hsb-icon-hot {
  outline: 2px dashed var(--hs-accent, #e8a020);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: pointer;
}
.hsb-icon-pencil {
  position: absolute;
  z-index: 2147483000;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #1a2f5e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  cursor: pointer;
  padding: 0;
}
.hsb-icon-pencil.is-visible { display: inline-flex; }
.hsb-icon-pencil:hover { background: #e8a020; }
/* ═══════════ fin W10-A ═══════════ */

/* ═══════════ W11 · Secciones internas del engine (SOLO preview) ═══════════
   Todos los selectores dependen de atributos/clases que solo existen cuando builder-preview.js
   corre (data-hsb-esec, .hsb-esec-*): publicado byte-inerte. */

/* Aro de hover de una sección del engine (más sutil que el de bloque: guiones finos). */
[data-hsb-esec].hsb-esec-hot {
  outline: 2px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 75%, #fff);
  outline-offset: -2px;
  border-radius: 4px;
}

/* ═══════════ W15 · Las partes del motor se VEN, sin tener que pasar el mouse ═══════════
   El problema real que resuelve (dueño, 2026-07-16): "en tickets tengo dos secciones para editar y
   no me indica cuáles son, tengo que abrirlo para ver" + "se ven pegadas… es continuo, sin salto de
   línea entre las dos" + "quise agregar un bloque en el medio y me lo mandó afuera". Las tres son la
   misma cosa: el motor emitía sus partes pegadas y sin nombre, así que el operador no tenía dónde
   apuntar. Ahora cada parte lleva un recuadro punteado permanente + su nombre, y entre parte y parte
   hay un hueco real.

   El hueco YA existe: `.hsb-esg` emite `gap:var(--esg-gap,1.5rem)` (theme_sections.php:522). Lo que
   faltaba no era espacio sino BORDE: sin un límite visible, 24px de aire se leen como continuidad.
   Por eso acá no se toca el espaciado —sería pelearle al gap del theme— sino que se dibuja el
   contorno. Con `outline-offset:4px` las dos partes quedan a 8px de contorno a contorno: se ven como
   dos cajas, sin mover un pixel del contenido.

   SOLO preview: todo cuelga de `.hsb-preview-on` (la clase la agrega builder-preview.js) y de
   `data-hsb-esec` (lo emite el wrap sólo en preview) ⇒ el publicado no cambia ni un byte.

   El `:not()` NO es cosmético: sin él este aro le gana al de hover (`.hsb-esec-hot`, arriba) y lo
   apaga. Los dos selectores tienen la MISMA especificidad (0,2,0) — un atributo + una clase — así que
   decide el orden en el archivo, y éste va después. Excluir los dos estados a mano deja el desempate
   explícito y a prueba de que alguien reordene el archivo. */
.hsb-preview-on [data-hsb-esec]:not(.hsb-esec-hot):not(.hsb-esec-sel) {
  outline: 1px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 42%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}
/* `position:relative` sí va en todos: es el contexto del nombre (::before), que no depende del estado. */
.hsb-preview-on [data-hsb-esec] { position: relative; }

/* Nombre de la parte, arriba a la izquierda. Sale del atributo que ya emite el wrap. */
.hsb-preview-on [data-hsb-esec][data-hsb-esec-label]::before {
  content: attr(data-hsb-esec-label);
  position: absolute;
  top: -8px;
  left: 6px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 999px;
  background: #3a4a6e;
  color: #fff;
  font: 600 10px/1.5 system-ui, sans-serif;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: .82;
}
.hsb-preview-on [data-hsb-esec].hsb-esec-hot::before,
.hsb-preview-on [data-hsb-esec].hsb-esec-sel::before { opacity: 1; }
/* "Ver como cliente" apaga el recuadro y el nombre: el cliente ve la página real. */
.hsb-affordances-off [data-hsb-esec] { outline: none !important; }
.hsb-affordances-off [data-hsb-esec][data-hsb-esec-label]::before { display: none !important; }

/* Chip de sección (variante del chip de bloque: se ancla arriba a la DERECHA, tono neutro). */
.hsb-esec-chip {
  background: #3a4a6e;
  cursor: grab;
}
.hsb-esec-chip:active { cursor: grabbing; }

/* Indicador de inserción durante el drag (línea acento donde va a caer la sección). */
.hsb-esec-indicator {
  position: absolute;
  z-index: 2147483000;
  height: 3px;
  border-radius: 2px;
  background: var(--hs-accent, #e8a020);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  display: none;
  pointer-events: none;
}
.hsb-esec-indicator.is-visible { display: block; }

/* W14-D6 (BUG-2) — indicador VERTICAL para layouts EN FILA (barra de filtros, precio+CTA, tabs):
   antes el before/after se decidía solo por Y y la línea era siempre horizontal → drop aleatorio. */
.hsb-esec-indicator--v { width: 3px; height: auto; }

/* FEATURE F — "+ Agregar bloque" INLINE: línea de inserción + píldora "+" que builder-preview.js
   dibuja al acercar el cursor al borde entre bloques top-level (SOLO preview; el script nunca corre
   en publicado). La línea NO recibe el puntero (para no tapar el hover); la píldora sí (es el click). */
.hsb-add-indicator {
  position: absolute;
  z-index: 2147483000;
  height: 3px;
  border-radius: 2px;
  background: var(--hs-accent, #e8a020);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  display: none;
  pointer-events: none;
}
.hsb-add-indicator.is-visible { display: block; }

.hsb-add-pill {
  position: absolute;
  z-index: 2147483001;
  display: none;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  background: #1a2f5e;
  color: #fff;
  font: 600 12.5px/1 system-ui, -apple-system, sans-serif;
  padding: 7px 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  cursor: pointer;
  white-space: nowrap;
}
.hsb-add-pill.is-visible { display: inline-flex; }
.hsb-add-pill:hover { background: var(--hs-accent, #e8a020); color: #3a2a05; }

/* "Ver como cliente" apaga también el "+" (belt-and-braces; el JS ya lo oculta). */
.hsb-affordances-off .hsb-add-indicator,
.hsb-affordances-off .hsb-add-pill { display: none !important; }

/* Estado global durante el drag: cursor de agarre + sin selección de texto en todo el doc. */
.hsb-esec-dragging { cursor: grabbing; user-select: none; }
.hsb-esec-dragging * { cursor: grabbing; }

/* W12 — la pieza que se está moviendo se marca ENTERA (sección del engine o bloque completo). */
.hsb-drag-src {
  outline: 3px solid var(--hs-accent, #e8a020);
  outline-offset: -3px;
  opacity: .45;
  border-radius: 4px;
}

/* W15 — bloque que el preview está reacomodando EN VIVO mientras se arrastra: transparente al
   hit-test. Al moverlo queda debajo del cursor y `elementFromPoint` lo devolvería a él ⇒ no habría
   destino ⇒ el indicador se apagaría solo. Clase propia y no `.hsb-drag-src`: esa la comparten los
   drags de sección y de card, que SÍ dependen de que el nodo capture el hit-test para descartarse
   como destino. Sólo existe durante el drag (JS la saca en onDragCleanup). */
.hsb-drag-reflow { pointer-events: none; }

/* W12 — ghost flotante que sigue al cursor: "esto es lo que estás moviendo". */
.hsb-drag-ghost {
  position: fixed;
  z-index: 2147483001;
  display: none;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: #1a2f5e;
  color: #fff;
  font: 700 13px/1 system-ui, -apple-system, sans-serif;
  padding: 9px 16px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
  pointer-events: none;
  max-width: 320px;
  white-space: nowrap;
}
.hsb-drag-ghost.is-visible { display: inline-flex; }
.hsb-drag-ghost__label { overflow: hidden; text-overflow: ellipsis; }

/* W12 — mantener apretado: pulso sutil mientras el hold "carga" (delay evita flash en clicks). */
@keyframes hsb-hold-pulse {
  0%   { outline-color: color-mix(in srgb, var(--hs-accent, #e8a020) 35%, transparent); }
  100% { outline-color: var(--hs-accent, #e8a020); }
}
.hsb-hold-pending {
  outline: 3px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 35%, transparent);
  outline-offset: -3px;
  border-radius: 4px;
  animation: hsb-hold-pulse .30s ease-in .10s both;
}

/* W14-D6 (c) — el hold ahora es DESCUBRIBLE: anillo de progreso + texto junto al cursor mientras
   se mantiene apretado, para que el gesto "agarro y arrastro" no fracase en silencio. */
@property --hsb-hold-p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.hsb-hold-ring {
  position: fixed;
  z-index: 2147483001;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(26, 47, 94, .92);
  color: #fff;
  font: 600 11.5px/1 system-ui, -apple-system, sans-serif;
  pointer-events: none;
  white-space: nowrap;
}
.hsb-hold-ring.is-visible { display: inline-flex; }
.hsb-hold-ring__dial {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(var(--hs-accent, #e8a020) var(--hsb-hold-p, 0%), rgba(255, 255, 255, .25) 0);
}
@keyframes hsb-hold-fill { from { --hsb-hold-p: 0%; } to { --hsb-hold-p: 100%; } }
.hsb-hold-ring.is-visible .hsb-hold-ring__dial { animation: hsb-hold-fill 300ms linear forwards; }
.hsb-hold-ring__label:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hsb-hold-ring.is-visible .hsb-hold-ring__dial { animation: none; --hsb-hold-p: 100%; }
}

/* Divisor de columnas (inyectado por builder-preview.js en filas con 2 columnas). */
.hsb-esg__row { position: relative; }
.hsb-esec-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100% + 1.5rem) * var(--esg-l, 7) / 12 - 1.5rem / 2 - 6px);
  width: 12px;
  cursor: col-resize;
  z-index: 40;
  display: none;
  touch-action: none;
}
.hsb-esec-divider::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--hs-accent, #e8a020) 45%, transparent);
  opacity: 0;
  transition: opacity .15s ease;
}
.hsb-esec-divider:hover::before,
.hsb-esec-splitting .hsb-esec-divider::before { opacity: 1; }
@media (min-width: 992px) {
  .hsb-preview-on .hsb-esec-divider { display: block; }
}
/* W-ROLES (CONTRATO v2 §6.6) — sin capacidad `inner` (disposición interna del motor), el divisor
   de columnas se apaga: a diferencia de los chips esec/cardel (on-demand por hover, gateados en
   JS), el divisor es visible SIN interacción — necesita esta regla CSS para desaparecer. */
.hsb-caps-no-inner .hsb-esec-divider { display: none !important; }
.hsb-esec-splitting { cursor: col-resize; }
.hsb-esec-splitting * { cursor: col-resize; }

/* ── W11 · Hero: padding por CSS var (movido del inline) — habilita el Vertical spacing ── */
/* Base: consume la var que el template emite inline (compact 2.75 / standard 4 / tall 6rem). */
.hsb-hero { padding-top: var(--hsb-hpad, 4rem); padding-bottom: var(--hsb-hpad, 4rem); }
/* Design pack: ahora compact/wide SÍ le ganan al padding del hero (regla más específica). */
.hsb-sec--compact > .hsb-hero { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.hsb-sec--wide    > .hsb-hero { padding-top: 7rem; padding-bottom: 7rem; }
/* ═══════════ fin W11 (front) ═══════════ */

/* ═══════════ W13.1 · Textos vacíos SIEMPRE editables (solo preview: los markers no existen
   en publicado). Un texto vacío se ve como un guión punteado clickeable — sin esto un bloque
   nuevo o un texto vaciado queda inseleccionable. ═══════════ */
[data-hsb-txt]:empty,
[data-hsb-sitetxt]:empty {
  display: inline-block;
  min-width: 3.5ch;
  min-height: .9em;
  border-radius: 4px;
  outline: 1.5px dashed rgba(26, 47, 94, .45);
  outline-offset: 2px;
  cursor: pointer;
  vertical-align: baseline;
}
[data-hsb-txt]:empty:hover,
[data-hsb-sitetxt]:empty:hover { outline-color: var(--hs-accent, #e8a020); }

/* ═══════════ W13.3 · Elementos de card ([data-hsb-cardel], SOLO preview) ═══════════
   Los marcadores data-hsb-cardel los emite themeCardMark() únicamente en preview y las clases
   .hsb-cardel-* solo las agrega builder-preview.js: publicado byte-inerte. */

/* Recuadro del elemento hovereado (más fino que el aro de sección: es una pieza chica). */
[data-hsb-cardel].hsb-cardel-hot {
  outline: 2px dotted color-mix(in srgb, var(--hs-accent, #e8a020) 85%, #fff);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Chip flotante del elemento (variante del chip de bloque: tono propio, más chico, arrastrable). */
.hsb-cardel-chip {
  background: #4a5a7e; /* ni bloque (#1a2f5e) ni sección (#3a4a6e): pieza de tercer nivel */
  font: 600 11.5px/1 system-ui, -apple-system, sans-serif;
  padding: 5px 10px;
  gap: 6px;
  cursor: grab;
  max-width: 260px;
}
.hsb-cardel-chip:active { cursor: grabbing; }
.hsb-cardel-chip:hover { background: #1a2f5e; color: #fff; }
.hsb-cardel-chip__label { overflow: hidden; text-overflow: ellipsis; }

/* Ojito del chip (solo elementos ocultables): ocultar en TODAS las cards del tipo. */
.hsb-cardel-chip__eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
}
.hsb-cardel-chip__eye:hover { background: var(--hs-accent, #e8a020); color: #3a2a05; }
.hsb-cardel-chip__eye svg { display: block; }

/* "Esto cambia en TODAS las cards": el mismo elemento en las demás cards del tipo, durante el drag. */
.hsb-cardel-twin {
  outline: 2px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* ═══════════ fin W13.3 (front) ═══════════ */

/* ═══════════ W14 · Preview hyper-editable (SOLO preview) ═══════════
   Todo depende de clases/atributos que builder-preview.js agrega (jamás en publicado). */

/* Todo lo arrastrable muestra el cursor de agarre y no compite con el scroll táctil del iframe. */
.hsb-preview-on [data-hsb-esec],
.hsb-preview-on [data-hsb-cardel]:not([data-hsb-cardel-fixed="1"]) { touch-action: none; }
.hsb-block-chip { cursor: grab; touch-action: none; }
.hsb-block-chip:active { cursor: grabbing; }

/* W14-D6 §5.3 — botones ◂ ▸ / ▴ ▾ del chip: alternativa sin drag, EN el preview. */
.hsb-chip-moves { display: inline-flex; gap: 2px; margin-left: 2px; flex: none; }
.hsb-chip-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font: 700 11px/1 system-ui, sans-serif;
  cursor: pointer;
}
.hsb-chip-move:hover { background: var(--hs-accent, #e8a020); color: #3a2a05; }
.hsb-chip-move.is-off { opacity: .35; cursor: default; pointer-events: none; }

/* W14-D6/D3 — candado del chip de card (elemento NO ocultable): inerte, tono gris. */
.hsb-cardel-chip__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .7);
  cursor: help;
}
.hsb-cardel-chip__lock:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.hsb-cardel-chip__lock svg { display: block; }

/* W14-D1 — segmented de posición del medio (foto/ícono) dentro del chip de card. */
.hsb-cardel-chip__pos { display: inline-flex; gap: 2px; margin-right: 4px; flex: none; }
.hsb-cardel-chip__pos button {
  border: 0;
  background: rgba(255, 255, 255, .16);
  border-radius: 4px;
  padding: 1px 3px;
  line-height: 0;
  cursor: pointer;
}
.hsb-cardel-chip__pos button[aria-pressed="true"] { background: var(--hs-accent, #e8a020); }
.hsb-cardel-chip__pos button:hover { background: rgba(255, 255, 255, .32); }
.hsb-cardel-chip__pos svg { display: block; }

/* W14-D6 §8.3 — chip "se edita en Traducciones" (textos JS / <option>): tono gris, no editable acá. */
[data-hsb-txt-ext] { cursor: help; }
.hsb-ext-chip { background: #67728a; }
.hsb-ext-chip:hover { background: #1a2f5e; color: #fff; }

/* W14-D6 §3.3 — espejo del panel: hover del panel → aro suave en el nodo del preview. */
.hsb-peek {
  outline: 2px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 60%, #fff);
  outline-offset: 2px;
  border-radius: 4px;
}

/* W14-D6 — selección persistente de la sub-parte (sección / elemento / ítem), distinta del hover. */
[data-hsb-esec].hsb-esec-sel,
[data-hsb-cardel].hsb-cardel-sel,
[data-hsb-item].hsb-item-sel {
  outline: 2px solid var(--hs-accent, #e8a020);
  outline-offset: 2px;
  border-radius: 4px;
}

/* W14-D6 §9.1 — flash post-acción: pulso breve del nodo afectado (sobrevive al reload del motor). */
@keyframes hsb-flash-pulse {
  0%, 100% { outline-color: transparent; }
  35%      { outline-color: var(--hs-accent, #e8a020); }
}
.hsb-flash {
  outline: 3px solid transparent;
  outline-offset: 2px;
  border-radius: 4px;
  animation: hsb-flash-pulse .9s ease-in-out 1;
}
@media (prefers-reduced-motion: reduce) {
  .hsb-flash { animation: none; outline-color: var(--hs-accent, #e8a020); }
}

/* W14-D2 — al arrastrar un BLOQUE, las secciones/slots del motor se ofrecen como destino. */
.hsb-preview-on.hsb-esec-dragging [data-hsb-esec],
.hsb-preview-on.hsb-esec-dragging [data-hsb-slot] {
  outline: 1px dashed var(--brand-accent, var(--hs-accent, #e8a020));
  outline-offset: 2px;
}
/* Bloque embebido entre secciones del motor: hereda el gap del grid; min-width evita overflow. */
.hsb-esg__slot { min-width: 0; }

/* ═══════════ FIX-D · Bloque OCULTO en el preview (NUEVO-6, SOLO preview) ═══════════
   El renderer envuelve los bloques ocultos en .hsb-block-hidden (reload) y handleVisible hace lo mismo
   en vivo. El wrapper existía pero NO tenía CSS → el bloque se veía igual que uno visible y el operador
   no percibía el efecto de "Ocultar" (ni al togglear ni tras recargar). Fantasma explícito: atenuado +
   trama diagonal + contorno punteado + chapa "prohibido" arriba a la derecha. Publicado: el bloque
   oculto no se renderiza (el wrapper no existe), así que esta regla nunca lo toca. */
.hsb-preview-on .hsb-block-hidden {
  position: relative;
  opacity: .5;
  outline: 2px dashed color-mix(in srgb, var(--hs-accent, #e8a020) 70%, #8a8a8a);
  outline-offset: -2px;
  border-radius: 4px;
}
.hsb-preview-on .hsb-block-hidden::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;   /* el bloque sigue seleccionable (para "Mostrar") */
  border-radius: inherit;
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--hs-primary, #1a2f5e) 9%, transparent) 0,
    color-mix(in srgb, var(--hs-primary, #1a2f5e) 9%, transparent) 6px,
    transparent 6px, transparent 15px);
}
.hsb-preview-on .hsb-block-hidden::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: none;
  /* círculo con barra diagonal = símbolo universal de "oculto / bloqueado" (sin texto → sin i18n). */
  background:
    linear-gradient(135deg, transparent calc(50% - 1.4px), #fff calc(50% - 1.4px), #fff calc(50% + 1.4px), transparent calc(50% + 1.4px)),
    var(--hs-primary, #1a2f5e);
}

/* W14-D6 #3 — modo "Ver como cliente": apaga TODOS los marcadores del preview de una sola pasada. */
.hsb-affordances-off .hsb-block-chip,
.hsb-affordances-off .hsb-txt-pencil,
.hsb-affordances-off .hsb-img-pencil,
.hsb-affordances-off .hsb-icon-pencil,
.hsb-affordances-off .hsb-drag-ghost,
.hsb-affordances-off .hsb-hold-ring,
.hsb-affordances-off .hsb-esec-indicator { display: none !important; }
.hsb-affordances-off [data-hs-block],
.hsb-affordances-off [data-hsb-esec],
.hsb-affordances-off [data-hsb-cardel],
.hsb-affordances-off [data-hsb-icon],
.hsb-affordances-off [data-hsb-txt],
.hsb-affordances-off [data-hsb-sitetxt],
.hsb-affordances-off [data-hsb-txt-ext] { cursor: default !important; }
.hsb-affordances-off [data-hs-block].hsb-outline,
.hsb-affordances-off [data-hs-block].hsb-selected,
.hsb-affordances-off .hsb-esec-hot,
.hsb-affordances-off .hsb-cardel-hot,
.hsb-affordances-off .hsb-esec-sel,
.hsb-affordances-off .hsb-cardel-sel,
.hsb-affordances-off .hsb-item-sel,
.hsb-affordances-off .hsb-peek,
.hsb-affordances-off [data-hsb-txt]:empty,
.hsb-affordances-off [data-hsb-sitetxt]:empty { outline: none !important; box-shadow: none !important; }
/* "Ver como cliente": el fantasma del bloque oculto es un marcador de EDICIÓN → se apaga (el bloque
   queda como estaba: en preview los ocultos igual se renderizan, solo sin la señalización). */
.hsb-affordances-off .hsb-block-hidden { opacity: 1 !important; outline: none !important; }
.hsb-affordances-off .hsb-block-hidden::before,
.hsb-affordances-off .hsb-block-hidden::after { display: none !important; }

/* QA 2026-10-23 — link de vista previa abierto solo (builder-preview.js marca .hsb-share-view y no
   instala nada de edición): se ve como el sitio — sin bloques ocultos ni huecos de "cargame". */
.hsb-share-view .hsb-block-hidden,
.hsb-share-view .hsb-html-raw--empty,
.hsb-share-view .hsb-gallery__ph,
.hsb-share-view [data-hsb-txt]:empty,
.hsb-share-view [data-hsb-sitetxt]:empty { display: none !important; }
/* ═══════════ fin W14 (front) ═══════════ */
