/* Cookie consent banner + preferences panel.
 * Loaded from _partials/consent-head.html on every page.
 * Brand: navy #0C374D, teal #4FA6C0, Inter (inherited from the page). */

#embrava-consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 999998; /* below the chat widget's 999999 so the launcher sits on top of the bar */
  background: #0C374D;
  color: #fff;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 -4px 16px rgba(12, 55, 77, 0.25);
  font-size: 14px;
  line-height: 1.55;
}
#embrava-consent-banner p { margin: 0; flex: 1; }
#embrava-consent-banner a { color: #9FD3E4; font-weight: 600; text-decoration: underline; }

.ecb-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* Accept all and Reject all MUST be visually identical (spec hard requirement). */
.ecb-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 7px; border: 0; cursor: pointer;
  background: #4FA6C0; color: #0C374D;
}
.ecb-btn:hover { background: #5FB3CC; }
.ecb-link {
  font: inherit; font-size: 13px; font-weight: 600;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.85); text-decoration: underline; padding: 6px 2px;
}
.ecb-btn:focus-visible, .ecb-link:focus-visible, .ecp-toggle:focus-visible {
  outline: 2px solid #4FA6C0; outline-offset: 2px;
}

/* Wide screens: reserve a right gutter so banner content never sits under
 * the chat launcher; the launcher stays in its corner ON TOP of the bar. */
@media (min-width: 901px) {
  #embrava-consent-banner { padding-right: 96px; }
}

/* Narrow screens: banner needs the full width, so lift the launcher above it.
 * --embrava-banner-height is measured by consent.js (re-measured on resize).
 * Graceful degradation: if cindybot renames .chatbot-widget the launcher is
 * merely overlapped again. */
@media (max-width: 900px) {
  #embrava-consent-banner { flex-direction: column; align-items: stretch; gap: 12px; }
  .ecb-actions .ecb-btn { flex: 1; }
  body.embrava-banner-open .chatbot-widget {
    bottom: calc(20px + var(--embrava-banner-height, 180px)) !important;
  }
}

/* Preferences panel */
#embrava-consent-overlay {
  position: fixed; inset: 0;
  z-index: 2147483600; /* above the widget: the modal covers chat while open */
  background: rgba(12, 55, 77, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
#embrava-consent-panel {
  background: #fff; color: #1E2B33;
  border-radius: 12px; width: 100%; max-width: 460px;
  box-shadow: 0 12px 40px rgba(12, 55, 77, 0.35);
  font-size: 14px; line-height: 1.5;
}
#embrava-consent-panel h2 {
  margin: 0; padding: 18px 22px 12px;
  font-size: 17px; font-weight: 700; color: #0C374D;
}
.ecp-cat {
  padding: 14px 22px;
  border-top: 1px solid #DCE3E6;
  display: flex; gap: 16px; align-items: flex-start;
}
.ecp-cat > div { flex: 1; }
.ecp-cat h3 { margin: 0 0 3px; font-size: 14px; font-weight: 700; }
.ecp-cat p { margin: 0; font-size: 12.5px; color: #5A6B74; }
.ecp-always {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #3E8CA3; padding-top: 4px; white-space: nowrap;
}
.ecp-toggle {
  flex-shrink: 0; width: 44px; height: 24px; border-radius: 999px; border: 0;
  cursor: pointer; background: #C4CED3; position: relative; margin-top: 2px;
  transition: background 0.15s;
}
.ecp-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left 0.15s;
}
.ecp-toggle[aria-checked="true"] { background: #4FA6C0; }
.ecp-toggle[aria-checked="true"]::after { left: 23px; }
.ecp-actions {
  display: flex; gap: 10px; padding: 16px 22px 20px;
  border-top: 1px solid #DCE3E6; flex-wrap: wrap;
}
/* In the panel, Save preferences is primary; Accept/Reject are equal secondaries. */
.ecp-secondary { background: #fff; color: #0C374D; border: 1.5px solid #DCE3E6; }
.ecp-secondary:hover { background: #F1F3F4; border-color: #4FA6C0; }
.ecp-save { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .ecp-toggle, .ecp-toggle::after, .chatbot-widget { transition: none !important; }
}
