*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f4f5; --sidebar-bg: #fff; --card-bg: #fff;
  --text-primary: #18181b; --text-secondary: #71717a; --text-muted: #a1a1aa;
  --border: #e4e4e7; --radius: 12px; --radius-sm: 8px;
  --accent-blue: #7a9abf; --accent-green: #8DB097; --accent-red: #D18989;
  --sidebar-active-bg: #18181b; --sidebar-active-text: #fff;
}
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text-primary); display: flex; min-height: 100vh; }

/* ── SIDEBAR (sistema de diseño compartido) ── */
.sidebar { width: 200px; min-width: 200px; background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 12px; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.brand-icon { width: 32px; height: 32px; background: var(--text-primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.brand-icon svg { width: 18px; height: 18px; }
.brand-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--text-muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s; text-decoration: none; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); color: var(--text-primary); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.user-info { padding: 8px 12px 4px; }
.user-email  { font-size: 12px; font-weight: 500; }
.user-status { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.logout-btn { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: #ef4444; cursor: pointer; background: none; border: none; width: 100%; margin-top: 2px; font-family: inherit; }
.logout-btn:hover { background: #fef2f2; }
.logout-btn svg { width: 15px; height: 15px; }

/* ── BUILDER ── */
.hb-main { position: fixed; inset: 0 0 0 200px; display: flex; flex-direction: column; background: var(--bg); }
.hb-topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--border); }
.hb-title { font-size: 15px; font-weight: 600; line-height: 1.1; }
.hb-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.hb-topbar-right { display: flex; align-items: center; gap: 12px; }
.hb-status { font-size: 12px; color: var(--text-muted); min-width: 60px; text-align: right; }
.hb-status.dirty { color: #b0894e; }
.hb-status.saved { color: #4a7053; }
.hb-viewport-toggle { display: flex; background: var(--bg); border-radius: 8px; padding: 2px; }
.hb-vp-btn { border: none; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-family: inherit; }
.hb-vp-btn.active { background: #fff; color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.hb-vp-btn svg { width: 16px; height: 16px; }
.hb-vp-btn span { font-size: 12px; font-weight: 500; }
@media (max-width: 1100px) { .hb-vp-btn span { display: none; } }
.hb-btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: none; background: var(--text-primary); color: #fff; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.hb-btn-primary:hover { background: #27272a; }
.hb-btn-primary svg { width: 14px; height: 14px; }
.hb-btn-primary:disabled { opacity: .45; cursor: default; }
.hb-btn-outline { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text-primary); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s; }
.hb-btn-outline:hover { background: var(--bg); border-color: #d4d4d8; }
.hb-btn-outline svg { width: 14px; height: 14px; }

.hb-body { flex: 1; display: flex; min-height: 0; }
.hb-panel-head { height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 11px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }

/* Biblioteca */
.hb-library { width: 236px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.hb-library-search { padding: 10px; position: relative; }
.hb-library-search svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); }
.hb-library-search input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 12.5px; outline: none; }
.hb-library-list { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.hb-lib-group { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 12px 4px 6px; }
.hb-lib-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; border: 1px solid var(--border); background: #fff; margin-bottom: 6px; cursor: pointer; transition: all .12s; }
.hb-lib-item:hover { border-color: #d4d4d8; background: var(--bg); }
.hb-lib-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.hb-lib-ico svg { width: 15px; height: 15px; }
.hb-lib-info { flex: 1; min-width: 0; }
.hb-lib-name { font-size: 12.5px; font-weight: 500; }
.hb-lib-add { width: 22px; height: 22px; border-radius: 6px; border: none; background: var(--bg); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hb-lib-item:hover .hb-lib-add { background: var(--text-primary); color: #fff; }
.hb-lib-add svg { width: 13px; height: 13px; }

/* Constructor */
.hb-canvas { width: 300px; flex-shrink: 0; background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.hb-count { background: var(--border); color: var(--text-secondary); font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.hb-blocks { flex: 1; overflow-y: auto; padding: 12px; }
.hb-block { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 9px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.hb-block:hover { border-color: #d4d4d8; }
.hb-block.sel { border-color: var(--text-primary); box-shadow: 0 0 0 1px var(--text-primary); }
.hb-block.inactivo { opacity: .55; }
.hb-block.dragging { opacity: .4; }
.hb-block-handle { cursor: grab; color: var(--text-muted); display: flex; flex-shrink: 0; }
.hb-block-handle svg { width: 14px; height: 14px; }
.hb-block-ico { width: 26px; height: 26px; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.hb-block-ico svg { width: 14px; height: 14px; }
.hb-block-info { flex: 1; min-width: 0; }
.hb-block-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-block-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-block-acts { display: flex; gap: 1px; flex-shrink: 0; }
.hb-ic-btn { width: 24px; height: 24px; border: none; background: none; border-radius: 6px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hb-ic-btn:hover { background: var(--bg); color: var(--text-primary); }
.hb-ic-btn.danger:hover { background: #f7eeee; color: #8a4444; }
.hb-ic-btn svg { width: 14px; height: 14px; }
.hb-ic-btn.on { color: #4a7053; }

.hb-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--text-muted); }
.hb-empty svg { width: 38px; height: 38px; margin-bottom: 10px; opacity: .5; }
.hb-empty p { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.hb-empty span { font-size: 12px; margin-top: 3px; max-width: 210px; line-height: 1.4; }

/* Vista previa */
.hb-preview-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hb-preview-hint { font-size: 10px; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.hb-preview-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; justify-content: center; }
.hb-preview { width: 100%; max-width: 1080px; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.05); align-self: flex-start; transition: max-width .2s; }
.hb-preview.tablet { max-width: 768px; }
.hb-preview.mobile { max-width: 390px; }
.hb-config-disp { font-size: 11.5px; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hb-config-disp b { color: var(--text-primary); }
.hb-config-disp button { border: none; background: none; color: var(--accent-blue); font-family: inherit; font-size: 11.5px; cursor: pointer; font-weight: 600; }
.hb-preview-empty { padding: 70px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.hb-pblock { position: relative; cursor: pointer; }
.hb-pblock:hover { outline: 2px dashed var(--border); outline-offset: -2px; }
.hb-pblock.sel { outline: 2px solid var(--accent-blue); outline-offset: -2px; }

/* Efectos hover configurables de las tarjetas de producto (preview) */
.hb-prod-card { transition: transform .18s ease, box-shadow .18s ease; }
.hb-prod-card .hb-prod-img { transition: transform .3s ease; }
.hb-prod-card.hv-elevar:hover, .hb-prod-card.hv-ambos:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(0,0,0,.16) !important; }
.hb-prod-card.hv-zoom:hover .hb-prod-img, .hb-prod-card.hv-ambos:hover .hb-prod-img { transform: scale(1.07); }

/* Panel de configuración */
.hb-config { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; background: #fff; border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgba(0,0,0,.08); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; z-index: 120; }
.hb-config.open { transform: translateX(0); }
.hb-config-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.hb-config-title { font-size: 14px; font-weight: 600; }
.hb-config-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hb-config-close { border: none; background: none; cursor: pointer; color: var(--text-muted); padding: 2px; }
.hb-config-close svg { width: 18px; height: 18px; }
.hb-config-body { flex: 1; overflow-y: auto; padding: 16px 18px 40px; }

/* Campos del config */
.hb-field { margin-bottom: 14px; }
.hb-field > label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.hb-field input[type=text], .hb-field input[type=url], .hb-field input[type=number], .hb-field input[type=datetime-local], .hb-field textarea, .hb-field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 12.5px; color: var(--text-primary); background: #fff; outline: none;
}
.hb-field textarea { resize: vertical; min-height: 64px; }
.hb-field input:focus, .hb-field textarea:focus, .hb-field select:focus { border-color: #a1a1aa; }
.hb-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hb-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.hb-switch input { opacity: 0; width: 0; height: 0; }
.hb-switch .slider { position: absolute; inset: 0; background: #d4d4d8; border-radius: 99px; transition: .15s; cursor: pointer; }
.hb-switch .slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.hb-switch input:checked + .slider { background: #8DB097; }
.hb-switch input:checked + .slider:before { transform: translateX(16px); }
.hb-color-row { display: flex; align-items: center; gap: 8px; }
.hb-color-row input[type=color] { width: 40px; height: 32px; border: 1px solid var(--border); border-radius: 7px; padding: 2px; background: #fff; cursor: pointer; }
.hb-color-hex { font-family: monospace; font-size: 12px; color: var(--text-secondary); }
.hb-img-preview { width: 100%; height: 100px; border: 1px dashed var(--border); border-radius: 8px; background-color: var(--bg); background-size: cover; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11.5px; margin-bottom: 6px; text-align: center; padding: 0 8px; }
.hb-img-preview.hb-drop { cursor: pointer; transition: border-color .12s, background-color .12s; }
.hb-img-preview.hb-drop:hover { border-color: #a1a1aa; }
.hb-img-preview.has { border-style: solid; }
.hb-img-preview.dragover { border-color: #8DB097; background-color: #edf3ee; color: #4a7053; }
.hb-img-btns { display: flex; gap: 6px; }
.hb-mini-btn { flex: 1; padding: 6px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-family: inherit; font-size: 11.5px; color: var(--text-secondary); cursor: pointer; }
.hb-mini-btn:hover { border-color: #d4d4d8; color: var(--text-primary); }
.hb-repeater-item { border: 1px solid var(--border); border-radius: 9px; padding: 10px; margin-bottom: 8px; background: var(--bg); }
.hb-rep-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hb-rep-title { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.hb-rep-acts { display: flex; gap: 1px; }
.hb-add-item { width: 100%; padding: 8px; border: 1px dashed var(--border); border-radius: 8px; background: none; font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-secondary); cursor: pointer; margin-top: 2px; }
.hb-add-item:hover { border-color: #a1a1aa; color: var(--text-primary); background: var(--bg); }
.hb-multi { border: 1px solid var(--border); border-radius: 8px; max-height: 170px; overflow-y: auto; padding: 4px; }
.hb-multi label { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.hb-multi label:hover { background: var(--bg); }
.hb-multi input { accent-color: var(--text-primary); }
.hb-section-sep { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Toast */
.hb-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #18181b; color: #fff; font-size: 13px; font-weight: 500; padding: 11px 18px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 9999; display: flex; align-items: center; gap: 9px; }
.hb-toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.hb-toast.success { background: #1f3d2b; } .hb-toast.success svg { color: #86efac; }
.hb-toast.error   { background: #45201f; } .hb-toast.error svg { color: #fca5a5; }
.hb-toast.info    { background: #18181b; } .hb-toast.info svg { color: #93c5fd; }

/* ── Paneles retráctiles ── */
.hb-collapse-btn { border: none; background: none; cursor: pointer; color: var(--text-muted); padding: 3px; display: flex; align-items: center; border-radius: 6px; transition: color .15s, background .15s; }
.hb-collapse-btn:hover { color: var(--text-primary); background: var(--bg); }
.hb-collapse-btn svg { width: 16px; height: 16px; }
.hb-library, .hb-canvas { transition: width .2s ease; }
.hb-rail { display: none; }
.hb-library.collapsed, .hb-canvas.collapsed { width: 44px; overflow: hidden; }
.hb-library.collapsed > :not(.hb-rail), .hb-canvas.collapsed > :not(.hb-rail) { display: none; }
.hb-library.collapsed .hb-rail, .hb-canvas.collapsed .hb-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; height: 100%; padding-top: 12px; border: none; background: none; cursor: pointer; color: var(--text-secondary); font-family: inherit; transition: color .15s; }
.hb-rail:hover { color: var(--text-primary); }
.hb-rail svg { width: 16px; height: 16px; flex-shrink: 0; }
.hb-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }

/* ── Modales ── */
.hb-modal-overlay { position: fixed; inset: 0; background: rgba(24,24,27,.42); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; transition: opacity .18s ease; padding: 20px; }
.hb-modal-overlay.show { opacity: 1; }
.hb-modal { background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.28); width: 100%; max-width: 400px; padding: 24px 24px 20px; text-align: center; transform: scale(.94) translateY(6px); transition: transform .2s cubic-bezier(.2,.8,.3,1); }
.hb-modal-overlay.show .hb-modal { transform: scale(1) translateY(0); }
.hb-modal-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.hb-modal-icon svg { width: 26px; height: 26px; }
.hb-modal-success .hb-modal-icon { background: #e7f6ec; color: #2e7d47; }
.hb-modal-error   .hb-modal-icon { background: #fbeaea; color: #c0392b; }
.hb-modal-warning .hb-modal-icon { background: #fdf3e3; color: #b0894e; }
.hb-modal-info    .hb-modal-icon { background: #e9f0f8; color: #3f6899; }
.hb-modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.hb-modal-msg { font-size: 13.5px; color: var(--text-secondary); margin-top: 7px; line-height: 1.55; }
.hb-modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.hb-modal-actions button { flex: 1; padding: 10px 16px; border-radius: 9px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); transition: all .15s; }
.hb-modal-btn-cancel { background: #fff; color: var(--text-secondary); }
.hb-modal-btn-cancel:hover { background: var(--bg); border-color: #d4d4d8; }
.hb-modal-btn-ok { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.hb-modal-btn-ok:hover { background: #27272a; }
.hb-modal-danger .hb-modal-btn-ok { background: #c0392b; border-color: #c0392b; }
.hb-modal-danger .hb-modal-btn-ok:hover { background: #a93226; }

/* ── Menú de navegación: dropdowns en el preview ── */
#hbPreview .hb-nav-item { position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
#hbPreview .hb-nav-drop { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 190px; box-shadow: 0 10px 28px rgba(0,0,0,.16); border-radius: 8px; padding: 6px; z-index: 30; margin-top: 2px; }
#hbPreview .hb-nav-item:hover .hb-nav-drop { display: block; }
#hbPreview .hb-nav-dropitem { position: relative; padding: 8px 12px; font-size: 13px; color: #3f3f46; border-radius: 6px; white-space: nowrap; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
#hbPreview .hb-nav-dropitem:hover { background: #f4f4f5; }
#hbPreview .hb-nav-subdrop { display: none; position: absolute; top: -6px; left: 100%; background: #fff; min-width: 180px; box-shadow: 0 10px 28px rgba(0,0,0,.16); border-radius: 8px; padding: 6px; }
#hbPreview .hb-nav-dropitem:hover .hb-nav-subdrop { display: block; }
#hbPreview .hb-nav-subitem { padding: 7px 12px; font-size: 12.5px; color: #3f3f46; border-radius: 6px; white-space: nowrap; }
#hbPreview .hb-nav-subitem:hover { background: #f4f4f5; }

/* ── Bloque de marcas: hover ── */
#hbPreview .hb-marca-cell { transition: transform .18s ease, box-shadow .18s ease; }
#hbPreview .hb-marca-cell img { transition: filter .2s ease, opacity .2s ease, transform .25s ease; }
#hbPreview .hb-marca-cell.hv-color:hover img { filter: none !important; opacity: 1 !important; }
#hbPreview .hb-marca-cell.hv-elevar:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,.12) !important; }
#hbPreview .hb-marca-cell.hv-zoom:hover img { transform: scale(1.1); }
/* ── Micro-interacciones premium del preview ── */
#hbPreview .hb-buy-btn { cursor: pointer; transition: filter .15s ease, transform .12s ease; }
#hbPreview .hb-buy-btn:hover { filter: brightness(1.12); }
#hbPreview .hb-buy-btn:active { transform: scale(.98); }
#hbPreview .hb-cat-cell { transition: transform .2s ease, box-shadow .2s ease; cursor: pointer; }
#hbPreview .hb-cat-cell:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.1); }
#hbPreview .hb-cat-cell .hb-cat-img { transition: transform .3s ease; }
#hbPreview .hb-cat-cell:hover .hb-cat-img { transform: scale(1.05); }

/* Flechas de los sliders (estilo catálogo) */
#hbPreview .hb-sl-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid #e4e4e7; box-shadow: 0 2px 10px rgba(0,0,0,.14); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5; font-size: 20px; line-height: 1; color: #3f3f46; user-select: none; transition: transform .12s, box-shadow .12s; }
#hbPreview .hb-sl-arrow:hover { box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#hbPreview .hb-sl-arrow[data-dir="prev"] { left: -4px; }
#hbPreview .hb-sl-arrow[data-dir="next"] { right: -4px; }
#hbPreview .hb-slider { scrollbar-width: thin; }
#hbPreview .hb-slider::-webkit-scrollbar { height: 6px; }
#hbPreview .hb-slider::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }

@keyframes hb-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#hbPreview .hb-marcas-marquee:hover .hb-marcas-track { animation-play-state: paused; }
#hbPreview .hb-marcas-scroll { scrollbar-width: thin; }
#hbPreview .hb-marcas-scroll::-webkit-scrollbar { height: 6px; }
#hbPreview .hb-marcas-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }

/* ── Navegación móvil: drawer en el preview ── */
#hbPreview { position: relative; }
#hbPreview .hb-drawer { position: absolute; inset: 0; z-index: 40; display: none; }
#hbPreview .hb-drawer.open { display: block; }
#hbPreview .hb-drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.42); }
#hbPreview .hb-drawer-panel { position: absolute; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px; background: #fff; overflow-y: auto; box-shadow: 2px 0 24px rgba(0,0,0,.24); }

/* ── Editor de menú (árbol) en el panel de config ── */
.hb-menu-list { display: flex; flex-direction: column; gap: 8px; }
.hb-menu-children { margin: 8px 0 2px 16px; padding-left: 10px; border-left: 2px solid var(--border); }
.hb-menu-item { border: 1px solid var(--border); border-radius: 9px; background: #fff; padding: 8px 9px; }
.hb-menu-item.dragging { opacity: .5; }
.hb-menu-item-head { display: flex; align-items: center; gap: 6px; }
.hb-menu-handle { cursor: grab; color: var(--text-muted); display: flex; flex-shrink: 0; }
.hb-menu-handle svg { width: 15px; height: 15px; }
.hb-menu-label { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-family: inherit; font-size: 12.5px; outline: none; }
.hb-menu-acts { display: flex; gap: 2px; flex-shrink: 0; }
.hb-menu-row { display: flex; gap: 6px; margin-top: 7px; }
.hb-menu-row select, .hb-menu-row input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-family: inherit; font-size: 12px; outline: none; background: #fff; }
.hb-menu-add { width: 100%; padding: 8px; border: 1px dashed var(--border); border-radius: 8px; background: none; color: var(--text-secondary); font-family: inherit; font-size: 12.5px; cursor: pointer; }
.hb-menu-add:hover { border-color: #a1a1aa; color: var(--text-primary); background: var(--bg); }

@media (max-width: 1200px) { .hb-library:not(.collapsed) { width: 200px; } .hb-canvas:not(.collapsed) { width: 260px; } }
@media (max-width: 980px) {
  .hb-main { left: 0; }
  .hb-preview-wrap { display: none; }
}
