/* Cookie Consent banner + modal — Phase 7b
   Brand-aligned with main site (--teal #0f5fb2, --charcoal #0a1228) */

/* CRITICAL: explicit [hidden] override.
   .bh-cookie-modal uses `display: flex` and .bh-cookie-banner can be styled too —
   user-agent `display: none` from the [hidden] attribute is otherwise overridden,
   leaving an invisible full-viewport overlay that traps clicks. */
.bh-cookie-banner[hidden],
.bh-cookie-modal[hidden] { display: none !important; }

/* ========== BANNER (fixed bottom, slide-up) ========== */
.bh-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #ffffff;
  color: #0a1228;
  border-top: 1px solid #d6dde7;
  box-shadow: 0 -8px 32px -12px rgba(10, 18, 40, 0.18);
  transform: translateY(100%);
  transition: transform .24s ease-out;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.bh-cookie-banner.is-open { transform: translateY(0); }

.bh-cc-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.bh-cc-text { flex: 1 1 480px; min-width: 0; }
.bh-cc-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0a1228;
  margin-bottom: 4px;
}
.bh-cc-text p { margin: 0; color: #3a4356; }
.bh-cc-text a {
  color: #0f5fb2;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.bh-cc-text a:hover { color: #0a4a8c; }

.bh-cc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ========== BUTTONS ========== */
.bh-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.bh-cc-btn:active { transform: translateY(1px); }
.bh-cc-btn:focus-visible {
  outline: 2px solid #0f5fb2;
  outline-offset: 2px;
}

.bh-cc-btn--primary {
  background: #0f5fb2;
  color: #ffffff;
  border-color: #0f5fb2;
}
.bh-cc-btn--primary:hover { background: #0a4a8c; border-color: #0a4a8c; }

.bh-cc-btn--ghost {
  background: transparent;
  color: #0a1228;
  border-color: #d6dde7;
}
.bh-cc-btn--ghost:hover {
  background: #f7f9fc;
  border-color: #b8c2d1;
}

/* ========== MODAL ========== */
.bh-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  opacity: 0;
  transition: opacity .2s ease-out;
}
.bh-cookie-modal.is-open { opacity: 1; }

.bh-cc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 40, 0.55);
  backdrop-filter: blur(2px);
}

.bh-cc-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 80px -16px rgba(10, 18, 40, 0.42);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 32px;
  color: #0a1228;
}

.bh-cc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #5a6478;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.bh-cc-modal-close:hover {
  background: #f0f3f8;
  color: #0a1228;
}

.bh-cc-modal-card h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  color: #0a1228;
}
.bh-cc-modal-intro {
  margin: 0 0 22px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #3a4356;
}

/* ========== CATEGORIES ========== */
.bh-cc-cats {
  list-style: none;
  margin: 0 0 22px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bh-cc-cat {
  background: #f7f9fc;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 14px 16px;
}
.bh-cc-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.bh-cc-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: #0a1228;
}
.bh-cc-cat-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #5a6478;
}
.bh-cc-cat-state {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #0a8a4e;
  padding: 4px 10px;
  background: #e6f4ec;
  border-radius: 999px;
}

/* ========== TOGGLE ========== */
.bh-cc-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.bh-cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.bh-cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: #c7cfdb;
  border-radius: 999px;
  transition: background .2s;
}
.bh-cc-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(10, 18, 40, 0.2);
}
.bh-cc-toggle input:checked ~ .bh-cc-toggle-slider { background: #0f5fb2; }
.bh-cc-toggle input:checked ~ .bh-cc-toggle-slider::before { transform: translateX(18px); }
.bh-cc-toggle input:focus-visible ~ .bh-cc-toggle-slider {
  box-shadow: 0 0 0 3px rgba(15, 95, 178, 0.3);
}

.bh-cc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== FOOTER MANAGE LINK ========== */
.bh-cc-manage-link {
  cursor: pointer;
}

/* ========== MOBILE ========== */
@media (max-width: 720px) {
  .bh-cc-inner { padding: 16px 18px; gap: 16px; }
  .bh-cc-actions { width: 100%; }
  .bh-cc-btn { flex: 1 1 calc(50% - 5px); padding: 12px 14px; font-size: 13px; }
  .bh-cc-btn--primary { flex-basis: 100%; order: -1; }
  .bh-cc-modal-card { padding: 22px 20px; border-radius: 10px; }
  .bh-cc-modal-card h2 { font-size: 19px; }
  .bh-cc-modal-actions { width: 100%; }
  .bh-cc-modal-actions .bh-cc-btn { flex: 1 1 calc(50% - 5px); }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  .bh-cookie-banner,
  .bh-cookie-modal,
  .bh-cc-toggle-slider,
  .bh-cc-toggle-slider::before,
  .bh-cc-btn { transition: none; }
}
