/* Avalon Cookie banner - Avalon - Ribera (https://avalonsnc.com) - Apache License 2.0
   Every class starts with "avalon-cb-": no clash with the theme. No Bootstrap, no jQuery. */

#avalon-cb-root {
  --avalon-cb-primary: #1d4ed8;
  --avalon-cb-on-primary: #ffffff;
  --avalon-cb-text: #1f2937;
  --avalon-cb-muted: #4b5563;
  --avalon-cb-bg: #ffffff;
  --avalon-cb-line: #d1d5db;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--avalon-cb-text);
}

#avalon-cb-root *,
#avalon-cb-root *::before,
#avalon-cb-root *::after {
  box-sizing: border-box;
}

#avalon-cb-root [hidden] {
  display: none !important;
}

/* ---------- banner ---------- */
.avalon-cb-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
  background: var(--avalon-cb-bg);
  color: var(--avalon-cb-text);
  border: 1px solid var(--avalon-cb-line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  z-index: 2147483000;
}

.avalon-cb-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--avalon-cb-text);
}

.avalon-cb-text {
  margin: 0 0 14px;
  color: var(--avalon-cb-muted);
}

.avalon-cb-link {
  color: var(--avalon-cb-primary);
  text-decoration: underline;
  white-space: nowrap;
}

/* ---------- the three buttons look exactly the same ---------- */
.avalon-cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avalon-cb-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--avalon-cb-primary);
  border-radius: 8px;
  background: var(--avalon-cb-primary);
  color: var(--avalon-cb-on-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.avalon-cb-btn:hover {
  filter: brightness(1.1);
}

.avalon-cb-btn:focus-visible,
.avalon-cb-close:focus-visible,
.avalon-cb-floating:focus-visible,
.avalon-cb-switch:focus-visible,
.avalon-cb-details summary:focus-visible,
.avalon-cb-link:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* ---------- preferences panel ---------- */
.avalon-cb-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2147483001;
}

.avalon-cb-panel {
  width: 100%;
  max-width: 660px;
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  background: var(--avalon-cb-bg);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.avalon-cb-panel:focus {
  outline: none;
}

.avalon-cb-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.avalon-cb-close {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--avalon-cb-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.avalon-cb-categories {
  margin: 0 0 18px;
}

.avalon-cb-category {
  padding: 14px 0;
  border-top: 1px solid var(--avalon-cb-line);
}

.avalon-cb-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avalon-cb-category__label {
  font-weight: 700;
  cursor: pointer;
}

.avalon-cb-category__desc {
  margin: 6px 0 0;
  color: var(--avalon-cb-muted);
}

.avalon-cb-always {
  color: var(--avalon-cb-muted);
  font-size: 13px;
  font-weight: 600;
}

.avalon-cb-details {
  margin-top: 8px;
  font-size: 14px;
}

.avalon-cb-details summary {
  cursor: pointer;
  color: var(--avalon-cb-primary);
}

.avalon-cb-service {
  margin: 8px 0 0;
  color: var(--avalon-cb-muted);
  overflow-wrap: anywhere;
}

/* ---------- switch ---------- */
.avalon-cb-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 14px;
  background: #9ca3af;
  cursor: pointer;
  transition: background 0.15s;
}

.avalon-cb-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s;
}

.avalon-cb-switch:checked {
  background: var(--avalon-cb-primary);
}

.avalon-cb-switch:checked::after {
  transform: translateX(20px);
}

/* ---------- floating button and blocked content ---------- */
.avalon-cb-floating {
  position: fixed;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--avalon-cb-primary);
  border-radius: 50%;
  background: var(--avalon-cb-bg);
  color: var(--avalon-cb-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 2147482999;
}

.avalon-cb-floating:hover {
  background: var(--avalon-cb-primary);
  color: var(--avalon-cb-on-primary);
}

.avalon-cb-floating svg {
  display: block;
  pointer-events: none;
}

.avalon-cb-placeholder {
  max-width: 560px;
  margin: 8px 0;
  padding: 16px;
  border: 1px dashed var(--avalon-cb-line, #d1d5db);
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
}

.avalon-cb-placeholder p {
  margin: 0 0 10px;
}

.avalon-cb-placeholder .avalon-cb-btn {
  flex: none;
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

@media (max-width: 520px) {
  .avalon-cb-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 16px;
  }

  .avalon-cb-btn {
    flex-basis: 100%;
  }
}
