/* ==========================================================================
   haBoutique — popup del configurador
   Negro, borde dorado fino, serif editorial. Requiere base.css (tokens).
   ========================================================================== */

html.hbp-open { overflow: hidden; }

.hbp {
	position: fixed; inset: 0; z-index: 99999;
	display: grid; place-items: center;
	padding: 24px;
	background: transparent;
	font-family: var(--serif); color: var(--text);
	opacity: 0; transition: opacity .25s var(--ease);
}
.hbp[hidden] { display: none; }
.hbp.is-open { opacity: 1; }
.hbp__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 5, .55); -webkit-backdrop-filter: blur(10px) saturate(.8); backdrop-filter: blur(10px) saturate(.8); }

.hbp__dialog {
	position: relative;
	display: grid; grid-template-rows: auto 1fr auto;
	width: min(1180px, 100%); height: min(880px, 100%);
	background: #050505;
	border: 1px solid var(--gold); border-radius: 14px;
	box-shadow: 0 40px 120px rgba(0, 0, 0, .7), 0 0 0 1px rgba(201, 164, 92, .15) inset;
	transform: translateY(14px) scale(.985); transition: transform .35s var(--ease);
	overflow: hidden;
}
.hbp.is-open .hbp__dialog { transform: none; }

/* ---------- Cabecera y progreso ---------- */
.hbp__head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 26px 32px 6px; gap: 20px; }
.hbp__brand { font-size: 32px; line-height: 1; padding-top: 6px; }
.hb .hbp__close { justify-self: end; width: 40px; height: 40px; display: grid; place-items: center; color: var(--text); border-radius: 50%; transition: background-color .3s; }
.hbp__close:hover { background: rgba(255, 255, 255, .06); }
.hbp__close svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.hb .hbp__progress { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.hbp__dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 132px; cursor: default; }
.hbp__dot + .hbp__dot::before {
	content: ""; position: absolute; top: 19px; right: calc(50% + 24px); width: calc(100% - 48px); height: 1px; background: rgba(243, 238, 229, .45);
}
.hbp__dot.is-done + .hbp__dot::before, .hbp__dot.is-done + .hbp__dot.is-done::before { background: var(--gold); }
.hbp__dot-num {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
	border: 1px solid rgba(243, 238, 229, .7); font-size: 19px; line-height: 1;
	transition: background-color .3s, border-color .3s, color .3s;
}
.hbp__dot-num svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.hbp__dot-label { font-size: 16px; white-space: nowrap; }
.hbp__dot.is-current .hbp__dot-num, .hbp__dot.is-done .hbp__dot-num { background: var(--gold); border-color: var(--gold); color: #050505; }
.hbp__dot.is-current .hbp__dot-label { color: var(--gold-2); }
.hbp__dot.is-done { cursor: pointer; }
.hbp__dialog.is-done .hbp__progress { visibility: hidden; }

/* ---------- Cuerpo ---------- */
.hbp__body { overflow-y: auto; overscroll-behavior: contain; padding: 10px 56px 24px; outline: none; scrollbar-color: rgba(201, 164, 92, .4) transparent; }
.hbp__screen { animation: hbp-in .45s var(--ease); }
@keyframes hbp-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hbp__title { text-align: center; margin: 0 0 18px; }
.hb .hbp__title h2 { font-size: clamp(34px, 4vw, 54px); line-height: 1.05; font-weight: 500; }
.hb .hbp__title p { margin-top: 6px; font-size: 21px; }
.hb .hbp__eyebrow { text-align: center; color: var(--gold-2); font-size: 20px; margin-bottom: 4px; }
.hb .hbp__h3 { font-size: 26px; margin: 22px 0 8px; font-weight: 500; }
.hbp__h3--big { font-size: 30px !important; }
.hbp__muted, .hb .hbp__note { color: var(--muted); font-size: 15px; }
.hbp__note { display: block; margin-top: 6px; }
.hbp__info { color: var(--gold-2); font-style: italic; margin: 6px 0 4px; }

.hbp__field { display: block; margin-top: 16px; }
.hbp__label { display: block; margin-bottom: 8px; font-size: 18px; }
.hbp__label--big { font-size: 26px; text-align: left; }
.hb .hbp__input {
	width: 100%; padding: 13px 16px;
	background: #0b0b0b; color: var(--text);
	border: 1px solid rgba(243, 238, 229, .45); border-radius: 4px;
	font: inherit; font-size: 18px; line-height: 1.3;
	transition: border-color .25s, background-color .25s;
}
.hb .hbp__input:focus { outline: none; border-color: var(--gold-2); background: #101010; }
.hb .hbp__input::placeholder { color: rgba(185, 177, 164, .6); }
.hb select.hbp__input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.hb select.hbp__input option { background: #111; }
.hb input[type="date"].hbp__input { color-scheme: dark; }
.hb textarea.hbp__input { resize: vertical; }
.hbp__qty { max-width: 220px; }
.hbp__sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
.hbp__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.hbp__radio { flex: none; position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(243, 238, 229, .75); transition: border-color .25s; }
.hbp__radio.is-on { border-color: var(--gold); }
.hbp__radio.is-on::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--gold); }
.hbp__check { position: absolute; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #050505; }
.hbp__check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.hbp__caption { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); font-style: italic; }
.hbp__illus { display: block; max-width: 100%; height: auto; }

.hbp__check-line { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; font-size: 18px; cursor: pointer; }
.hbp__check-line input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--gold); flex: none; }
.hb .hbp__link { color: var(--gold-2); border-bottom: 1px solid currentColor; font-size: 16px; }

