/* ==========================================================================
   Global Football Total · aviso de cookies y panel de configuración (assets/js/cookies.js)
   «Aceptar» y «Rechazar» tienen el mismo formato y el mismo nivel, como pide la guía de la AEPD.
   ========================================================================== */

/* ---------- Aviso (primera capa): tarjeta abajo a la izquierda, sin bloquear la página ---------- */
.ck {
  position: fixed; left: var(--gutter); bottom: clamp(16px, 3vh, 32px); z-index: 60;
  width: min(540px, calc(100vw - var(--gutter) * 2));
  padding: 26px 28px 22px;
  background: var(--navy-950); color: var(--white);
  box-shadow: 0 0 0 1px var(--line-soft), 0 28px 70px rgba(2, 14, 28, 0.6);
  opacity: 0; transform: translateY(28px); visibility: hidden;
  transition: opacity 0.5s linear, transform 0.9s var(--ease-out), visibility 0s linear 0.9s;
}
.ck.is-in { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.ck::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--red);
  transform: scaleX(0); transform-origin: left center; transition: transform 1.1s var(--ease-in-out) 0.2s;
}
.ck.is-in::before { transform: scaleX(1); }
.ck__head { display: flex; align-items: center; gap: 16px; }
.ck__icon { flex: none; width: 46px; height: 46px; color: var(--white); }
.ck__icon:empty { display: none; }
.ck__icon svg, .ckp__icon svg { width: 100%; height: 100%; overflow: visible; }
.ck__icon svg *, .ckp__icon svg * { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ck__icon svg .ic-red, .ckp__icon svg .ic-red { stroke: var(--red); stroke-width: 2.2; }
.ck__title { font: 900 clamp(1.7rem, 2.4vw, 2.2rem)/0.9 var(--font-display); text-transform: uppercase; letter-spacing: -0.01em; }
.ck__text { margin-top: 14px; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.ck__text a { color: var(--white); white-space: nowrap; }
.ck__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.ck__btn { min-height: 50px; padding: 0 1em; }
.ck__more {
  grid-column: 1 / -1; justify-self: center; min-height: 44px; padding: 0 12px;
  font: 600 0.75rem/1 var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--white);
  text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.5em;
}
.ck__more:hover { color: var(--muted); }

/* Enlace «Configurar cookies» del pie */
.ck-open { font: inherit; color: var(--white); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.ck-open:hover { color: var(--muted); }
.no-js [data-ck-open] { display: none; }

/* ---------- Panel (segunda capa): diálogo modal claro ---------- */
.ckp {
  --ink-soft: #3d5874; --ink-faint: #6b8299; --rule: rgba(3, 22, 43, 0.14);
  width: min(720px, calc(100vw - 32px)); max-width: none; max-height: min(90vh, 900px); max-height: min(90dvh, 900px);
  margin: auto; padding: 0; border: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--white); color: var(--navy); box-shadow: 0 40px 100px rgba(2, 14, 28, 0.55);
}
.ckp::backdrop { background: rgba(2, 14, 28, 0.74); }
.ckp[open] { animation: ckp-in 0.7s var(--ease-out); }
.ckp[open]::backdrop { animation: ckp-fade 0.4s linear; }
@keyframes ckp-in { from { opacity: 0; transform: translateY(32px); } }
@keyframes ckp-fade { from { opacity: 0; } }
.ckp :focus-visible { outline-color: var(--cobalt); }
.ckp__inner { position: relative; padding: clamp(24px, 4vw, 44px); }
.ckp__inner::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 4px; background: var(--red); }
.ckp__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ckp__eyebrow { display: flex; align-items: center; gap: 12px; font: 600 0.8125rem/1 var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); }
.ckp__icon { flex: none; width: 34px; height: 34px; color: var(--navy); }
.ckp__icon:empty { display: none; }
.ckp__close { display: grid; place-items: center; flex: none; width: 46px; height: 46px; box-shadow: inset 0 0 0 1px var(--rule); transition: background-color 0.3s linear, color 0.3s linear; }
.ckp__close:hover { background: var(--navy); color: var(--white); }
.ckp__x { position: relative; width: 18px; height: 18px; }
.ckp__x i { position: absolute; left: 50%; top: 50%; width: 22px; height: 2px; margin: -1px 0 0 -11px; background: currentColor; transform: rotate(45deg); }
.ckp__x i + i { transform: rotate(-45deg); }
.ckp__title { margin-top: clamp(18px, 2.4vw, 26px); font: 900 clamp(2.2rem, 5vw, 3.6rem)/0.88 var(--font-display); text-transform: uppercase; letter-spacing: -0.014em; text-wrap: balance; }
.ckp__lead { margin-top: 16px; max-width: 58ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-soft); }

