/* ========================================================================
 * FILE: hm-wizard.css
 * REEMPLAZAR COMPLETO
 * Objetivo:
 *  - Control +/- sin input visible (span)
 *  - Número SIEMPRE visible, base 0
 *  - Overrides ultra específicos para evitar estilos agresivos del theme
 *  - Botones finales:
 *      - "Nuevo presupuesto": texto rojo subrayado + formato botón
 *      - "Elegir otro producto": texto negro sin subrayado + formato botón
 * ====================================================================== */

.hm-wizard { width: 100%; }
.hm-wizard__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) {
  .hm-wizard__grid { grid-template-columns: 1fr; }
}

.hm-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  padding: 14px;
}

.hm-card--flat { padding: 12px; }

.hm-card__title { font-weight: 900; font-size: 16px; margin-bottom: 10px; }
.hm-muted { color: #666; white-space: pre-line; }

.hm-step__title { font-weight: 900; font-size: 20px; }
.hm-step__sub { color: #666; margin-top: 6px; font-weight: 700; font-size: 14px; }
.hm-step__body { margin-top: 12px; }
.hm-step__nav { margin-top: 14px; display: flex; gap: 10px; justify-content: space-between; }

.hm-btn {
  border-radius: 10px;
  border: 1px solid #d8d8d8;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.hm-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.hm-btn--primary {
  border-color: #6d0e17;
  background: #6d0e17;
  color: #fff;
}

.hm-btn--ghost { background: #fafafa; }
.hm-btn-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ===== NUEVOS: Botones finales con formato botón ===== */
.hm-btn--redlink-btn{
  border: 1px solid #d8d8d8;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  color: #b40000;
  text-decoration: underline;
  font-weight: 800;
}
.hm-btn--black-btn{
  border: 1px solid #d8d8d8;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  color: #111;
  text-decoration: none;
  font-weight: 800;
}

/* Legacy (por si quedó en algún lado) */
.hm-btn--underline-red { background: transparent; border: none; padding: 0; color: #b40000; text-decoration: underline; }

.hm-grid-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  .hm-grid-opts { grid-template-columns: 1fr; }
}

.hm-opt {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 2px solid #eaeaea;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}

.hm-opt.is-selected { border-color: #6d0e17; box-shadow: 0 0 0 2px rgba(109,14,23,0.12); }

.hm-opt__img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid #eee; }
.hm-opt__title { font-weight: 900; }
.hm-opt__sub { margin-top: 4px; color: #666; white-space: pre-line; }

/* Quote panel */
.hm-quote__panel { font-size: 14px; }

.hm-quote__row {
  display: grid;
  grid-template-columns: 34px 46px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.hm-quote__qty {
  font-weight: 900;
  font-size: 14px;
  color: #444;
  text-align: right;
}

.hm-quote__thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; border: 1px solid #eee; }
.hm-quote__name { font-weight: 900; }
.hm-quote__sub { color: #666; font-size: 12px; margin-top: 4px; line-height: 1.3; display: grid; gap: 2px; }
.hm-quote__mini { color: #777; font-size: 11px; line-height: 1.25; }

.hm-quote__price { text-align: right; font-weight: 900; display: grid; gap: 2px; }
.hm-link { background: transparent; border: none; color: #b40000; cursor: pointer; text-decoration: underline; font-weight: 800; }

.hm-quote__totals { margin-top: 12px; border-top: 1px solid #eee; padding-top: 10px; display: grid; gap: 8px; }
.hm-quote__tot { display: flex; justify-content: space-between; gap: 10px; }

.hm-quote__actions { margin-top: 12px; display: grid; gap: 8px; }

.hm-pill {
  display: inline-block;
  font-weight: 900;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2b9bd;
  color: #6d0e17;
  background: rgba(109,14,23,0.06);
}

/* Modal */
.hm-modal { position: fixed; inset: 0; display: none; z-index: 9999; }
.hm-modal.is-open { display: block; }
.hm-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.hm-modal__dialog {
  position: relative;
  max-width: 860px;
  margin: 5vh auto;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eee;
}
.hm-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #eee; }
.hm-modal__title { font-weight: 900; font-size: 16px; }
.hm-modal__close { border: none; background: transparent; font-size: 20px; cursor: pointer; padding: 4px 10px; }
.hm-modal__body { padding: 14px; max-height: 75vh; overflow: auto; }

.hm-fin__block { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
.hm-fin__title { font-weight: 900; margin-bottom: 10px; }
.hm-fin__list { display: grid; gap: 10px; }
.hm-fin__row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid #eee; border-radius: 12px; }
.hm-fin__name { font-weight: 900; }
.hm-fin__desc { color: #666; font-size: 12px; margin-top: 4px; }
.hm-fin__right { text-align: right; display: grid; gap: 4px; justify-items: end; }

.hm-share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 540px) { .hm-share-grid { grid-template-columns: 1fr; } }

.hm-check { display: flex; align-items: flex-start; gap: 10px; width: 100%; margin: 10px 0; }
.hm-check input[type="checkbox"] { margin-top: 2px; }
.hm-check span { display: block; width: 100%; }
.hm-check__sub { display: block; font-size: 12px; color: #666; margin-top: 4px; }

/* Extras layout */
.hm-extras { display: grid; gap: 12px; }

.hm-extra__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
}
.hm-extra__row:first-child { border-top: none; padding-top: 0; }
.hm-extra__labelTitle { font-weight: 900; }
.hm-extra__labelSub { color: #666; font-size: 12px; margin-top: 4px; }

/* ===== CONTROL +/- (SPAN) ===== */
.hm-qty {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  max-width: 92px;
}

.hm-qty__btn {
  width: 22px;
  height: 24px;
  border: none;
  background: #fafafa;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  color: #111;
  line-height: 1;
}
.hm-qty__btn:active { transform: scale(0.98); }

.hm-qty__val {
  width: 34px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  line-height: 24px;
  background: #fff !important;
  user-select: none;
}

/* ===== OBJETIVO 2: Overrides ultra específicos (theme proof) ===== */
#hm-wizard-root .hm-qty .hm-qty__val,
#hm-wizard-root .hm-qty .hm-qty__val:focus,
#hm-wizard-root .hm-qty .hm-qty__val:active,
#hm-wizard-wrap #hm-wizard-root .hm-qty__val {
  color: #111 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #fff !important;
  background-color: #fff !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Email apps grid (ya usado por modal email) */
.hm-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 540px) { .hm-app-grid { grid-template-columns: 1fr; } }

.hm-app-btn {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  font-weight: 800;
}
.hm-app-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #eee;
}
.hm-app-ico svg { width: 22px; height: 22px; fill: currentColor; opacity: 0.9; }
.hm-app-name { font-size: 14px; }

.hm-modal-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ===== LAYOUT 0 (INICIO) ===== */
.hm-layout0__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
@media (max-width:640px){
  .hm-layout0__grid{grid-template-columns:1fr}
}
.hm-layout0__card{
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  padding:0;
  text-align:left;
  min-height:220px;
}
.hm-layout0__img{
  width:100%;
  height:190px;
  display:block;
  object-fit:cover;
}
.hm-layout0__label{
  padding:14px 14px 18px;
  font-weight:900;
  font-size:24px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.hm-layout0__card.is-disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* ===== Mejoras Layout 0 (hover + seleccionado) ===== */
.hm-layout0__img{
  transition: transform .22s ease;
}
.hm-layout0__card:hover .hm-layout0__img{
  transform: scale(1.05);
}
.hm-layout0__card.is-selected{
  border: 2px solid #6d0e17;
}
