/* ============================================================
   BANNER DE COOKIES — RGPD / ePrivacy
   Sin dependencias externas. Compatible móvil y escritorio.
============================================================ */

/* ── Banner inferior ─────────────────────────────────────── */
#ck-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9900;
  background: #ffffff;
  border-top: 2px solid #e04f5f;
  box-shadow: 0 -4px 32px rgba(22,34,54,.12);
  padding: 18px 32px;
  animation: ck-slide-up .3s ease;
}

@keyframes ck-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#ck-banner[hidden] { display: none !important; }

.ck-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.ck-banner__icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.ck-banner__text {
  flex: 1;
  min-width: 260px;
}

.ck-banner__text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #162236;
  margin-bottom: 4px;
}

.ck-banner__text p {
  margin: 0;
  font-size: 13px;
  color: #5f6f82;
  line-height: 1.55;
}

.ck-banner__text a {
  color: #e04f5f;
  text-decoration: underline;
  font-size: 12px;
}

.ck-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Botones ──────────────────────────────────────────────── */
.ck-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.ck-btn--primary {
  background: #e04f5f;
  color: #fff;
  border-color: #e04f5f;
}
.ck-btn--primary:hover { background: #cb4353; border-color: #cb4353; }

.ck-btn--outline {
  background: transparent;
  color: #5f6f82;
  border-color: #d8e2eb;
}
.ck-btn--outline:hover { border-color: #5f6f82; color: #162236; }

.ck-btn--ghost {
  background: transparent;
  color: #e04f5f;
  border-color: transparent;
  text-decoration: underline;
  padding-left: 4px;
  padding-right: 4px;
}
.ck-btn--ghost:hover { color: #cb4353; }

/* ── Overlay modal ────────────────────────────────────────── */
#ck-modal[hidden] { display: none !important; }

#ck-modal {
  position: fixed;
  inset: 0;
  z-index: 9950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ck-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(22,34,54,.5);
  backdrop-filter: blur(3px);
}

.ck-modal__panel {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(22,34,54,.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: ck-fade-in .22s ease;
}

@keyframes ck-fade-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ck-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #edf2f7;
}

.ck-modal__header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #162236;
  margin: 0;
}

.ck-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: #8c9aac;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background .12s;
}
.ck-modal__close:hover { background: #f0f4f8; }

/* ── Categorías ───────────────────────────────────────────── */
.ck-modal__body { padding: 8px 24px; }

.ck-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f4f8;
}
.ck-category:last-child { border-bottom: none; }

.ck-category__info {
  flex: 1;
  min-width: 0;
}

.ck-category__info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #162236;
  margin-bottom: 3px;
}

.ck-category__info span {
  font-size: 12px;
  color: #5f6f82;
  line-height: 1.5;
}

/* Badge "Siempre activas" */
.ck-badge {
  font-size: 11px;
  font-weight: 700;
  color: #3a8a5c;
  background: #e8f5ee;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Toggle switch ────────────────────────────────────────── */
.ck-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.ck-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ck-toggle__slider {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: #d8e2eb;
  transition: background .2s;
}

.ck-toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.ck-toggle input:checked + .ck-toggle__slider {
  background: #e04f5f;
}
.ck-toggle input:checked + .ck-toggle__slider::before {
  transform: translateX(20px);
}

.ck-toggle input:focus-visible + .ck-toggle__slider {
  outline: 3px solid rgba(224,79,95,.4);
}

/* ── Pie del modal ────────────────────────────────────────── */
.ck-modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 22px;
  border-top: 1px solid #edf2f7;
  flex-wrap: wrap;
}

/* ── Botón flotante "Gestionar cookies" ───────────────────── */
#ck-reopen-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9800;
  background: #ffffff;
  border: 1px solid #d8e2eb;
  color: #5f6f82;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(22,34,54,.1);
  transition: box-shadow .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
#ck-reopen-btn:hover { border-color: #e04f5f; color: #e04f5f; box-shadow: 0 4px 14px rgba(22,34,54,.15); }
#ck-reopen-btn[hidden] { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  #ck-banner { padding: 16px; }
  .ck-banner__actions { width: 100%; }
  .ck-btn { flex: 1; text-align: center; padding: 11px 12px; }
  .ck-modal__panel { border-radius: 14px; }
}
