/* ═══════════════════════════════════════════════════════════════
   Banner de consentimiento — Veltria (Cubia Tecnologías, S.L.)
   Adaptado de plantilla-base/cookies/consent.css a la paleta de DESIGN.md.
   ═══════════════════════════════════════════════════════════════ */

.cc-root {
  --cc-fondo:        #14171C;   /* tinta */
  --cc-texto:        #EEF0F2;   /* papel */
  --cc-texto-suave:  #9BA1A8;
  --cc-borde:        #2A2E35;
  --cc-acento:       #0A7A75;   /* marca */
  --cc-acento-texto: #FFFFFF;
  --cc-radio:        16px;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  font-family: 'Public Sans', sans-serif;
}

.cc-root.cc-visible { display: flex; }

.cc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.cc-panel {
  position: relative;
  width: min(560px, calc(100% - 1.5rem));
  margin: 0 auto 1rem;
  padding: 1.5rem;
  background: var(--cc-fondo);
  color: var(--cc-texto);
  border: 1px solid var(--cc-borde);
  border-radius: var(--cc-radio);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  animation: cc-entrada .28s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes cc-entrada {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

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

.cc-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: .75rem;
}

.cc-icono { color: var(--cc-acento); flex-shrink: 0; }

.cc-titulo {
  margin: 0;
  font-family: 'Familjen Grotesk', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

.cc-texto {
  margin: 0 0 1.125rem;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--cc-texto-suave);
}

.cc-texto a {
  color: var(--cc-texto);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Categorías ─────────────────────────────────────────────── */

.cc-detalle {
  margin: 0 0 1.125rem;
  border-top: 1px solid var(--cc-borde);
}

.cc-cat {
  padding: .875rem 0;
  border-bottom: 1px solid var(--cc-borde);
}

.cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cc-cat-nombre {
  font-size: .875rem;
  font-weight: 600;
}

.cc-cat-desc {
  margin: .375rem 0 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--cc-texto-suave);
}

/* ── Interruptor ────────────────────────────────────────────── */

.cc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cc-slider {
  position: absolute;
  inset: 0;
  background: var(--cc-borde);
  border-radius: 999px;
  transition: background .18s ease;
  pointer-events: none;
}

.cc-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--cc-texto);
  border-radius: 50%;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1);
}

.cc-switch input:checked + .cc-slider { background: var(--cc-acento); }
.cc-switch input:checked + .cc-slider::before {
  transform: translateX(18px);
  background: var(--cc-acento-texto);
}
.cc-switch input:disabled + .cc-slider { opacity: .55; }
.cc-switch input:disabled { cursor: not-allowed; }

.cc-switch input:focus-visible + .cc-slider {
  outline: 2px solid var(--cc-acento);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cc-slider, .cc-slider::before { transition: none; }
}

/* ── Botones ────────────────────────────────────────────────── */

/* Rechazar y Aceptar comparten peso visual a propósito: la AEPD exige
   que rechazar sea tan fácil como aceptar. No conviertas "Rechazar"
   en un enlace pequeño. */

.cc-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.cc-btn {
  flex: 1 1 auto;
  min-width: 120px;
  min-height: 44px;
  padding: .6875rem 1rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--cc-borde);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.cc-btn--sec {
  background: transparent;
  color: var(--cc-texto);
}

.cc-btn--sec:hover {
  background: rgba(255, 255, 255, .06);
  border-color: var(--cc-texto-suave);
}

.cc-btn--pri {
  background: var(--cc-acento);
  color: var(--cc-acento-texto);
  border-color: var(--cc-acento);
}

.cc-btn--pri:hover { filter: brightness(1.1); }

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-acento);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn { transition: none; }
}

@media (max-width: 420px) {
  .cc-acciones { flex-direction: column; }
  .cc-btn { width: 100%; }
}