/* ---------- 1. Libro ---------- */
.hbp__s1-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.hbp__hero { display: flex; flex-direction: column; align-items: center; text-align: center; position: sticky; top: 0; }
.hbp__hero-img { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: min(40vh, 360px); }
.hb .hbp__hero-img img, .hb .hbp__hero-img canvas { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .6)); }
.hbp__hero-img .hbp__check { top: 6%; right: 8%; }
.hb .hbp__hero-name { margin-top: 14px; font-size: 40px; }
.hbp__hero-empty { display: flex; align-items: center; justify-content: center; height: min(40vh, 360px); opacity: .55; }
.hb .hbp__hero-empty canvas { max-height: 100%; width: auto; height: auto; }
.hbp__hero-other { display: grid; place-items: center; width: 180px; height: 180px; margin: 80px 0 0; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-2); }
.hbp__hero-other svg { width: 60px; height: 60px; fill: none; stroke: currentColor; stroke-width: 1.2; }

.hbp__books { display: grid; }
.hb .hbp__book {
	display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 20px;
	padding: 6px 6px; text-align: left; border-bottom: 1px solid transparent;
	transition: background-color .25s;
}
.hb .hbp__book:hover { background: rgba(255, 255, 255, .03); }
.hbp__book-img { display: flex; align-items: center; justify-content: center; height: 64px; }
.hb .hbp__book-img img, .hb .hbp__book-img canvas { max-height: 64px; max-width: 76px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.hbp__book-name { font-size: 23px; }
.hb .hbp__book--other { border-top: 1px solid rgba(243, 238, 229, .25); margin-top: 6px; padding-top: 16px; }
.hbp__plus { justify-self: center; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-2); }
.hbp__plus svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hbp__opts { margin-top: 6px; }

