/**
 * Bin Bin Ink Cookie Consent Banner Styles
 */

/* Banner */
.bbi-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  justify-content: center;
  padding: 0 16px 16px;
  pointer-events: none;
}

.bbi-consent-banner[hidden] {
  display: none;
}

.bbi-consent-content {
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 1100px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  display: flex;
  gap: 12px 16px;
  align-items: center;
  flex-wrap: wrap;
}

.bbi-consent-text {
  flex: 1 1 400px;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  line-height: 1.5;
}

.bbi-consent-privacy-link {
  color: #8fd19e;
  font-weight: 700;
  text-decoration: underline;
}

.bbi-consent-privacy-link:hover {
  color: #7bc189;
}

.bbi-consent-buttons {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bbi-consent-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.bbi-consent-btn:focus {
  outline: 2px solid #8fd19e;
  outline-offset: 2px;
}

.bbi-consent-btn-decline {
  background: #fff;
  color: #111827;
}

.bbi-consent-btn-decline:hover {
  background: #f3f4f6;
}

.bbi-consent-btn-accept {
  background: #39b54a;
  color: #111827; /* 3.0.185: 6.66:1 on brand green (white was 2.66:1) */
}

.bbi-consent-btn-accept:hover {
  background: #4cc75c;
  color: #111827;
}

.bbi-consent-btn-choices {
  background: transparent;
  color: #fff;
  border: 2px solid #9ca3af;
}

.bbi-consent-btn-choices:hover {
  border-color: #d1d5db;
}

/* Mobile styles */
@media (max-width: 600px) {
  .bbi-consent-banner {
    padding: 0 8px 8px;
  }
  
  .bbi-consent-content {
    padding: 16px 20px;
  }
  
  .bbi-consent-text {
    flex: 1 1 100%;
    font-size: 14px;
  }
  
  .bbi-consent-buttons {
    width: 100%;
    gap: 8px;
  }
  
  .bbi-consent-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* Dialog */
.bbi-consent-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bbi-consent-dialog[hidden] {
  display: none;
}

.bbi-consent-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.bbi-consent-dialog-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.bbi-consent-dialog-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bbi-consent-dialog-header h2 {
  margin: 0;
  font-size: 20px;
  color: #111827;
}

.bbi-consent-dialog-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #374151;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.bbi-consent-dialog-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.bbi-consent-dialog-close:focus {
  outline: 2px solid #8fd19e;
  outline-offset: 2px;
}

.bbi-consent-dialog-body {
  padding: 24px;
}

.bbi-consent-gpc-notice {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.bbi-consent-gpc-notice[hidden] {
  display: none;
}

.bbi-consent-gpc-notice p {
  margin: 0;
  font-size: 14px;
  color: #1e40af;
  line-height: 1.5;
}

.bbi-consent-category {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.bbi-consent-category:last-child {
  border-bottom: none;
}

.bbi-consent-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bbi-consent-category-header strong {
  font-size: 16px;
  color: #111827;
}

.bbi-consent-always-on {
  background: #e5e7eb;
  color: #374151; /* 3.0.185: 8.33:1 (was #6b7280, 3.9:1) */
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.bbi-consent-category-desc {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* Toggle switch */
.bbi-consent-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

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

.bbi-consent-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #6b7280; /* 3.0.185: off track 4.83:1 vs white, knob 4.83:1 vs track (was #d1d5db, 1.47:1) */
  border-radius: 12px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.bbi-consent-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.bbi-consent-toggle-input:checked + .bbi-consent-toggle-slider {
  background: #15803d; /* 3.0.185: deep Bin Bin Ink green, 5.02:1 vs white and vs the knob */
}

.bbi-consent-toggle-input:checked + .bbi-consent-toggle-slider::before {
  transform: translateX(20px);
}

.bbi-consent-toggle-input:focus + .bbi-consent-toggle-slider {
  outline: 2px solid #8fd19e;
  outline-offset: 2px;
}

.bbi-consent-dialog-footer {
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}

.bbi-consent-btn-save {
  background: #39b54a;
  color: #111827; /* 3.0.185: 6.66:1 */
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.bbi-consent-btn-save:hover {
  background: #4cc75c;
}

.bbi-consent-btn-save:focus {
  outline: 2px solid #8fd19e;
  outline-offset: 2px;
}

/* Footer privacy link */
.bbi-privacy-footer-link {
  text-align: center;
  padding: 12px;
  background: #111;
}

.bbi-privacy-choices-link {
  color: #d1d5db;
  text-decoration: underline;
  font-size: 14px;
  /* 3.0.185: rendered as a <button>; look like the link it was */
  background: none;
  border: 0;
  padding: 4px 2px;
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.bbi-privacy-choices-link:hover {
  color: #fff;
}

.bbi-privacy-choices-link:focus {
  outline: 2px solid #8fd19e;
  outline-offset: 2px;
}

/* Mobile dialog */
@media (max-width: 600px) {
  .bbi-consent-dialog {
    padding: 10px;
  }
  
  .bbi-consent-dialog-content {
    max-height: 95vh;
  }
  
  .bbi-consent-dialog-header,
  .bbi-consent-dialog-body,
  .bbi-consent-dialog-footer {
    padding: 16px 20px;
  }
}


/* ==========================================================================
   3.0.185 accessibility (WCAG 2.1 AA). Ratios measured on the box.
   ========================================================================== */

.bbi-consent-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bbi-consent-ext-icon {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.2em;
  vertical-align: baseline;
}

/* Focus on the dark banner: light green ring, 9.95:1 vs #111827 (theme focus rules overridden). */
#bbi-consent-banner .bbi-consent-btn:focus-visible,
#bbi-consent-banner .bbi-consent-privacy-link:focus-visible {
  outline: 3px solid #8fd19e;
  outline-offset: 2px;
  box-shadow: none;
}

/* Focus in the white dialog: deep green ring, 7.13:1 vs white (was #8fd19e, 1.78:1). */
#bbi-consent-dialog .bbi-consent-dialog-close:focus,
#bbi-consent-dialog .bbi-consent-btn-save:focus,
#bbi-consent-dialog .bbi-consent-toggle-input:focus + .bbi-consent-toggle-slider {
  outline: 3px solid #166534;
  outline-offset: 2px;
  box-shadow: none;
}
#bbi-consent-dialog .bbi-consent-dialog-close:focus:not(:focus-visible),
#bbi-consent-dialog .bbi-consent-btn-save:focus:not(:focus-visible),
#bbi-consent-dialog .bbi-consent-toggle-input:focus:not(:focus-visible) + .bbi-consent-toggle-slider {
  outline: none;
}
/* The real checkbox is visually hidden; the ring is drawn on the switch. */
#bbi-consent-dialog .bbi-consent-toggle-input {
  outline: none !important;
}

/* Visible On / Off next to each switch (state is not shown by position/colour alone). */
.bbi-consent-toggle-state {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  min-width: 2.5em;
  text-align: right;
}

/* Footer "Your Privacy Choices" button focus (dark footer). */
.bbi-privacy-choices-link:focus-visible {
  outline: 3px solid #8fd19e;
  outline-offset: 2px;
}

/* Saved-choice status: receives focus after Accept / Decline / Save so keyboard users keep their place. */
.bbi-consent-saved {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 999999;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  background: #111827;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.bbi-consent-saved[hidden] {
  display: none;
}
.bbi-consent-saved:focus {
  outline: 3px solid #8fd19e;
  outline-offset: -6px; /* ring sits inside the dark message: 9.95:1, whatever the page colour behind */
}

/* Reflow (1.4.10): never taller than the screen; scroll inside if it would be (400% zoom on 1280x800). */
#bbi-consent-banner .bbi-consent-content {
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  box-sizing: border-box;
}
@supports (max-height: 100dvh) {
  #bbi-consent-banner .bbi-consent-content {
    max-height: calc(100dvh - 16px);
  }
}
@media (max-height: 420px) {
  body #bbi-consent-banner .bbi-consent-content {
    padding: 8px 12px !important;
    gap: 6px 12px !important;
  }
  body #bbi-consent-banner .bbi-consent-text {
    font-size: 13px;
    line-height: 1.4;
  }
  body #bbi-consent-banner .bbi-consent-btn {
    min-height: 36px;
    padding: 6px 12px;
  }
}

