/* ============================================================
   Banner y panel de configuración de cookies.
   Usa las variables de color de css/estilo.css.
   ============================================================ */
.cookie-consent[hidden], .cookie-banner[hidden] { display: none; }

.cookie-banner {
  position: fixed;
  z-index: 1000;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  width: min(calc(100% - 2rem), 1080px);
  margin-inline: auto;
  padding: 1.4rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .9rem;
  box-shadow: 0 18px 60px #0000003d;
}

.cookie-banner h2, .cookie-settings h2, .cookie-category h3 { margin-top: 0; }
.cookie-banner h2 { margin-bottom: .45rem; font-family: Georgia, serif; font-size: 1.65rem; }
.cookie-banner-copy p:not(.eyebrow) { max-width: 760px; margin: 0 0 .45rem; color: var(--muted); }

.cookie-banner-actions, .cookie-settings-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

.cookie-action {
  min-height: 44px;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--red-dark);
  border: 1px solid var(--red-dark);
  border-radius: .45rem;
  cursor: pointer;
}
.cookie-action:hover, .cookie-action:focus-visible { filter: brightness(1.08); }
.cookie-action-secondary { color: var(--ink); background: #fff; border-color: var(--ink); }

.cookie-settings {
  width: min(calc(100% - 2rem), 700px);
  max-height: calc(100vh - 2rem);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}
.cookie-settings::backdrop { background: #00000094; }
.cookie-settings-panel { padding: 1.5rem; overflow: auto; background: #fff; border-radius: .9rem; }
.cookie-settings-heading { display: flex; justify-content: space-between; gap: 1rem; }

.cookie-close {
  align-self: start;
  width: 44px;
  height: 44px;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.cookie-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.cookie-category h3 { margin-bottom: .25rem; font-family: Georgia, serif; font-size: 1.2rem; }
.cookie-category p, .cookie-settings-note { margin: 0; color: var(--muted); }
.cookie-required { font-weight: 700; color: var(--muted); }

.cookie-switch { position: relative; display: inline-flex; }
.cookie-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cookie-switch > span[aria-hidden="true"] {
  position: relative;
  display: block;
  width: 54px;
  height: 30px;
  background: #aaa;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.cookie-switch > span[aria-hidden="true"]::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  content: "";
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
}
.cookie-switch input:checked + span { background: var(--red-dark); }
.cookie-switch input:checked + span::after { transform: translate(24px); }
.cookie-switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent);
  outline-offset: 3px;
}

.cookie-settings-note { margin: 0 0 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.footer-link-button {
  padding: 0;
  font: inherit;
  color: #ddd;
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.footer-link-button:hover, .footer-link-button:focus-visible { color: #fff; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cookie-switch > span[aria-hidden="true"],
  .cookie-switch > span[aria-hidden="true"]::after { transition: none; }
}

@media (max-width: 760px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
  .cookie-banner-actions, .cookie-settings-actions { display: grid; grid-template-columns: 1fr; }
  .cookie-action { width: 100%; }
}
