/* SISTENET — Banner de consentimiento de cookies (Consent Mode v2 compatible)
   Cumple RGPD + LSSI-CE + guías AEPD:
   • Botones "Aceptar", "Rechazar" y "Personalizar" con igual jerarquía visual
   • Categorías granulares
   • Reversible desde política de cookies o footer
   • No aplica estilos globales fuera del banner */

.cc-banner, .cc-modal, .cc-modal * { box-sizing: border-box; }

/* ═══ BANNER inferior ═══ */
.cc-banner {
  position: fixed;
  left: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vh, 24px);
  z-index: 9999;
  background: var(--blanco, #ffffff);
  color: var(--noche, #0B0F1A);
  border: 1px solid rgba(11,15,26,0.10);
  border-radius: 14px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.35);
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.4vw, 26px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(14px, 2vw, 24px);
  align-items: center;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 400ms cubic-bezier(.2,.7,.3,1), opacity 400ms ease-out;
}
.cc-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cc-banner__texto {
  font-family: var(--font-cuerpo, system-ui, sans-serif);
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(11,15,26,0.85);
}
.cc-banner__texto strong {
  color: var(--noche, #0B0F1A);
  font-weight: 600;
}
.cc-banner__texto a {
  color: var(--corporativo, #2563EB);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-banner__acciones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.cc-btn {
  font-family: var(--font-cuerpo, system-ui, sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
  white-space: nowrap;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn:focus-visible {
  outline: 2px solid var(--electrico, #60A5FA);
  outline-offset: 2px;
}
/* Los tres botones con jerarquía visual equivalente (exigencia AEPD/EDPB) */
.cc-btn--secundario {
  background: transparent;
  color: var(--noche, #0B0F1A);
  border-color: rgba(11,15,26,0.28);
}
.cc-btn--secundario:hover {
  background: rgba(11,15,26,0.04);
  border-color: rgba(11,15,26,0.5);
}
.cc-btn--primario {
  background: var(--corporativo, #2563EB);
  color: #ffffff;
  border-color: var(--corporativo, #2563EB);
}
.cc-btn--primario:hover { background: var(--marino, #0E2A5C); border-color: var(--marino, #0E2A5C); }

@media (max-width: 780px) {
  .cc-banner { grid-template-columns: 1fr; }
  .cc-banner__acciones { justify-content: stretch; }
  .cc-btn { flex: 1 1 100%; text-align: center; }
}

/* ═══ MODAL de preferencias granular ═══ */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(6, 8, 14, 0.6);
  backdrop-filter: blur(3px);
}
.cc-modal.is-open { display: flex; }
.cc-modal__panel {
  background: var(--blanco, #ffffff);
  color: var(--noche, #0B0F1A);
  border-radius: 16px;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.55);
  font-family: var(--font-cuerpo, system-ui, sans-serif);
}
.cc-modal__panel h2 {
  font-family: var(--font-titulo, inherit);
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--noche, #0B0F1A);
}
.cc-modal__panel p.cc-lead {
  margin: 0 0 20px;
  color: rgba(11,15,26,0.7);
  font-size: 0.92rem;
  line-height: 1.5;
}
.cc-cat {
  border: 1px solid rgba(11,15,26,0.10);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(11,15,26,0.02);
}
.cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.cc-cat__titulo {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--noche, #0B0F1A);
}
.cc-cat__desc {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: rgba(11,15,26,0.68);
  line-height: 1.5;
}
/* Toggle */
.cc-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cc-toggle__pista {
  position: absolute; inset: 0;
  background: rgba(11,15,26,0.22);
  border-radius: 999px;
  transition: background 200ms ease;
}
.cc-toggle__pista::before {
  content: "";
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 200ms cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.cc-toggle input:checked + .cc-toggle__pista { background: var(--corporativo, #2563EB); }
.cc-toggle input:checked + .cc-toggle__pista::before { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle__pista { background: rgba(11,15,26,0.35); cursor: not-allowed; opacity: 0.7; }
.cc-toggle input:focus-visible + .cc-toggle__pista {
  outline: 2px solid var(--electrico, #60A5FA);
  outline-offset: 2px;
}

.cc-modal__acciones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(11,15,26,0.08);
}
@media (max-width: 640px) {
  .cc-modal__acciones { justify-content: stretch; }
  .cc-modal__acciones .cc-btn { flex: 1 1 100%; }
}

/* Cuando el sitio se carga en modo oscuro (prefers), el banner mantiene fondo claro
   por decisión de diseño legal: el consentimiento debe leerse con máxima claridad. */