/* Phones / zoom: page content can always scroll clear of the banner, and keyboard focus scrolls above
   it (2.4.11). --bbi-consent-h is the measured banner height, set by consent-banner.js. */
html.bbi-consent-open {
  scroll-padding-bottom: var(--bbi-consent-h, 0px);
}
html.bbi-consent-open body {
  padding-bottom: var(--bbi-consent-h, 0px);
}
@media (max-width: 600px) {
  body #bbi-consent-banner .bbi-consent-content {
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  body #bbi-consent-banner .bbi-consent-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bbi-consent-btn,
  .bbi-consent-btn-save,
  .bbi-consent-toggle-slider,
  .bbi-consent-toggle-slider::before,
  .bbi-consent-privacy-link,
  .bbi-privacy-choices-link {
    transition: none !important;
  }
}

/* ==========================================================================
   Bin Bin Ink theme (bbi-site 1.2.0): dark + teal. Contrast checked:
   #f4f4f5 on #0f1113 18:1 · #d4d4d8 on #101014 13:1 · #09090b on #2dd4bf 11:1
   · #5eead4 on #0f1113 13:1 · toggle on #0f766e vs #fff knob 5.5:1
   ========================================================================== */
.bbi-consent-banner{background:#0f1113!important;color:#f4f4f5!important;border:1px solid rgba(45,212,191,.45)!important;box-shadow:0 0 0 1px rgba(255,255,255,.03),0 18px 50px rgba(0,0,0,.55),0 0 40px rgba(45,212,191,.15)!important;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;border-radius:18px}
.bbi-consent-text,.bbi-consent-text p{color:#e4e4e7}
.bbi-consent-privacy-link,.bbi-consent-privacy-link:hover{color:#5eead4}
.bbi-consent-btn{border-radius:999px;min-height:44px;font-family:inherit}
.bbi-consent-btn-accept,.bbi-consent-btn-save{background:#2dd4bf!important;color:#09090b!important;border:0}
.bbi-consent-btn-accept:hover,.bbi-consent-btn-save:hover{background:#5eead4!important}
.bbi-consent-btn-decline{background:#fafafa;color:#09090b}
.bbi-consent-btn-decline:hover{background:#e4e4e7}
.bbi-consent-btn-choices{background:transparent;color:#fafafa;border:2px solid rgba(255,255,255,.35)}
.bbi-consent-btn-choices:hover{border-color:#5eead4}
.bbi-consent-dialog-content{background:#101014!important;color:#e4e4e7;border:1px solid rgba(45,212,191,.35);border-radius:18px;font-family:Inter,system-ui,sans-serif}
.bbi-consent-dialog-header,.bbi-consent-category,.bbi-consent-dialog-footer{border-color:rgba(255,255,255,.1)!important}
.bbi-consent-dialog-header h2,.bbi-consent-category-header strong{color:#fafafa!important}
.bbi-consent-dialog-close,.bbi-consent-toggle-state{color:#d4d4d8!important}
.bbi-consent-dialog-close:hover{background:rgba(255,255,255,.08)!important;color:#fff!important}
.bbi-consent-category-desc{color:#b4b4bb!important}
.bbi-consent-always-on{background:rgba(45,212,191,.14)!important;color:#99f6e4!important}
.bbi-consent-gpc-notice{background:rgba(45,212,191,.08)!important;border-color:rgba(45,212,191,.4)!important}
.bbi-consent-gpc-notice p{color:#ccfbf1!important}
.bbi-consent-toggle-slider{background:#71717a!important}
.bbi-consent-toggle-input:checked + .bbi-consent-toggle-slider{background:#0f766e!important}
.bbi-consent-banner :focus-visible,.bbi-consent-dialog :focus-visible,.bbi-consent-dialog-content :focus,.bbi-consent-toggle-input:focus + .bbi-consent-toggle-slider{outline:3px solid #5eead4!important;outline-offset:2px}
.bbi-consent-saved{background:#0f1113!important;color:#f4f4f5!important;border:1px solid rgba(45,212,191,.45)}
