/**
 * Aviso de cookies.
 *
 * Los colores llegan como custom properties desde inc/cookieNotice.php, con los
 * valores que se hayan elegido en el backend. Así el CSS es estático y cacheable
 * y no hay que generar una hoja de estilos por sitio.
 */

.cookieNotice {
  background-color: var(--cookieNotice-bg, #fff);
  border-block-start: 1px solid rgb(0 0 0 / 8%);
  box-shadow: 0 -2px 20px rgb(0 0 0 / 8%);
  color: var(--cookieNotice-text, #1f1f1f);
  inset-block-end: 0;
  inset-inline: 0;
  opacity: 0;
  padding-block: 1rem;
  padding-inline: 1rem;
  position: fixed;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;

  /* Por debajo de la barra de administración de WordPress (99999). */
  z-index: 99998;
}

.cookieNotice[hidden] {
  display: none;
}

.cookieNotice[data-position='top'] {
  border-block-end: 1px solid rgb(0 0 0 / 8%);
  border-block-start: 0;
  box-shadow: 0 2px 20px rgb(0 0 0 / 8%);
  inset-block-end: auto;
  inset-block-start: 0;
  transform: translateY(-1rem);
}

.cookieNotice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cookieNotice-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-inline: auto;
  max-inline-size: 75rem;
}

.cookieNotice-text {
  flex: 1 1 20rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.cookieNotice-text > :first-child {
  margin-block-start: 0;
}

.cookieNotice-text > :last-child {
  margin-block-end: 0;
}

.cookieNotice-text a {
  color: inherit;
}

.cookieNotice-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.cookieNotice-button {
  background-color: var(--cookieNotice-button-bg, #1f1f1f);
  border: 1px solid var(--cookieNotice-button-bg, #1f1f1f);
  border-radius: 0;
  color: var(--cookieNotice-button-text, #fff);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  padding-block: 0.6rem;
  padding-inline: 1.2rem;
  transition: opacity 0.2s ease;
}

.cookieNotice-button:hover,
.cookieNotice-button:focus-visible {
  opacity: 0.8;
}

/*
 * Rechazar tiene el mismo peso visual que aceptar (contorno en vez de relleno,
 * pero mismo tamaño y misma prominencia). El RGPD exige que rechazar sea tan
 * fácil como aceptar; un botón deslucido o escondido no cumple.
 */
.cookieNotice-button--reject {
  background-color: transparent;
  color: var(--cookieNotice-text, #1f1f1f);
}

@media (max-width: 640px) {
  .cookieNotice-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .cookieNotice-actions {
    justify-content: stretch;
  }

  .cookieNotice-button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookieNotice {
    transition: none;
  }
}

@media print {
  .cookieNotice {
    display: none;
  }
}
