.popup-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

/* Fundo escurecido (Fumê) */
.popup-modal .popup-modal-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  text-indent: -999px;
}

/* Wrapper */
.popup-modal .popup-modal-content {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px; 
  box-sizing: border-box;
}

/* Corpo do modal (DESKTOP) */
.popup-modal .popup-modal-content .popup-modal-content-body {
  position: relative;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;

  /* Responsivo por viewport */
  width: min(92vw, 767px);
  aspect-ratio: 1 / 1; 
  max-height: 90vh;  
  height: auto;
  overflow: hidden;

  padding: clamp(16px, 4vw, 70px);
  box-sizing: border-box;

  background-color: #ccebcc;
  background: url(/themes/custom/mahi_facelift/images/popup/back-emergencial-desktop.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border-radius: 16px; 
}


.popup-modal .popup-modal-content .popup-modal-content-body .popup-modal-close {
  position: absolute;
  top: clamp(10px, 2vw, 20px);
  right: clamp(10px, 2vw, 20px);
  display: flex;
  justify-content: end;
  padding-right: 0;
  color: white;
  font-size: 24px;
  z-index: 2;
}

.popup-modal .popup-modal-content .popup-modal-content-body .popup-modal-close:hover {
  cursor: pointer;
}

/* Título (ancorado na arte) */
.popup-modal .popup-modal-content .popup-modal-content-body .field--name-field-titulo {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;

  display: block;
  color: white;

  padding-bottom: 0;
  padding-top: 0;
  margin: 0;

  text-align: center;
  font-family: Raleway, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.2;
  z-index: 1;
}

/* Texto (ancorado na área branca) */
.popup-modal .popup-modal-content .popup-modal-content-body .field--name-body {
  position: absolute;
  top: 52%; /* testar 44% em resolução maior*/
  left: 50%;
  transform: translateX(-50%);
  width: 86%;

  height: auto;
  max-height: 22%;
  overflow: hidden;

  display: -webkit-box;     
  -webkit-box-orient: vertical;
  line-clamp: 6;

  margin: 0;
  padding: 0;
  color: #242424;
  text-align: left;
}

/* CTA (ancorada embaixo) */
.popup-modal .field--name-field-cta {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;

  display: flex;
  justify-content: center;
  margin-top: 0;
}

.popup-modal .field--name-field-cta a {
  display: inline-block;
  background-color: #FFD16C;
  color: #242424;
  padding: 15px 40px;
  font-weight: 700;
  text-decoration: none !important;
  border-radius: 8px;
  text-align: center;
  transition: 0.3s ease;
}

.popup-modal .field--name-field-cta a:hover {
  cursor: pointer;
}

/* MOBILE */
@media (max-width: 767px) {

  .popup-modal .popup-modal-content {
    padding: 12px;
  }

  .popup-modal .popup-modal-content .popup-modal-content-body {
    max-width: 100%;

    width: min(92vw, 325px);
    aspect-ratio: 325 / 540; 
    max-height: 90vh;
    height: auto;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 10px 10px 10px 10px;
    box-sizing: border-box;

    background-color: #ccebcc;
    background: url(/themes/custom/mahi_facelift/images/popup/back-emergencial-mobile.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .popup-modal .popup-modal-content .popup-modal-content-body .field--name-field-titulo {
    top: 14%;
    width: 92%;
    font-size: clamp(22px, 6.2vw, 40px);
    line-height: 1.2;
    text-align: center;
  }

.popup-modal .popup-modal-content .popup-modal-content-body .field--name-body {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translateX(-50%);
    width: 88%;

    height: auto;
    max-height: 24%;
    overflow: hidden;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 7; 

    margin: 0;
    padding: 0;
    color: #242424;
    text-align: center;
  }

  .popup-modal .field--name-field-cta {
    bottom: 9%;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .popup-modal .field--name-field-cta a {
    padding: 12px 26px;
  }
}