/* ======================================================
   METAHOGAR · FORMULARIO WIZARD (Versión hero landing + formulario centrado)
   ====================================================== */

/* ==== Reset del contenedor WordPress ==== */
body.page-id-1002 .wp-block-post-content.is-layout-constrained {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #fafafa;
}

/* ======================================================
   HERO (texto + formulario)
   ====================================================== */

.mh-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e9ecf2 0%, #f5f6fa 100%);
  color: #111827;
  overflow: hidden;
}

.mh-hero-bg {
  position: absolute;
  inset: 0;
  /*background: url('/wp-content/uploads/2025/bg-hero-metahogar.webp') center/cover no-repeat;*/
  opacity: 0.25;
}

.mh-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 80px;
  align-items: center;
  padding: 80px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Columna izquierda: texto */
.mh-hero-text h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  color: #111827;
}

.mh-hero-text h1 span {
  color: #b61c1c;
}

.mh-hero-text p {
  font-size: 18px;
  line-height: 1.6;
  color: #4b5563;
  max-width: 500px;
}

/* Columna derecha: formulario */
.mh-hero-form {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  color: #111;
}

/* Versión móvil */
@media (max-width: 900px) {
  .mh-hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 24px;
    gap: 40px;
  }

  .mh-hero-text h1 {
    font-size: 36px;
  }

  .mh-hero-text p {
    font-size: 16px;
    margin: 0 auto;
  }

  .mh-hero-form {
    max-width: 500px;
    margin: 0 auto;
  }
}

/* ======================================================
   WIZARD ESTILIZADO
   ====================================================== */

   #metahogar-wizard-root {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }

#metahogar-wizard {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  animation: fadeIn 0.4s ease both;
}

/* Animación simple */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== CABECERA ===== */
.mh-wizard-header {
  background: #b61c1c;
  color: #fff;
  text-align: center;
  padding: 22px 18px 18px;
}

.mh-wizard-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.mh-wizard-header p {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

/* ===== PROGRESO ===== */
.mh-progress-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 20px;
}

.mh-progress-bar {
  height: 100%;
  background: #b61c1c;
  transition: width 0.3s ease;
}

/* ===== PANEL DE PASO ===== */
.mh-wizard-body {
  background: #f9fafb;
  color: #2d3748;
  padding: 22px;
  box-sizing: border-box;
  overflow: visible;
}

.mh-step-panel {
  display: none;
}

.mh-step-panel.is-active {
  display: block;
}

.mh-step-panel h3 {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
  text-align: center;
}

.mh-step-panel p {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  margin-bottom: 18px;
}

/* Target exacto para los textos dentro del paso 1 */
.mh-step-panel[data-step="1"] > div > div * {
  text-align: left !important;
}


/* ===== CAMPOS ===== */
.mh-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.mh-field label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #111827;
}

.mh-field input,
.mh-field textarea,
.mh-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mh-field input:focus,
.mh-field textarea:focus,
.mh-field select:focus {
  border-color: #b61c1c;
  box-shadow: 0 0 0 2px rgba(182, 28, 28, 0.15);
  outline: none;
}

/* ===== NAVEGACIÓN Y BOTONES ===== */
.mh-nav {
  background: #fff;
  border-top: 1px solid #f3f4f6;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mh-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mh-buttons button {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.mh-buttons .prev {
  background: #fff;
  color: #b61c1c;
  border: 1.5px solid #b61c1c;
}

.mh-buttons .next {
  background: #b61c1c;
  color: #fff;
  border: none;
}

.mh-buttons .next:hover:not(:disabled) {
  background: #a21616;
}

.mh-buttons button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== PRIVACIDAD ===== */
.mh-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #4b5563;
  text-align: center;
}

.mh-privacy-note strong {
  color: #111827;
}

.mh-privacy-icon {
  font-size: 14px;
  margin-right: 6px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 480px) {
  #metahogar-wizard {
    border-radius: 12px;
  }

  .mh-buttons button {
    font-size: 14px;
  }
}

/* === CORRECCIÓN FINAL: el hero ocupa todo el ancho real === */
body.page-id-1002 {
  margin: 0;
  padding: 0;
  background: #f8f9fb;
}

/* Rompe totalmente el contenedor del bloque de WordPress */
body.page-id-1002 .entry-content.wp-block-post-content {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Hero full width, no centrado por Gutenberg */
body.page-id-1002 .mh-hero {
  width: 100vw;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px 0;
  background: linear-gradient(135deg, #e9ecf2 0%, #f5f6fa 100%);
}

body.page-id-1002 .mh-hero-content {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: 1fr 480px;
  align-items: center;
  gap: 80px;
  padding: 0 60px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  body.page-id-1002 .mh-hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 20px;
    gap: 40px;
  }
}


@media (max-width: 768px) {
  /* Solo el formulario visible */
  /* Fuerza el desplazamiento del wizard completo bajo el header fijo */
  body.page-id-1002 .mh-hero {
    margin-top: 30px !important; /* empuja todo el bloque, no solo padding */
    padding-top: 0 !important;
  }

  /* Ajuste por si el wizard queda separado de más */
  #metahogar-wizard {
    margin-top: 0 !important;
  }
  .mh-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: calc(100vh - var(--mh-header-height));
    padding-top: calc(var(--mh-header-height)) !important;
    background: #fff;
  }

  .mh-hero-text {
    display: none;
  }

  .mh-hero-content {
    display: block;
    width: 100%;
    padding: 0;
  }

  .mh-hero-form {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
  }

  #metahogar-wizard {
    max-width: 100% !important;
    border-radius: 0;
    min-height: calc(100vh - var(--mh-header-height));
    margin-bottom: 0;
    margin-top: 0 !important;
  }

  body {
    overflow-x: hidden;
    padding-top: 0 !important;
  }
}

