/* Aviso de cookies: franja inferior con la identidad "Brasa". */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 70;
  width: min(1040px, calc(100% - 1.5rem));
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-frame);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translate(-50%, 24px);
  opacity: 0;
  transition: opacity 0.35s, transform 0.5s var(--ease-out);
}
.cookie-bar[hidden] { display: none; }
.cookie-bar.is-in { opacity: 1; transform: translate(-50%, 0); }
.cookie-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, var(--ember-2), var(--crimson));
}
.cookie-main { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.cookie-copy { min-width: 0; }
.cookie-title {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.3rem;
  font: 700 1.02rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
}
.cookie-title .ico { width: 18px; height: 18px; color: var(--ember-2); }
.cookie-copy p { margin: 0; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; max-width: 62ch; }
.cookie-copy a { color: var(--text); text-underline-offset: 3px; }
.cookie-copy a:hover { color: var(--ember-2); }
.cookie-actions { display: flex; flex: none; gap: 0.55rem; }

.cookie-config { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cookie-config[hidden] { display: none; }
.cookie-config:not([hidden]) { animation: cookie-open 0.4s var(--ease-out); }
@keyframes cookie-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cookie-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.cookie-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-3) 55%, transparent);
}
.cookie-cat b { font: 600 0.95rem/1.3 var(--font-body); }
.cookie-cat p { margin: 0.2rem 0 0; color: var(--text-2); font-size: 0.84rem; line-height: 1.45; max-width: 64ch; }
.cookie-config-actions { display: flex; justify-content: flex-end; margin-top: 0.9rem; }

.cookie-switch { position: relative; flex: none; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.cookie-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.cookie-switch span[aria-hidden] {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition: background-color 0.25s, border-color 0.25s;
}
.cookie-switch span[aria-hidden]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.3s var(--ease-out), background-color 0.25s;
}
.cookie-switch input:checked + span { background: color-mix(in srgb, var(--ember) 85%, transparent); border-color: var(--ember-2); }
.cookie-switch input:checked + span::after { transform: translateX(20px); background: var(--on-ember); }
.cookie-switch input:disabled { cursor: not-allowed; }
.cookie-switch input:disabled + span { opacity: 0.55; }
.cookie-switch input:focus-visible + span { outline: 2px solid var(--ember-2); outline-offset: 3px; }

/* Mientras el aviso está abierto, el botón flotante de contacto se aparta. */
body.cookie-open .sticky-cta { opacity: 0; visibility: hidden; }

.footer-cookie-link { all: unset; cursor: pointer; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-cookie-link:hover { color: var(--ember-2); }
.footer-cookie-link:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 760px) {
  .cookie-bar { width: calc(100% - 1rem); bottom: 0.5rem; padding: 1rem; max-height: calc(100dvh - 1rem); overflow-y: auto; }
  .cookie-main { flex-direction: column; align-items: stretch; }
  .cookie-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-actions [data-cookie-action="accept"] { grid-column: 1 / -1; order: -1; }
  .cookie-cat { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-bar, .cookie-config:not([hidden]) { transition: none; animation: none; }
}
