/* Tarjeta de cookies (js/aviso-cookies.js). No bloquea la página. Toma colores y
   tipografías de base.css, que cargan todas las páginas. Aceptar y Rechazar
   miden lo mismo: ninguna opción se esconde. */
.aviso-cookies {
  position: fixed;
  z-index: 960;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(100% - 40px, 400px);
  gap: 14px;
  padding: 20px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 14px;
  background: #0a0f18;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%), 0 20px 44px rgb(0 0 0 / 60%);
  color: #cbd5e1;
  font-family: var(--texto);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  animation: entrar-cookies 320ms var(--ease-out) both;
}

@keyframes entrar-cookies {
  from {
    transform: translateY(12px);
  }
}

.aviso-cookies h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.2;
}

.aviso-cookies p {
  margin: 0;
  text-wrap: pretty;
}

.aviso-cookies a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 40%);
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms ease;
}

.detalles-cookies summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.detalles-cookies summary::-webkit-details-marker {
  display: none;
}

.detalles-cookies summary::after {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.detalles-cookies[open] summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.detalles-cookies summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.detalles-cookies dl {
  margin: 10px 0 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.detalles-cookies dl div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.detalles-cookies dt {
  color: #94a3b8;
}

.detalles-cookies dd {
  margin: 0;
  color: #fff;
}

.detalles-cookies code {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.aviso-cookies .opciones-cookies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.aviso-cookies button {
  padding: 11px 16px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 999px;
  background: rgb(255 255 255 / 5%);
  color: #fff;
  cursor: pointer;
  font-family: var(--titulos);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 200ms ease, border-color 200ms ease, transform 160ms ease;
}

.aviso-cookies button[data-eleccion="aceptadas"] {
  border-color: var(--rojo);
  background: var(--rojo);
}

.aviso-cookies button:active {
  transform: scale(0.97);
}

.aviso-cookies a:focus-visible,
.aviso-cookies button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .aviso-cookies a:hover {
    text-decoration-color: #fff;
  }

  .aviso-cookies button:hover {
    border-color: rgb(255 255 255 / 60%);
    background: rgb(255 255 255 / 12%);
  }

  .aviso-cookies button[data-eleccion="aceptadas"]:hover {
    border-color: var(--rojo-oscuro);
    background: var(--rojo-oscuro);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aviso-cookies {
    animation: none;
  }
}

/* Botón de los pies de página que reabre la tarjeta; se ve como enlace. */
.enlace-cookies {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .aviso-cookies {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px);
    padding: 16px;
  }
}

/* Sobre la barra inferior de accesos del teléfono, sin taparla. */
@media (max-width: 900px) {
  body:has(.barra-movil) .aviso-cookies {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 180px);
  }
}
