/* ════════════════════════════════════════════════════════════════
   HEREDAX · Gestor de consentimiento de cookies (1ª capa)
   Estilos del banner, panel de configuración, botón persistente
   y "puertas" (gates) que bloquean HubSpot hasta el consentimiento.
   Colores de marca en HEX para no depender de los tokens de cada página.
   ════════════════════════════════════════════════════════════════ */

:root {
  --ck-green: #1FA76A;
  --ck-teal:  #337879;
  --ck-ink:   #0f2521;
  --ck-mid:   #4a5d57;
  --ck-line:  rgba(15, 37, 33, .12);
  --ck-bg:    #ffffff;
  --ck-radius: 18px;
  --ck-shadow: 0 24px 60px -20px rgba(15, 37, 33, .35), 0 4px 16px rgba(15, 37, 33, .12);
  --ck-font: 'Inter Tight', system-ui, -apple-system, Segoe UI, sans-serif;
}

.ck-hidden { display: none !important; }

/* ── BANNER (primera capa) ──────────────────────────────── */
.ck-banner {
  position: fixed;
  z-index: 2147483600;
  left: 24px;
  right: 24px;
  bottom: 24px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--ck-bg);
  color: var(--ck-ink);
  border: 1px solid var(--ck-line);
  border-radius: var(--ck-radius);
  box-shadow: var(--ck-shadow);
  padding: 26px 26px 22px;
  font-family: var(--ck-font);
  animation: ck-rise .4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes ck-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ck-banner__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.ck-banner__title svg { width: 22px; height: 22px; flex: none; }
.ck-banner__text {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--ck-mid);
  margin: 0 0 18px;
}
.ck-banner__text a { color: var(--ck-green); font-weight: 600; text-decoration: underline; }
.ck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Botones — contraste equivalente entre aceptar y rechazar (requisito AEPD) */
.ck-btn {
  font-family: var(--ck-font);
  font-size: .9rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
  line-height: 1;
}
.ck-btn:hover { transform: translateY(-1px); }
.ck-btn:focus-visible { outline: 3px solid rgba(31, 167, 106, .4); outline-offset: 2px; }

.ck-btn--accept {
  background: var(--ck-green);
  color: #fff;
  border-color: var(--ck-green);
  flex: 1 1 auto;
}
.ck-btn--accept:hover { background: #1c945e; }
/* Rechazar: mismo peso visual que aceptar (no engañoso) */
.ck-btn--reject {
  background: #eef2f0;
  color: var(--ck-ink);
  border-color: var(--ck-line);
  flex: 1 1 auto;
}
.ck-btn--reject:hover { background: #e3e9e6; }
.ck-btn--config {
  background: transparent;
  color: var(--ck-teal);
  border-color: var(--ck-teal);
}
.ck-btn--config:hover { background: rgba(51, 120, 121, .08); }
.ck-btn--ghost {
  background: transparent;
  color: var(--ck-mid);
  border-color: var(--ck-line);
}
.ck-btn--ghost:hover { background: #f1f4f3; }

/* ── PANEL DE CONFIGURACIÓN (modal) ─────────────────────── */
.ck-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483601;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ck-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 18, .55);
  backdrop-filter: blur(3px);
}
.ck-modal__panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--ck-bg);
  border-radius: var(--ck-radius);
  box-shadow: var(--ck-shadow);
  font-family: var(--ck-font);
  color: var(--ck-ink);
  animation: ck-rise .35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ck-modal__head {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--ck-line);
  position: sticky;
  top: 0;
  background: var(--ck-bg);
  border-radius: var(--ck-radius) var(--ck-radius) 0 0;
}
.ck-modal__head h2 { font-size: 1.25rem; margin: 0 0 6px; font-weight: 700; }
.ck-modal__head p { font-size: .88rem; color: var(--ck-mid); margin: 0; line-height: 1.5; }
.ck-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--ck-line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--ck-ink);
}
.ck-modal__close svg { width: 18px; height: 18px; }
.ck-modal__body { padding: 8px 28px 4px; }
.ck-modal__foot {
  padding: 18px 28px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--ck-line);
  position: sticky;
  bottom: 0;
  background: var(--ck-bg);
}

/* Categorías */
.ck-cat {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ck-line);
}
.ck-cat:last-child { border-bottom: 0; }
.ck-cat__main { flex: 1; }
.ck-cat__main h3 { font-size: 1rem; margin: 0 0 5px; font-weight: 700; }
.ck-cat__main p { font-size: .85rem; color: var(--ck-mid); line-height: 1.5; margin: 0; }

/* Switch */
.ck-switch { flex: none; position: relative; width: 48px; height: 28px; }
.ck-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ck-switch__track {
  position: absolute;
  inset: 0;
  background: #c9d3cf;
  border-radius: 999px;
  transition: background .2s ease;
  pointer-events: none;
}
.ck-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.ck-switch input:checked + .ck-switch__track { background: var(--ck-green); }
.ck-switch input:checked + .ck-switch__track::after { transform: translateX(20px); }
.ck-switch input:disabled + .ck-switch__track { background: var(--ck-teal); opacity: .55; }
.ck-switch input:focus-visible + .ck-switch__track { outline: 3px solid rgba(31, 167, 106, .4); outline-offset: 2px; }

/* ── BOTÓN PERSISTENTE (revocación) ─────────────────────── */
.ck-fab {
  position: fixed;
  z-index: 2147483599;
  left: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: 0 6px 18px -6px rgba(15, 37, 33, .4);
  display: grid;
  place-items: center;
  color: var(--ck-teal);
  transition: transform .15s ease;
}
.ck-fab:hover { transform: scale(1.07); }
.ck-fab svg { width: 23px; height: 23px; }

/* ── GATE: bloqueo de embeds HubSpot hasta consentir ────── */
.ck-gate__embed { display: none; }
.ck-gate.is-consented .ck-gate__embed { display: block; }
.ck-gate.is-consented .ck-gate__prompt { display: none; }

.ck-gate__prompt {
  border: 1px dashed var(--ck-line);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  background: #f7faf9;
}
.ck-gate__prompt svg { width: 30px; height: 30px; color: var(--ck-teal); margin: 0 auto 12px; display: block; }
.ck-gate__prompt p { font-size: .9rem; color: var(--ck-mid); line-height: 1.55; margin: 0 0 16px; }
.ck-gate__prompt a { color: var(--ck-green); font-weight: 600; text-decoration: underline; }
.ck-gate__prompt .ck-btn--accept { flex: 0 1 auto; display: inline-block; }

/* ── INFORMACIÓN BÁSICA PROTECCIÓN DE DATOS (1ª capa, junto a formularios) ── */
.lf-privacy {
  margin-top: 16px;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--ck-mid);
  font-family: var(--ck-font);
}
.lf-privacy a { color: var(--ck-green); font-weight: 600; text-decoration: underline; }
.lf-privacy strong { color: var(--ck-ink); font-weight: 600; }

@media (max-width: 560px) {
  .ck-banner { left: 12px; right: 12px; bottom: 12px; padding: 22px 20px 18px; }
  .ck-actions { flex-direction: column; }
  .ck-btn--config { order: 3; }
  .ck-fab { left: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ck-banner, .ck-modal__panel { animation: none; }
  .ck-btn:hover, .ck-fab:hover { transform: none; }
}
