/* Cookie Consent Banner Stylesheet - WCAG 2.1 AA Compliant */

/* Banner Container */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #182B49;
  color: #FFFFFF;
  padding: 16px 24px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 99999;
  font-family: inherit;
}
.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cookie-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  flex: 1 1 600px;
}
.cookie-link {
  color: #8FD8FF;
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.embed-consent-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #1A202C;
  padding: 16px;
  box-sizing: border-box;
}

.embed-consent-placeholder p {
  margin: 0;
  line-height: 1.5;
}

.embed-consent-placeholder .cookie-link {
  color: #005F66;
  text-decoration: underline;
}

.embed-consent-placeholder .cookie-link:focus {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}

/* Accessible Buttons */
.btn-cookie {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, outline 0.2s ease;
}
/* Use :focus for older browsers, :focus-visible for modern ones */
.btn-cookie:focus {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}
.btn-cookie:focus:not(:focus-visible) {
  outline: none;
}
.btn-cookie:focus-visible {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}
.btn-primary { background-color: #007680; color: #FFFFFF; }
.btn-primary:hover { background-color: #005F66; }
.btn-secondary { background-color: #E2E8F0; color: #1A202C; }
.btn-secondary:hover { background-color: #CBD5E1; }
.btn-outline { background-color: transparent; border-color: #FFFFFF; color: #FFFFFF; }
.btn-outline:hover { background-color: rgba(255,255,255,0.1); }

/* Modal Window */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
}
.cookie-modal-window {
  background: #FFFFFF;
  color: #1A202C;
  width: 100%;
  max-width: 580px;
  border-radius: 8px;
  padding: 24px;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 12px;
}
.cookie-modal-header h2 { margin: 0; font-size: 18px; color: #182B49; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #4A5568; }
/* Use :focus for older browsers, :focus-visible for modern ones */
.btn-close:focus {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}
.btn-close:focus:not(:focus-visible) {
  outline: none;
}
.btn-close:focus-visible {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}
.cookie-category {
  padding: 14px 0;
  border-bottom: 1px solid #EDF2F7;
}
.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cookie-category-desc { margin: 6px 0 0; font-size: 13px; color: #4A5568; line-height: 1.4; }
.badge-required {
  font-size: 11px;
  background: #E2E8F0;
  color: #2D3748;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}
.gpc-badge {
  background: #E6FFFA;
  color: #047481;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 10px;
}
.cookie-modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Toggle Switch Styling */
.cookie-toggle {
  position: relative;
  width: 44px !important;
  min-width: 44px !important;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: #CBD5E1;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.cookie-toggle:checked {
  background-color: #007680;
}
.cookie-toggle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.cookie-toggle:checked::before {
  transform: translateX(20px);
}
/* Use :focus-visible for modern browsers, fallback to :focus for older browsers */
.cookie-toggle:focus {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}
.cookie-toggle:focus:not(:focus-visible) {
  outline: none;
}
.cookie-toggle:focus-visible {
  outline: 3px solid #FFBF47;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .cookie-actions {
    width: 100%;
    flex-direction: column;
  }
  .btn-cookie {
    width: 100%;
    box-sizing: border-box;
  }
}
