/* ==========================================================================
   Cookie consent banner + preferences panel
   Colors follow the site owner's configured banner theme (sage green /
   teal accent), not the generic design system tokens - with the text
   colors darkened/lightened to meet WCAG AA contrast.
   ========================================================================== */

:root {
  --cookie-bg: #e8efda;
  --cookie-text: #4f6b4f;
  --cookie-accept-bg: #037b75;
  --cookie-accept-text: #ffffff;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  width: auto;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  background: var(--cookie-bg);
  padding: 18px 30px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

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

.cookie-banner__inner {
  max-width: 1400px;
  margin: 0 auto;
}

.cookie-banner__header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}

.cookie-banner__title {
  text-align: center;
}

.cookie-banner__header .cookie-banner__close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.cookie-banner__title {
  font-weight: 700;
  color: var(--color-heading);
}

.cookie-banner__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cookie-text);
  padding: 4px;
}

.cookie-banner__close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.cookie-banner__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__message {
  flex: 1 1 320px;
  margin: 0;
  font-size: 12px;
  color: var(--cookie-text);
}

.cookie-banner__categories {
  margin-bottom: 15px;
}

.cookie-banner__category {
  border-top: 1px solid rgba(141, 178, 141, 0.3);
  padding: 10px 0;
}

.cookie-banner__category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-heading);
}

.cookie-banner__category summary::-webkit-details-marker {
  display: none;
}

.cookie-banner__category-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-banner__always-on {
  font-size: 11px;
  text-transform: uppercase;
  color: green;
}

.cookie-banner__description {
  font-size: 12px;
  padding-top: 8px;
  color: var(--cookie-text);
}

.cookie-banner__buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  flex: 0 0 auto;
}

.cookie-banner__buttons .button {
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--cookie-text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
}

.cookie-banner__buttons .button--primary,
.cookie-banner__buttons .cookie-banner__save-preferences {
  background-color: var(--cookie-accept-bg);
  color: var(--cookie-accept-text);
}

.cookie-banner__buttons .button:hover {
  opacity: 0.85;
}

.cookie-banner__links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cookie-banner__links a {
  font-size: 11px;
  color: var(--cookie-text);
  text-decoration: underline;
}

.cookie-banner__manage-reopen {
  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 500;
  background: var(--cookie-accept-bg);
  color: var(--cookie-accept-text);
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-banner__manage-reopen[hidden] {
  display: none;
}

@media only screen and (max-width: 560px) {
  .cookie-banner {
    padding: 16px 18px;
  }

  .cookie-banner__buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .cookie-banner__buttons .button {
    width: 100%;
    text-align: center;
  }
}