/* ---------- 2. Tapa y tamaño ---------- */
.hbp__covers { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.hb .hbp__cover { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; transition: background-color .25s; }
.hb .hbp__cover:hover { background: rgba(255, 255, 255, .025); }
.hbp__cover-img { display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(180px, 28vh, 270px); overflow: hidden; }
.hb .hbp__cover-img img, .hb .hbp__cover-img canvas { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .6)); }
.hbp__illus-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.hb .hbp__illus-wrap canvas { max-height: calc(100% - 28px); width: auto; height: auto; }
.hbp__cover-label { display: flex; align-items: center; gap: 14px; }
.hbp__cover-name { font-size: 30px; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.hbp__cover.is-on .hbp__cover-name { border-bottom-color: var(--gold); }
.hbp__cover-desc { color: var(--muted); font-size: 18px; }
.hbp__empty { text-align: center; color: var(--muted); max-width: 46ch; margin: 40px auto; font-size: 19px; }

.hbp__sizes { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(243, 238, 229, .2); text-align: center; }
.hb .hbp__sizes h3 { font-size: 32px; font-weight: 500; }
.hbp__size-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 34px; margin-top: 18px; }
.hb .hbp__size { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 150px; padding: 10px; border-radius: 8px; transition: background-color .25s; }
.hb .hbp__size:hover { background: rgba(255, 255, 255, .03); }
.hbp__size-img { display: grid; place-items: end center; height: 130px; }
.hb .hbp__size-img img { max-height: 130px; max-width: 170px; object-fit: contain; }
.hbp__outline { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 130px; }
.hbp__outline > span:first-child { display: block; border: 1px solid rgba(243, 238, 229, .6); border-radius: 2px; }
.hbp__size.is-on .hbp__outline > span:first-child { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.hbp__size-label { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.hbp__size-dims { color: var(--muted); font-size: 14px; }
.hbp__gallery { display: grid; justify-items: center; gap: 10px; margin-top: 20px; }
.hb .hbp__gallery-main { max-height: 300px; max-width: 100%; object-fit: contain; border-radius: 6px; }
.hbp__thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hb .hbp__thumb { width: 64px; height: 64px; border: 1px solid rgba(243, 238, 229, .25); border-radius: 4px; overflow: hidden; }
.hb .hbp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.hbp__thumb.is-on { border-color: var(--gold); }

/* ---------- 3. Color ---------- */
.hbp__colour-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; direction: ltr; }
.hbp__colour-controls, .hbp__colour-preview { min-width: 0; direction: initial; }
.hbp__colour-preview { text-align: center; }
.hbp__colour-canvas { display: block; width: 100%; height: auto; border-radius: 8px; background: #eee9e0; }
.hbp__colour-preview[aria-busy="true"] .hbp__colour-canvas { opacity: .7; }
.hbp__colour-controls .hbp__slider { grid-template-columns: 28px minmax(0, 1fr) 28px; gap: 4px; }
.hbp__colour-controls .hbp__swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
@media (max-width: 700px) {
	.hbp__colour-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.hbp__colour-controls .hbp__slider { grid-template-columns: minmax(0, 1fr); }
	.hbp__colour-controls .hbp__swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 6px; }
	.hbp__colour-preview { width: min(100%, 420px); justify-self: center; }
}
.hbp__slider { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; }
.hb .hbp__pager { display: grid; place-items: center; height: 80px; color: var(--text); transition: color .25s, opacity .25s; }
.hbp__pager svg { width: 26px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.hbp__pager:hover { color: var(--gold-2); }
.hbp__pager:disabled { opacity: .2; cursor: default; }
.hbp__swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 22px; }
.hb .hbp__swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.hbp__swatch-chip {
	position: relative; width: min(100px, 100%); aspect-ratio: 1; border-radius: 50%;
	background-size: cover; background-position: center; background-blend-mode: normal;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset -12px -14px 26px rgba(0, 0, 0, .28), inset 10px 10px 22px rgba(255, 255, 255, .06), 0 10px 20px rgba(0, 0, 0, .55);
	transition: transform .35s var(--ease), box-shadow .35s;
}
.hbp__swatch-chip.has-grain { background-size: 140px; background-blend-mode: overlay; }
.hb .hbp__swatch:hover .hbp__swatch-chip { transform: translateY(-3px); }
.hbp__swatch.is-on .hbp__swatch-chip { box-shadow: 0 0 0 3px #050505, 0 0 0 6px var(--gold), 0 10px 20px rgba(0, 0, 0, .55); }
.hbp__swatch .hbp__check { top: -4px; right: 4%; width: 32px; height: 32px; }
.hbp__swatch-num { margin-top: 4px; font-size: 17px; line-height: 1; }
.hbp__swatch-name { font-size: 17px; line-height: 1.15; }
.hbp__dots { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.hb .hbp__dotnav { width: 12px; height: 12px; border-radius: 50%; background: rgba(243, 238, 229, .35); transition: background-color .25s; }
.hbp__dotnav.is-on { background: var(--gold); }
.hb .hbp__swatch-info { display: flex; flex-direction: column; align-items: center; margin-top: 10px; font-size: 18px; }

/* ---------- 4. Personalización ---------- */
.hbp__finishes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hb .hbp__finish { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hbp__finish-img { position: relative; display: block; width: 100%; border: 1px solid rgba(243, 238, 229, .4); border-radius: 6px; overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.hbp__finish-img .hbp__radio { position: absolute; top: 12px; left: 12px; background: rgba(5, 5, 5, .4); }
.hb .hbp__finish-sample { display: block; width: 100%; height: auto; }
.hbp__finish.is-on .hbp__finish-img { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.hbp__finish-name { font-size: 21px; }
.hbp__s4-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(24px, 3.5vw, 48px); align-items: start; margin-top: 8px; }
.hb .hbp__text { min-height: 150px; font-size: 19px; }
.hbp__seg { display: inline-flex; flex-wrap: wrap; border: 1px solid rgba(243, 238, 229, .45); border-radius: 4px; overflow: hidden; }
.hb .hbp__seg-opt { padding: 10px 16px; font-size: 16px; color: var(--muted); transition: background-color .25s, color .25s; }
.hb .hbp__seg-opt + .hbp__seg-opt { border-left: 1px solid rgba(243, 238, 229, .25); }
.hb .hbp__seg-opt:hover { color: var(--text); }
.hb .hbp__seg-opt[aria-checked="true"] { background: var(--gold); color: #050505; }
.hbp__fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hb .hbp__font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; text-align: left; border: 1px solid rgba(243, 238, 229, .22); border-radius: 4px; transition: border-color .25s, background-color .25s; }
.hb .hbp__font:hover { border-color: rgba(201, 164, 92, .6); }
.hb .hbp__font[aria-checked="true"] { border-color: var(--gold); background: rgba(201, 164, 92, .08); }
.hbp__font-sample { font-size: 21px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hbp__font-name { font-family: var(--sans); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.hb .hbp__drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; cursor: pointer; border: 1px dashed rgba(243, 238, 229, .5); border-radius: 4px; font-size: 19px; transition: border-color .25s, background-color .25s; }
.hb .hbp__drop:hover, .hbp__drop.is-over { border-color: var(--gold-2); background: rgba(201, 164, 92, .05); }
.hbp__drop:focus-within { outline: 1px solid var(--gold-2); outline-offset: 3px; }
.hbp__drop-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.hbp__logo-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid rgba(243, 238, 229, .3); border-radius: 4px; }
.hbp__logo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbp__back-toggle { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(243, 238, 229, .18); }
.hbp__date { margin-top: 20px; border: 1px solid rgba(243, 238, 229, .22); border-radius: 4px; }
.hbp__date summary { padding: 12px 14px; cursor: pointer; font-size: 17px; color: var(--gold-2); list-style: none; }
.hbp__date summary::-webkit-details-marker { display: none; }
.hbp__date summary::after { content: "+"; float: right; }
.hbp__date[open] summary::after { content: "−"; }
.hbp__date-body { display: grid; gap: 10px; padding: 0 14px 14px; justify-items: start; }
.hbp__date-out { min-height: 1.3em; font-family: var(--hebrew), var(--serif); font-size: 22px; color: var(--gold-2); }
.hb .hbp__btn-small { padding: 9px 14px; border: 1px solid var(--gold); color: var(--gold-2); border-radius: 4px; font-size: 15px; }
.hb .hbp__btn-small:disabled { opacity: .4; }

.hbp__preview { position: sticky; top: 0; }
.hbp__preview-stage {
	position: relative; height: min(52vh, 480px); border-radius: 12px; perspective: 1400px;
	background: radial-gradient(60% 55% at 50% 42%, rgba(227, 194, 124, .10), rgba(5, 5, 5, 0) 70%), radial-gradient(120% 100% at 50% 100%, #15120e 0%, #050505 70%);
	box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .2);
}
.hbp__preview-book { position: absolute; inset: 3% 6%; display: flex; align-items: center; justify-content: center; }
.hbp__preview-book.is-flipping { animation: hbp-flip .4s var(--ease); }
@keyframes hbp-flip { 50% { transform: rotateY(90deg); } }
.hb .hbp__preview-canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; touch-action: none; }
.hbp__preview-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.hbp__preview-bar .hbp__label { margin: 0; }
.hb .hbp__flip { color: var(--gold-2); font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid currentColor; }
.hb .hbp__warn { margin-top: 6px; font-size: 15px; color: #e7a08f; min-height: 1px; }
.hb .hbp__send-note { text-align: center; margin-top: 22px; font-size: 19px; }

/* ---------- Contacto ---------- */
.hbp__contact .hbp__title { margin-bottom: 8px; }
.hbp__form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.hbp__date-input { position: relative; display: block; }
.hbp__date-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.hbp__date-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.hb .hbp__date-input input::-webkit-calendar-picker-indicator { opacity: 0; width: 28px; height: 28px; cursor: pointer; }
.hbp__methods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.hb .hbp__method {
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px;
	padding: 18px 26px; border: 1px solid rgba(243, 238, 229, .45); border-radius: 6px; font-size: 28px; text-align: left;
	transition: border-color .25s, background-color .25s;
}
.hb .hbp__method:hover { border-color: rgba(201, 164, 92, .7); }
.hb .hbp__method.is-on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.hbp__method-icon svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.hbp__method.is-on .hbp__method-icon { color: var(--gold-2); }
.hbp__method .hbp__radio { width: 26px; height: 26px; }
.hb .hbp__method-small { display: inline-flex; align-items: center; gap: 12px; padding: 4px 10px; font-size: 19px; justify-self: start; border-radius: 4px; border: 1px solid transparent; }
.hbp__method-small .hbp__method-icon svg { width: 28px; height: 28px; }
.hb .hbp__method-small.is-on { border-color: var(--gold); color: var(--gold-2); }
.hbp__also { margin-top: 10px; }

/* ---------- Pie del popup ---------- */
.hbp__foot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 16px 40px 22px; border-top: 1px solid rgba(243, 238, 229, .08); }
.hb .hbp__prev { min-width: 200px; padding: 13px 20px; background: #1b1b1b; border: 1px solid rgba(243, 238, 229, .4); border-radius: 4px; font-size: 21px; color: var(--text); transition: border-color .25s; }
.hb .hbp__prev:hover { border-color: var(--text); }
.hb .hbp__prev:disabled { opacity: .45; cursor: default; }
.hbp__mid { text-align: center; }
.hb .hbp__stepinfo { font-size: 18px; }
.hb .hbp__error { color: #eaa48f; font-size: 16px; min-height: 1px; margin-bottom: 4px; }
.hbp__nextwrap { display: flex; flex-direction: column; align-items: flex-end; }
.hb .hbp__next {
	display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-width: 210px;
	padding: 12px 22px; border: 1px solid var(--gold); border-radius: 4px; color: var(--gold-2); font-size: 23px;
	transition: background-color .25s, color .25s;
}
.hbp__next svg { width: 20px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hb .hbp__next:hover { background: var(--gold); color: #050505; }
.hb .hbp__next:disabled { opacity: .6; cursor: wait; }
.hb .hbp__footnote { font-size: 15px; color: var(--muted); margin-top: 6px; min-height: 1px; }
.hbp__dialog.is-done .hbp__foot { display: none; }

/* ---------- Mazal tov ---------- */
.hbp__done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 10px 0 30px; outline: none; }
.hbp__done-check { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold-2); }
.hbp__done-check svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hb .hbp__mazal { font-size: clamp(64px, 9vw, 110px); line-height: 1; font-weight: 500; letter-spacing: -.02em; background: linear-gradient(180deg, #f6d9a4, #c9a45c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hb .hbp__done .hbp__done-lead { font-size: clamp(24px, 2.8vw, 36px); line-height: 1.25; max-width: 30ch; }
.hb .hbp__done p { font-size: 20px; }
.hbp__rule { display: block; width: 80px; height: 1px; background: var(--gold); margin: 14px 0; }
.hb .hbp__wishes small { font-size: 17px; }
.hb .hbp__back { margin-top: 14px; padding: 13px 64px; border: 1px solid var(--gold); border-radius: 6px; color: var(--gold-2); font-size: 22px; transition: background-color .25s, color .25s; }
.hb .hbp__back:hover { background: var(--gold); color: #050505; }

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
	.hbp__body { padding: 10px 32px 24px; }
	.hbp__foot { padding: 14px 24px 18px; }
	.hbp__dot { width: 108px; }
	.hbp__brand { font-size: 26px; }
	.hb .hbp__method { font-size: 22px; padding: 16px 18px; gap: 14px; }
}

/* ---------- Móvil: pantalla completa ---------- */
@media (max-width: 760px) {
	.hbp { padding: 0; }
	.hbp__dialog { width: 100%; height: 100%; border-radius: 0; border-width: 0; }
	.hbp__head { grid-template-columns: 1fr auto; padding: 14px 16px 4px; }
	.hbp__brand { font-size: 22px; }
	.hb .hbp__progress { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
	.hbp__dot { width: 76px; }
	.hbp__dot-num { width: 30px; height: 30px; font-size: 15px; }
	.hbp__dot + .hbp__dot::before { top: 15px; right: calc(50% + 19px); width: calc(100% - 38px); }
	.hbp__dot-label { font-size: 12px; }
	.hbp__body { padding: 6px 18px 20px; }
	.hb .hbp__title h2 { font-size: 32px; }
	.hb .hbp__title p { font-size: 17px; }
	.hbp__s1-grid, .hbp__covers, .hbp__s4-grid, .hbp__form-grid, .hbp__methods { grid-template-columns: 1fr; }
	.hbp__hero { position: static; }
	.hbp__hero-img { height: 34vh; }
	.hb .hbp__hero-name { font-size: 30px; }
	.hb .hbp__book { grid-template-columns: 70px 1fr auto; gap: 14px; }
	.hbp__book-img { height: 66px; }
	.hb .hbp__book-img img, .hbp__book-img canvas { max-height: 66px; max-width: 70px; }
	.hbp__book-name { font-size: 20px; }
	.hbp__covers { grid-template-columns: 1fr 1fr; gap: 10px; }
	.hbp__cover-img { height: 150px; }
	.hbp__cover-name { font-size: 21px; }
	.hbp__cover-desc { font-size: 14px; }
	.hb .hbp__size { min-width: 0; }
	.hbp__slider { grid-template-columns: 1fr; }
	.hbp__pager { display: none !important; }
	.hbp__swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 6px; }
	.hbp__swatch .hbp__check { width: 22px; height: 22px; top: -4px; right: 0; }
	.hbp__swatch .hbp__check svg { width: 14px; height: 14px; }
	.hbp__swatch-num { font-size: 13px; }
	.hbp__swatch-name { font-size: 12px; }
	.hbp__finishes { gap: 8px; }
	.hbp__finish-name { font-size: 16px; }
	.hbp__preview { position: relative; order: -1; }
	.hbp__preview-stage { height: 38vh; }
	.hb .hbp__method { font-size: 20px; }
	.hbp__foot { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px 14px; }
	.hb .hbp__prev { min-width: 0; font-size: 17px; padding: 11px 14px; }
	.hb .hbp__next { min-width: 0; font-size: 18px; padding: 11px 14px; }
	.hb .hbp__stepinfo { font-size: 14px; }
	.hb .hbp__footnote { display: none; }
	.hb .hbp__mazal { font-size: 64px; }
}

