/* Avtec cookie banner + preference centre.
   All three choices share one button style so they have equal visibility and prominence
   (Technical Requirement 2). Colours meet WCAG AA contrast (Technical Requirement 7). */

:root {
  --cc-red: #c4161c;          /* darker than brand #eb262d so 14px text passes 4.5:1 on white */
  --cc-text: #222;
  --cc-muted: #4a4b4d;
  --cc-bg: #fff;
  --cc-border: #d6d6d6;
  --cc-focus: #0b57d0;
}

.cc-banner[hidden], .cc-modal[hidden] { display: none !important; }

/* ---------- First layer: banner ---------- */
.cc-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100000;
  background: var(--cc-bg);
  color: var(--cc-text);
  border-top: 4px solid var(--cc-red);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  font-family: "Locator", helvetica, arial, sans-serif;
  max-height: 85vh;
  overflow-y: auto;
}
.cc-banner:focus { outline: none; }
.cc-banner__inner {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 48px 16px 16px;
}
.cc-banner__title, .cc-modal__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--cc-text);
}
.cc-banner__text, .cc-modal__text {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--cc-text);
}

/* ---------- Buttons (identical for every choice) ---------- */
.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.cc-btn {
  flex: 0 1 auto;
  min-width: 190px;
  min-height: 44px;                 /* touch target size */
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cc-red);
  background: var(--cc-bg);
  border: 2px solid var(--cc-red);
  border-radius: 0;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.cc-btn:hover { background: var(--cc-red); color: #fff; }

.cc-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 40px; height: 40px;
  font-size: 28px;
  line-height: 1;
  color: var(--cc-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.cc-close:hover { color: var(--cc-text); }

.cc-links { font-size: 13px; margin: 0; color: var(--cc-muted); }
.cc-banner a, .cc-modal a, .cc-embed-placeholder a { color: var(--cc-red); text-decoration: underline; }

.cc-btn:focus-visible, .cc-close:focus-visible, .cc-banner a:focus-visible, .cc-modal a:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track, .cc-modal__dialog:focus-visible, .cc-settings-link:focus-visible {
  outline: 3px solid var(--cc-focus);
  outline-offset: 2px;
}

/* ---------- Second layer: preference centre ---------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cc-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.cc-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border-top: 4px solid var(--cc-red);
  padding: 24px 24px 18px;
  font-family: "Locator", helvetica, arial, sans-serif;
}
.cc-modal-open, .cc-modal-open body { overflow: hidden; }

.cc-cats { list-style: none; margin: 0 0 16px; padding: 0; }
.cc-cat { border-top: 1px solid var(--cc-border); padding: 12px 0; }
.cc-cat:last-child { border-bottom: 1px solid var(--cc-border); }
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-cat__label { font-weight: 600; font-size: 15px; }
.cc-cat__always { font-size: 12px; font-weight: 600; color: var(--cc-muted); white-space: nowrap; }
.cc-cat__desc { font-size: 13px; line-height: 1.5; color: var(--cc-muted); margin: 6px 0 0; }

/* Toggle switch built on a real checkbox, so keyboard and screen readers work natively */
.cc-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  margin: 0;
  cursor: pointer;
}
.cc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cc-switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 46px; height: 26px;
  border-radius: 13px;
  background: #8a8b8d;
  transition: background 150ms;
}
.cc-switch__track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms;
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-red); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:disabled + .cc-switch__track { opacity: .55; }
.cc-switch input:disabled ~ * , .cc-switch:has(input:disabled) { cursor: not-allowed; }

.cc-status { font-size: 13px; margin: 8px 0 0; min-height: 1em; }

/* ---------- Placeholder for blocked embeds (map, video) ---------- */
.cc-embed-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 260px;
  padding: 24px;
  text-align: center;
  background: #ececed;
  color: var(--cc-text);
  font-size: 14px;
}
.cc-embed-placeholder p { max-width: 520px; margin: 0; }

/* ---------- Footer "Cookie Settings" link ---------- */
.cc-settings-link {
  padding: 1px;
  font: inherit;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}
.cc-settings-link:hover { text-decoration: underline; }

/* ---------- Cookie Policy / Privacy Policy pages ---------- */
.cc-policy { color: var(--cc-text); line-height: 1.65; font-size: 15px; }
.cc-policy h2 { font-size: 20px; font-weight: 600; margin: 32px 0 10px; color: var(--cc-text); }
.cc-policy__meta { color: var(--cc-muted); font-size: 13px; }
.cc-policy a { color: var(--cc-red); text-decoration: underline; }
.cc-policy address { font-style: normal; }
.cc-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.cc-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; background: #fff; }
.cc-table th, .cc-table td { border: 1px solid var(--cc-border); padding: 8px 10px; text-align: left; vertical-align: top; }
.cc-table th { background: #f3f3f3; font-weight: 600; }
.cc-inline-link {
  padding: 0;
  font: inherit;
  color: var(--cc-red);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}
.cc-inline-link:focus-visible { outline: 3px solid var(--cc-focus); outline-offset: 2px; }

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
  .cc-banner__inner { padding: 16px 44px 12px 16px; }
  .cc-banner__title, .cc-modal__title { font-size: 18px; }
  .cc-actions { flex-direction: column; }
  .cc-btn { width: 100%; min-width: 0; }
  .cc-modal { padding: 0; align-items: flex-end; }
  .cc-modal__dialog { max-height: 100vh; padding: 20px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn, .cc-switch__track, .cc-switch__track::after { transition: none; }
}
