/**
 * EU GDPR cookie consent banner – matches site theme, light/dark aware
 */

#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 20px 24px;
  font-family: var(--font_bai, "Bai Jamjuree", sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.48px;
  color: var(--secondary);
  background-color: var(--white);
  border-top: 1px solid var(--border, rgba(17, 17, 17, 0.1));
  box-shadow: 0 -4px 24px rgba(17, 17, 17, 0.06);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

#cookie-consent-banner.cookie-consent--hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Dark theme: when site uses .dark on html or body */
html.dark #cookie-consent-banner,
body.dark #cookie-consent-banner {
  background-color: var(--black);
  color: rgba(255, 255, 255, 0.85);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.cookie-consent__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}

.cookie-consent__text {
  flex: 1 1 300px;
  margin: 0;
  color: inherit;
}

.cookie-consent__text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.cookie-consent__text a:hover {
  opacity: 0.85;
}

html.dark .cookie-consent__text a,
body.dark .cookie-consent__text a {
  color: var(--white);
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cookie-consent__btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.48px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Primary CTA: filled, matches site buttons */
.cookie-consent__btn--accept {
  background-color: var(--primary);
  color: var(--white);
}

.cookie-consent__btn--accept:hover {
  background-color: #2a2a2a;
  color: var(--white);
}

html.dark .cookie-consent__btn--accept,
body.dark .cookie-consent__btn--accept {
  background-color: var(--white);
  color: var(--black);
}

html.dark .cookie-consent__btn--accept:hover,
body.dark .cookie-consent__btn--accept:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--black);
}

/* Secondary: outline only */
.cookie-consent__btn--reject {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--border, rgba(17, 17, 17, 0.2));
}

.cookie-consent__btn--reject:hover {
  border-color: var(--primary);
  color: var(--primary);
}

html.dark .cookie-consent__btn--reject,
body.dark .cookie-consent__btn--reject {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
}

html.dark .cookie-consent__btn--reject:hover,
body.dark .cookie-consent__btn--reject:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}

@media (max-width: 576px) {
  #cookie-consent-banner {
    padding: 16px 20px;
  }

  .cookie-consent__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 16px;
  }

  .cookie-consent__actions {
    justify-content: center;
  }

  .cookie-consent__btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}
