/* Aviso de cookies (analítica y publicidad). Tokens de Ruta B: navy #0F172A, naranja #F97316, slate #CBD5E1 / #E2E8F0.
   Tres botones del mismo tamaño y peso visual (mismo color): rechazar todo es tan fácil como aceptar todo. */
.cookie-bar {
  position: fixed; z-index: 1100;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px;
  background: #0F172A; color: #CBD5E1;
  box-shadow: 0 18px 50px rgba(2, 6, 23, .45);
  font-family: Sora, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .875rem; line-height: 1.5;
  max-height: calc(100dvh - 24px); overflow-y: auto;
  animation: cookieIn .3s ease both;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar__text { margin: 0; }
.cookie-bar__title { margin: 0; color: #fff; font-weight: 700; font-size: .9375rem; line-height: 1.3; }
.cookie-bar__title + .cookie-bar__text { margin-top: -6px; }
.cookie-bar__text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.cookie-bar__text a:hover { color: #FDBA74; }
.cookie-bar__choices { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.cookie-choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px;
}
.cookie-choice input {
  flex: none; width: 22px; height: 22px; margin: 1px 0 0; cursor: pointer; accent-color: #F97316;
}
.cookie-choice__body { display: flex; flex-direction: column; gap: 2px; }
.cookie-choice__body strong { color: #fff; font-weight: 700; }
.cookie-choice__body small { color: #CBD5E1; font-size: .8125rem; line-height: 1.45; }
.cookie-choice:has(input:focus-visible) { outline: 3px solid #FDBA74; outline-offset: 2px; }
.cookie-bar__actions { display: flex; align-items: stretch; gap: 10px; }
.cookie-bar__btn {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 8px 8px; border: 0; border-radius: 12px;
  font: inherit; font-size: .8125rem; line-height: 1.25; font-weight: 700; cursor: pointer; color: #0F172A; background: #E2E8F0;
}
.cookie-bar__btn:hover { filter: brightness(1.06); }
.cookie-bar a:focus-visible, .cookie-bar__btn:focus-visible { outline: 3px solid #FDBA74; outline-offset: 2px; border-radius: 6px; }
.cookie-bar__btn:focus-visible { border-radius: 12px; }
html[data-lang="es"] .cookie-bar [data-l="en"],
html[data-lang="en"] .cookie-bar [data-l="es"] { display: none !important; }
@media (min-width: 768px) {
  .cookie-bar { left: auto; right: 20px; bottom: 20px; width: min(460px, calc(100vw - 40px)); }
}
/* Pantallas pequeñas: mismo lenguaje visual, menos relleno y texto algo menor. Los botones siguen siendo iguales y de 44 px o más. */
@media (max-width: 520px) {
  .cookie-bar { padding: 12px; gap: 10px; border-radius: 14px; font-size: .8125rem; line-height: 1.4; }
  .cookie-bar__choices { gap: 8px; }
  .cookie-choice { gap: 10px; padding: 8px 10px; border-radius: 10px; }
  .cookie-choice__body { gap: 1px; }
  .cookie-choice__body small { font-size: .75rem; line-height: 1.35; }
  .cookie-bar__actions { gap: 8px; }
  .cookie-bar__btn { padding: 6px 4px; font-size: .78rem; }
}
/* Pantallas bajas y anchas (móvil en horizontal): las dos opciones una al lado de la otra y el aviso a todo el ancho. */
@media (min-width: 521px) and (max-height: 520px) {
  .cookie-bar { left: 12px; right: 12px; width: auto; padding: 10px 14px; gap: 8px; font-size: .8125rem; line-height: 1.4; }
  .cookie-bar__choices { flex-direction: row; gap: 8px; }
  .cookie-choice { flex: 1 1 0; padding: 8px 10px; gap: 10px; }
  .cookie-choice__body small { font-size: .75rem; line-height: 1.35; }
}
@keyframes cookieIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cookie-bar { animation: none; } }

/* Estado de la elección (página de cookies): solo se ve el texto que corresponde. */
[data-consent-show], [data-consent-mkt-show] { display: none; }
html[data-consent="granted"] [data-consent-show="granted"],
html[data-consent="denied"] [data-consent-show="denied"],
html[data-consent="unset"] [data-consent-show="unset"] { display: inline; }
html[data-consent-marketing="granted"] [data-consent-mkt-show="granted"],
html[data-consent-marketing="denied"] [data-consent-mkt-show="denied"],
html[data-consent-marketing="unset"] [data-consent-mkt-show="unset"] { display: inline; }

/* Botón «Cambiar mi elección» (página de cookies): fondo claro, texto navy. */
.consent-change {
  min-height: 44px; padding: 0 18px; border: 1px solid #0F172A; border-radius: 12px;
  background: #fff; color: #0F172A; font: inherit; font-weight: 700; cursor: pointer;
}
.consent-change:hover { background: #F1F5F9; }
.consent-change:focus-visible { outline: 3px solid rgba(249, 115, 22, .6); outline-offset: 2px; }

