/* Popup de contacto de la Home. Los IDs corresponden a módulos Divi confirmados. */
#miasento-contacto-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: clamp(12px, 3vw, 32px);
  overflow: hidden;
  overscroll-behavior: contain;
  align-items: center;
  justify-content: center;
  background: rgb(11 13 18 / 76%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

#miasento-contacto-modal.miasento-contacto-abierto { display: flex; }

#miasento-contacto-panel {
  position: relative;
  box-sizing: border-box;
  width: min(1520px, 100%);
  max-width: 100%;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(26px, 5vw, 48px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(201 141 123 / 48%);
  border-radius: 20px;
  background: #FAF5EF;
  color: #241C19;
  box-shadow: 0 24px 90px rgb(0 0 0 / 42%);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#miasento-contacto-panel #miasento-esencia #miasento-fase-3 > h2 {
  color: #241C19;
}

/* C06/C07: variantes de contacto exclusivas del panel claro de Home. */
#miasento-contacto-panel #miasento-esencia #miasento-fase-3 > p:first-of-type {
  color: #4B403B;
}
#miasento-contacto-panel #miasento-esencia #miasento-fase-3 :is(button, input)[type="submit"]:enabled:hover {
  color: #915746;
}

#miasento-contacto-panel::-webkit-scrollbar { display: none; width: 0; height: 0; }

#miasento-contacto-cerrar {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid #EFE4D6;
  border-radius: 50%;
  background: #C98D7B;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

#miasento-contacto-cerrar::before,
#miasento-contacto-cerrar::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #0B0D12;
  content: "";
  pointer-events: none;
}

#miasento-contacto-cerrar::before { transform: translate(-50%, -50%) rotate(45deg); }
#miasento-contacto-cerrar::after { transform: translate(-50%, -50%) rotate(-45deg); }

#miasento-contacto-cerrar:hover,
#miasento-contacto-cerrar:focus-visible { background: #EFE4D6; }

#miasento-contacto-panel :focus-visible,
#miasento-contacto-cerrar:focus-visible { outline: 3px solid #C98D7B; outline-offset: 3px; }

html.miasento-contacto-scroll-bloqueado { overflow: hidden; }
body.miasento-contacto-scroll-bloqueado { overscroll-behavior: none; }

@media (max-width: 767px) {
  #miasento-contacto-modal { padding: 10px; }
  #miasento-contacto-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 58px 20px 24px;
    border-radius: 18px;
  }
  #miasento-contacto-cerrar { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #miasento-contacto-modal,
  #miasento-contacto-panel { scroll-behavior: auto; }
}

/* Divi 5 Visual Builder: mantener la sección seleccionable y editable. */
body.et-fb #miasento-contacto-modal,
body.miasento-contacto-editor #miasento-contacto-modal {
  position: relative;
  inset: auto;
  z-index: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: initial;
  padding: initial;
  overflow: visible;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.et-fb #miasento-contacto-panel,
body.miasento-contacto-editor #miasento-contacto-panel {
  width: auto;
  max-width: none;
  max-height: none;
  margin: initial;
  overflow: visible;
  box-shadow: none;
}

body.et-fb #miasento-contacto-cerrar,
body.miasento-contacto-editor #miasento-contacto-cerrar { position: static; }