.ckp__cats { margin-top: clamp(22px, 3vw, 32px); border-top: 1px solid var(--rule); }
.ckp__cat { padding: 20px 0 14px; border-bottom: 1px solid var(--rule); }
.ckp__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ckp__name { font: 800 1.45rem/1 var(--font-display); text-transform: uppercase; }
.ckp__always { font: 700 0.6875rem/1 var(--font-display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); }
.ckp__desc { margin-top: 10px; max-width: 60ch; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-soft); }
.ckp__more summary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none;
  font: 600 0.75rem/1 var(--font-display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--cobalt-700);
}
.ckp__more summary::-webkit-details-marker { display: none; }
.ckp__more summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.3s var(--ease-out); }
.ckp__more[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.ckp__table { width: 100%; margin: 4px 0 8px; border-collapse: collapse; font-size: 0.875rem; line-height: 1.45; }
.ckp__table th { padding: 0 12px 8px 0; text-align: left; font: 700 0.6875rem/1.2 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--navy); }
.ckp__table td { padding: 10px 12px 10px 0; vertical-align: top; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.ckp__table td:first-child { white-space: nowrap; }
.ckp__table code { display: block; font: 600 0.8125rem/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--navy); }
.ckp__table td span { font-size: 0.75rem; color: var(--ink-faint); }

/* Interruptor rectangular, como los botones de la web */
.ckp__switch { position: relative; flex: none; width: 60px; height: 32px; cursor: pointer; }
.ckp__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ckp__switch span { position: absolute; inset: 0; background: #c3cfdc; pointer-events: none; transition: background-color 0.3s linear; }
.ckp__switch span::after {
  content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; background: var(--white);
  box-shadow: 0 1px 3px rgba(2, 14, 28, 0.3); transition: transform 0.45s var(--ease-out);
}
.ckp__switch input:checked + span { background: var(--red); }
.ckp__switch input:checked + span::after { transform: translateX(28px); }
.ckp__switch input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.ckp__actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; margin-top: clamp(22px, 3vw, 30px); }
.ckp__btn {
  min-height: 52px; padding: 0 1em; font: 600 0.9375rem/1 var(--font-body); color: var(--navy);
  box-shadow: inset 0 0 0 1.5px var(--navy); transition: background-color 0.3s linear, color 0.3s linear;
}
.ckp__btn:hover { background: var(--navy); color: var(--white); }
.ckp__save::before { background: var(--navy); }
.ckp__save:hover { color: var(--white); }
.ckp__links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 18px; font-size: 0.8125rem; }
.ckp__links a { color: var(--cobalt-700); text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 599px) {
  .ck { left: 0; bottom: 0; width: 100%; padding: 22px 20px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line-soft), 0 -20px 50px rgba(2, 14, 28, 0.5); }
  .ck__icon { width: 38px; height: 38px; }
  .ck__text { margin-top: 10px; font-size: 0.875rem; }
  .ck__actions { margin-top: 16px; }
  .ck__btn { min-height: 48px; }
  .ckp { width: 100%; max-height: 100%; max-height: 100dvh; height: 100%; height: 100dvh; }
  /* Botones siempre a la vista al desplazar el panel */
  .ckp__actions {
    position: sticky; bottom: 0; z-index: 1; grid-template-columns: 1fr 1fr;
    margin: 20px -24px 0; padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
    background: var(--white); box-shadow: 0 -1px 0 var(--rule), 0 -16px 24px rgba(245, 248, 252, 0.9);
  }
  .ckp__btn, .ckp__save { min-height: 48px; }
  .ckp__save { grid-column: 1 / -1; grid-row: 1; }
  .ckp__table td:first-child { white-space: normal; }
}
