/* ──────────────────────────────────────────────────────────────────────────
   Cookie consent banner + preferences panel.
   Markup is injected at runtime by static/js/consent.js. Visuals follow the
   site tokens defined in styles.css (--blue, --border, --shadow-md, etc.).
   ────────────────────────────────────────────────────────────────────────── */

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

/* ── Bottom banner ─────────────────────────────────────────────────────── */
.hk-cc {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 2147483000;
  max-width: 1120px;
  margin: 0 auto;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius-lg, 10px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.08));
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: inherit;
  animation: hk-cc-in 0.32s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes hk-cc-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hk-cc__text { flex: 1 1 320px; min-width: 0; }
.hk-cc__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1A2332);
}
.hk-cc__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-body, #4B5563);
}
.hk-cc__body a { color: var(--blue, #2563EB); text-decoration: underline; }

.hk-cc__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* Tighter sizing for the banner buttons; reuses .btn / .btn-primary / .btn-outline */
.hk-cc__btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* ── Preferences panel ─────────────────────────────────────────────────── */
.hk-cc-panel {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hk-cc-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  animation: hk-cc-fade 0.2s ease both;
}
@keyframes hk-cc-fade { from { opacity: 0; } to { opacity: 1; } }
.hk-cc-panel__box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-white, #fff);
  border-radius: var(--radius-lg, 10px);
  box-shadow: var(--shadow-lg, 0 36px 72px rgba(0,0,0,0.08));
  padding: 28px;
  animation: hk-cc-in 0.28s cubic-bezier(0.4,0,0.2,1) both;
}
.hk-cc-panel__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  font-size: 1.5rem; line-height: 1;
  color: var(--text-muted, #9CA3AF);
  cursor: pointer; border-radius: 6px;
}
.hk-cc-panel__close:hover { background: rgba(0,0,0,0.05); color: var(--text-primary, #1A2332); }
.hk-cc-panel__box h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1A2332);
}
.hk-cc-panel__intro {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-body, #4B5563);
}
.hk-cc-panel__intro a { color: var(--blue, #2563EB); text-decoration: underline; }

.hk-cc-cat {
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius, 8px);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.hk-cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.hk-cc-cat__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1A2332);
}
.hk-cc-cat__always {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green, #059669);
  white-space: nowrap;
}
.hk-cc-cat__desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-body, #4B5563);
}

/* Toggle switch */
.hk-cc-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.hk-cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.hk-cc-switch__ui {
  position: absolute; inset: 0; cursor: pointer;
  background: #CBD5E1; border-radius: 999px;
  transition: var(--transition, 0.22s ease);
}
.hk-cc-switch__ui::before {
  content: ""; position: absolute;
  height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: var(--transition, 0.22s ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.hk-cc-switch input:checked + .hk-cc-switch__ui { background: var(--blue, #2563EB); }
.hk-cc-switch input:checked + .hk-cc-switch__ui::before { transform: translateX(18px); }
.hk-cc-switch input:focus-visible + .hk-cc-switch__ui { outline: 2px solid var(--blue, #2563EB); outline-offset: 2px; }
.hk-cc-switch input:disabled + .hk-cc-switch__ui { opacity: 0.55; cursor: not-allowed; }

.hk-cc-panel__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.hk-cc-panel__actions .btn { flex: 1; justify-content: center; }

/* Footer "Cookie settings" trigger — looks like the adjacent footer links */
.footer-cc-btn {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; cursor: pointer; color: inherit;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hk-cc { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .hk-cc__actions { flex-direction: column; }
  .hk-cc__actions .hk-cc__btn { width: 100%; justify-content: center; }
  .hk-cc-panel__box { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .hk-cc, .hk-cc-panel__box, .hk-cc-panel__backdrop { animation: none; }
}
