/* Coroas Funeral Portugal — el banner de cookies, como modal centrado.

   Convierte la barra inferior de Moove GDPR en un **modal centrado con velo**,
   igual en las dos capas: la fachada replica el `<aside>` del plugin con sus
   mismos IDs y clases, asi que estas reglas valen para las dos.

   Lo activa `gdpr-sync.js` anadiendo `body.overlay-visible` cuando NO hay
   cookie `moove_gdpr_popup`.

   ⚠️ Los `!important` NO son pereza: el plugin escribe estilos en el atributo
   `style` del propio `<aside>` y los reescribe por JS despues de cargar (por eso
   `gdpr-sync.js` lleva un MutationObserver). Sin `!important` el modal vuelve a
   la barra inferior en cuanto el plugin toca el elemento.

   🔑 Y este fichero es AUTOSUFICIENTE, a diferencia del patron de Napoli: alli
   la fachada carga ademas el `style.css` completo del child theme (~15 KB) solo
   para heredar el aspecto del banner. Aqui no hace falta — y se ahorra una
   peticion a la subcarpeta del WordPress, que era el otro acoplamiento que su
   propia documentacion anota.
   ---------------------------------------------------------------------------- */

/* Los tokens de la casa, repetidos aqui porque este CSS se carga tambien en la
   fachada, donde `styles.css` puede no haber llegado todavia (va con `defer`). */
#moove_gdpr_cookie_info_bar {
  --cfu-b-ink:    #000000;
  --cfu-b-branco: #ffffff;
  --cfu-b-creme:  #f6f4ef;
  --cfu-b-creme2: #ece8de;
  --cfu-b-verde:  #4a6b3e;
  --cfu-b-verde2: #38522e;
  --cfu-b-sans:   "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cfu-b-serif:  "Cormorant Garamond", "Source Serif Pro", Georgia, serif;
}

/* --- El modal ------------------------------------------------------------- */
#moove_gdpr_cookie_info_bar {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(620px, calc(100vw - 32px)) !important;
  max-width: none !important;
  /* ⚠️ `dvh` y no `vh`: en movil la barra del navegador se come el 100vh y el
     boton de aceptar queda fuera de la pantalla. Es el mismo fallo que se
     corrigio en el menu de hamburguesa de este proyecto. */
  max-height: 88dvh !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 9001 !important;
  display: none;
  background: var(--cfu-b-branco) !important;
  color: var(--cfu-b-ink) !important;
  border: 0 !important;
  border-top: 3px solid var(--cfu-b-verde) !important;
  border-radius: 2px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28) !important;
  padding: 0 !important;
}
body.overlay-visible #moove_gdpr_cookie_info_bar {
  display: block !important;   /* lo activa gdpr-sync.js */
}

/* El velo. Va en un `::before` del body para no anadir un nodo que el plugin
   pudiera pisar. */
body.overlay-visible::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.55) !important;
  z-index: 9000 !important;
}
/* Con el modal abierto no se navega por detras. */
body.overlay-visible {
  overflow: hidden !important;
}

/* --- El contenido --------------------------------------------------------- */
#moove_gdpr_cookie_info_bar .moove-gdpr-info-bar-container,
#moove_gdpr_cookie_info_bar .moove-gdpr-info-bar-content {
  display: block !important;
  max-width: none !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice {
  padding: 28px 28px 20px !important;
  border-bottom: 1px solid var(--cfu-b-creme2) !important;
  font-family: var(--cfu-b-sans) !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice p,
#moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice p strong {
  font-family: var(--cfu-b-sans) !important;
  /* 16 px y no los 12 del plugin: es un texto legal que hay que poder leer. */
  font-size: 1rem !important;
  line-height: 1.65 !important;
  /* ⚠️ Negro puro, decision del usuario para toda la red. El plugin lo sirve en
     gris claro sobre su fondo oscuro y aqui el fondo es blanco. */
  color: var(--cfu-b-ink) !important;
  font-weight: 400 !important;
  margin: 0 !important;
  text-align: left !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice a {
  color: var(--cfu-b-ink) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* --- Los botones ---------------------------------------------------------- */
#moove_gdpr_cookie_info_bar .moove-gdpr-button-holder {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 20px 28px 24px !important;
  background: var(--cfu-b-creme) !important;
  margin: 0 !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-button-holder .mgbutton {
  font-family: var(--cfu-b-sans) !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  /* Sin mayusculas: en un sitio funerario un boton en mayusculas grita. */
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  padding: 0.85em 1.6em !important;
  border-radius: 2px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  margin: 0 !important;
  min-width: 0 !important;
  width: auto !important;
  text-decoration: none !important;
}
/* Aceitar: el verde de la casa, el mismo de los 371 CTA de la fachada. */
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-allow-all {
  background: var(--cfu-b-verde) !important;
  border-color: var(--cfu-b-verde) !important;
  color: var(--cfu-b-branco) !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-allow-all:hover,
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-allow-all:focus-visible {
  background: var(--cfu-b-verde2) !important;
  border-color: var(--cfu-b-verde2) !important;
}
/* 🔴 Rejeitar con el MISMO peso visual que Aceitar, solo con filete en vez de
   relleno. Un «rechazar» escondido o en gris claro es una infraccion de la
   normativa de consentimiento, no una decision de diseno. */
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-reject-btn {
  background: transparent !important;
  border-color: var(--cfu-b-ink) !important;
  color: var(--cfu-b-ink) !important;
}
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-reject-btn:hover,
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-reject-btn:focus-visible {
  background: var(--cfu-b-ink) !important;
  color: var(--cfu-b-branco) !important;
}
/* Configurar: terciario, un enlace subrayado. */
#moove_gdpr_cookie_info_bar .moove-gdpr-infobar-settings-btn {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--cfu-b-ink) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  padding-left: 0.4em !important;
  padding-right: 0.4em !important;
  margin-left: auto !important;   /* al otro extremo de la fila */
}
#moove_gdpr_cookie_info_bar .mgbutton:focus-visible {
  outline: 2px solid var(--cfu-b-verde2) !important;
  outline-offset: 3px !important;
}

/* --- Movil ---------------------------------------------------------------- */
@media (max-width: 549px) {
  #moove_gdpr_cookie_info_bar {
    width: calc(100vw - 20px) !important;
  }
  #moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice {
    padding: 22px 20px 16px !important;
  }
  #moove_gdpr_cookie_info_bar .moove-gdpr-button-holder {
    padding: 16px 20px 20px !important;
  }
  /* Los dos botones de decision a ancho completo, y «Configurar» debajo:
     apilados es la unica forma de que los tres quepan sin cortarse. */
  #moove_gdpr_cookie_info_bar .moove-gdpr-infobar-allow-all,
  #moove_gdpr_cookie_info_bar .moove-gdpr-infobar-reject-btn {
    flex: 1 1 100% !important;
    text-align: center !important;
  }
  #moove_gdpr_cookie_info_bar .moove-gdpr-infobar-settings-btn {
    margin-left: 0 !important;
  }
}

/* ⚠️ Y en horizontal con poca altura (un movil tumbado), el modal tiene que
   poder crecer con scroll o el boton de aceptar queda fuera. */
@media (max-height: 460px) {
  #moove_gdpr_cookie_info_bar {
    max-height: 94dvh !important;
  }
  #moove_gdpr_cookie_info_bar .moove-gdpr-cookie-notice {
    padding-top: 18px !important;
    padding-bottom: 12px !important;
  }
}
