/* Cookie Consent - Themeable via CSS variables */
:root {
  --cc-primary: #1a1a1a;
  --cc-bg: #ffffff;
  --cc-text: #333333;
  --cc-muted: #666666;
  --cc-border: #e0e0e0;
  --cc-btn-text: #ffffff;
  --cc-radius: 8px;
  --cc-font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cc-z: 99999;
}
/* Banner - floating centered pill */
#cc-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: var(--cc-z);
  width: calc(100% - 32px);
  max-width: 960px;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: 28px;
  box-shadow: 0 12px 36px rgba(20, 60, 130, 0.18), 0 4px 12px rgba(20, 60, 130, 0.08);
  font-family: var(--cc-font);
  font-size: 14px;
  color: var(--cc-text);
  transform: translate(-50%, calc(100% + 24px));
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}
#cc-banner.cc-visible {
  transform: translate(-50%, 0);
}
.cc-banner-inner {
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  position: relative;
}
.cc-banner-text {
  flex: 1;
  min-width: 240px;
}
.cc-banner-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--cc-primary);
}
.cc-banner-text p {
  margin: 0;
  line-height: 1.5;
  color: var(--cc-muted);
}
.cc-banner-text a {
  color: var(--cc-primary);
}
.cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* Buttons */
.cc-btn {
  padding: 9px 18px;
  border-radius: var(--cc-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity var(--dur-fast, 150ms), background var(--dur-fast, 150ms);
  font-family: var(--cc-font);
  white-space: nowrap;
}
.cc-btn:hover {
  opacity: 0.85;
}
.cc-btn-primary {
  background: linear-gradient(180deg, var(--cc-primary) 0%, #1557c0 100%);
  color: var(--cc-btn-text);
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.24);
}
.cc-btn-primary:hover {
  box-shadow: 0 12px 24px rgba(26, 115, 232, 0.30);
  opacity: 1;
}
.cc-btn-outline {
  background: transparent;
  color: var(--cc-primary);
  border: 1.5px solid var(--cc-primary);
}
.cc-btn-outline:hover {
  background: var(--cc-primary-light, rgba(26, 115, 232, 0.08));
  opacity: 1;
}
/* Language toggle - inline at end of actions */
.cc-lang-toggle {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--cc-muted);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--cc-font);
  /* WCAG 2.2 AA 2.5.8 Target Size: 24x24 minimum. */
  padding: 6px 10px;
  min-height: 24px;
  min-width: 24px;
  align-self: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.cc-lang-toggle:hover { color: var(--cc-primary); }
/* Modal overlay */
#cc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--cc-z) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#cc-modal-overlay.cc-visible {
  opacity: 1;
}
#cc-modal {
  background: var(--cc-bg);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(20, 60, 130, 0.22);
  font-family: var(--cc-font);
  color: var(--cc-text);
}
.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cc-border);
}
.cc-modal-header strong {
  font-size: 16px;
  color: var(--cc-primary);
}
#cc-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--cc-muted);
  line-height: 1;
  padding: 0 4px;
}
.cc-modal-body {
  padding: 8px 24px;
}
.cc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--cc-border);
}
/* Category rows */
.cc-category {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--cc-border);
}
.cc-category:last-child {
  border-bottom: none;
}
.cc-category-info {
  flex: 1;
}
.cc-category-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--cc-primary);
  margin-bottom: 4px;
}
.cc-category-desc {
  margin: 0;
  font-size: 13px;
  color: var(--cc-muted);
  line-height: 1.5;
}
.cc-category-control {
  flex-shrink: 0;
}
.cc-always-on {
  font-size: 12px;
  color: var(--cc-muted);
  font-style: italic;
}
/* Cookie detail list (optional) */
.cc-cookie-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.cc-cookie-list li {
  font-size: 11px;
  color: var(--cc-muted);
  line-height: 1.6;
}
.cc-cookie-name {
  font-family: monospace;
  font-weight: 600;
  color: var(--cc-text);
}
/* Toggle switch */
.cc-toggle {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--cc-border);
  border-radius: 24px;
  transition: background 0.2s;
}
.cc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cc-toggle input:checked + .cc-toggle-slider {
  background: var(--cc-primary);
}
.cc-toggle input:checked + .cc-toggle-slider::before {
  transform: translateX(20px);
}
/* Manage link (persistent) */
#cc-manage-link {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: var(--cc-z);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cc-bg);
  color: var(--cc-primary);
  border: 1px solid var(--cc-border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 60, 130, 0.10);
  transition: transform 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
  opacity: 0.85;
}
#cc-manage-link:hover {
  opacity: 1;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
  transform: scale(1.06);
}
@media (prefers-reduced-motion: reduce) {
  #cc-banner, #cc-modal-overlay, #cc-manage-link { transition: none; }
}
/* Mobile */
@media (max-width: 600px) {
  #cc-banner {
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    right: auto;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: min(62vh, 430px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    border-radius: 18px;
    transform: translateY(calc(100% + 24px));
  }
  #cc-banner.cc-visible {
    transform: translateY(0);
  }
  .cc-banner-inner {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px;
    gap: 10px;
    overflow: hidden;
  }
  .cc-banner-text {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .cc-banner-text p {
    width: 100%;
    max-width: 100%;
    line-height: 1.42;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .cc-banner-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cc-btn {
    width: 100%;
    min-height: 42px;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
  }
  .cc-btn-primary { grid-column: 1 / -1; }
  .cc-lang-toggle {
    grid-column: 1 / -1;
    align-self: center;
    justify-self: center;
    margin-top: 0;
    padding: 3px 10px;
  }
}