@media (max-width: 768px) {
  /* Oculta el texto y deja solo el formulario */
  .mh-hero-text {
    display: none !important;
  }

  /* El hero ocupa toda la pantalla, sin huecos ni cortes */
  .mh-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh !important;
  }

  /* Asegura que el contenedor interno no añade margen */
  .mh-hero-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* El recuadro del wizard ocupa todo el ancho */
  .mh-hero-form,
  #metahogar-wizard {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Quita relleno superior del body para que no empuje el wizard hacia abajo */
  body {
    padding-top: 0 !important;
  }
}

/* ===== SELECT MÚLTIPLE ===== */
.mh-field select[multiple],
.mh-field select[multiple].mh-zone-select {
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  font-size: 15px;
  background: #fff;
  color: #0b1b4f;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mh-field select[multiple] option {
  padding: 6px;
  border-radius: 4px;
}

.mh-field select[multiple] option:checked {
  background-color: #b61c1c;
  color: #fff;
}

/* Scrollbar */
.mh-field select[multiple]::-webkit-scrollbar {
  width: 8px;
}
.mh-field select[multiple]::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* ===== TAGS ===== */
.mh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mh-tag {
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 22px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #0b1b4f;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mh-tag:hover {
  border-color: #0b1b4f;
  background: #eef2ff;
}

.mh-tag.is-active {
  background: #0b1b4f;
  color: #fff;
  border-color: #0b1b4f;
  box-shadow: 0 2px 6px rgba(11, 27, 79, 0.25);
}

/* ===== CAMPOS DE ZONAS (tags dinámicos) ===== */
.mh-zone-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  min-height: 46px;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.mh-zone-input:focus-within {
  border-color: #b61c1c;
  box-shadow: 0 0 0 3px rgba(182, 28, 28, 0.12);
}

.mh-zone-input input {
  border: none;
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  padding: 6px;
  outline: none;
  background: transparent;
  color: #111827;
}

.mh-zone-tag {
  background: #f3f4f6;
  color: #111827;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mh-zone-tag button {
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 15px;
}

.mh-zone-tag button:hover {
  color: #b61c1c;
}

/* Dropdown sugerencias */
.mh-zone-suggestions {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.mh-zone-suggestions li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s ease;
}

.mh-zone-suggestions li:hover {
  background: #f9fafb;
}

/* ===== INPUTS NUMÉRICOS ===== */
.mh-field input[type="number"] {
  text-align: center;
  appearance: textfield;
}

.mh-field input[type="number"]::-webkit-inner-spin-button,
.mh-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ===== ZONAS STEP 2: TAGS SELECCIONADOS Y LÍMITE ===== */

.mh-zone-group {
  margin-bottom: 22px;
}

.mh-zone-group h4 {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #0b1b4f;
}

/* Contenedor del campo con tags dinámicos */
.mh-zone-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  min-height: 46px;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.mh-zone-input:focus-within {
  border-color: #b61c1c;
  box-shadow: 0 0 0 3px rgba(182, 28, 28, 0.12);
}

/* Chips visuales (zonas seleccionadas) */
.mh-zone-tag {
  background: #f3f4f6;
  color: #111827;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mh-zone-tag button {
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 15px;
}

.mh-zone-tag button:hover {
  color: #b61c1c;
}

/* Input interno para búsqueda */
.mh-zone-input input {
  border: none;
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  padding: 6px;
  outline: none;
  background: transparent;
  color: #111827;
}

input,
select,
textarea {
  font-size: 16px !important;
}



/* Sugerencias desplegables */
.mh-zone-suggestions {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.mh-zone-suggestions li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s ease;
}

.mh-zone-suggestions li:hover {
  background: #f9fafb;
}

/* Mensaje de límite */
.mh-zone-limit {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 10px;
  text-align: center;
}

.mh-zone-limit strong {
  color: #b61c1c;
}

/* ==== FIX INPUTS NUMÉRICOS ==== */
.mh-field input[type="number"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Quita las flechitas horrorosas de Chrome */
.mh-field input[type="number"]::-webkit-outer-spin-button,
.mh-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* === FIX UNIVERSAL DE CAMPOS === */
.mh-field input,
.mh-field textarea,
.mh-field select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Evita que los inputs y textarea sobresalgan en contenedores flex */
.mh-field {
  width: 100%;
  box-sizing: border-box;
}

/* Textarea: evita desbordar y mantiene altura correcta */
.mh-field textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 240px;
  line-height: 1.4;
  overflow-y: auto;
}

/* Input numérico: igual que el resto, sin flechas */
.mh-field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.mh-field input[type="number"]::-webkit-outer-spin-button,
.mh-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ayuda o texto auxiliar bajo los campos */
.mh-field .mh-help-text {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

/* === FIX: dropdown visible sobre el resto === */
.mh-zone-suggestions {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  z-index: 9999 !important; /* lo sube por encima del wizard */
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  max-height: 220px;
  overflow-y: auto;
}

/* El cuerpo del wizard no recorta los dropdowns */
.mh-wizard-body {
  overflow: visible !important;
}

/* En móvil, asegura que el wizard deja respirar el desplegable */
@media (max-width: 768px) {
  .mh-hero,
  .mh-hero-form,
  #metahogar-wizard {
    overflow: visible !important;
  }
}
