/* =============================================================================
 *  DRE CONSENT — banner, modal, toggle switches.
 *  Paired with consent.js. Uses the same CSS variables as the rest of the site
 *  (--primary-color etc.) so the banner picks up each clinic's brand colors
 *  automatically via the theme-overrides block injected by build.js.
 * ============================================================================= */

/* Banner --------------------------------------------------------------- */

.dre-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  padding: 18px 20px;
  transform: translateY(110%);
  transition: transform 0.35s ease;
  font-family: var(--font-family, sans-serif);
}
.dre-consent-banner.visible {
  transform: translateY(0);
}
.dre-consent-banner__content {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.dre-consent-banner__text {
  flex: 1;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #333;
}
.dre-consent-banner__text a {
  color: var(--primary-color, #0d6efd);
  text-decoration: underline;
}
.dre-consent-banner__buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .dre-consent-banner__content {
    flex-direction: column;
    align-items: stretch;
  }
  .dre-consent-banner__buttons {
    flex-wrap: wrap;
  }
  .dre-consent-banner__buttons .dre-consent-btn {
    flex: 1;
  }
}

/* Buttons -------------------------------------------------------------- */

.dre-consent-btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.dre-consent-btn:focus-visible {
  outline: 2px solid var(--primary-color, #0d6efd);
  outline-offset: 2px;
}
.dre-consent-btn--primary {
  background: var(--primary-color, #0d6efd);
  color: #fff;
}
.dre-consent-btn--primary:hover {
  background: var(--primary-hover, #0b5ed7);
}
.dre-consent-btn--secondary {
  background: #f0f0f0;
  color: #333;
}
.dre-consent-btn--secondary:hover {
  background: #e2e2e2;
}
.dre-consent-btn--text {
  background: transparent;
  color: #555;
}
.dre-consent-btn--text:hover {
  color: var(--primary-color, #0d6efd);
}

/* Modal ---------------------------------------------------------------- */

.dre-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  font-family: var(--font-family, sans-serif);
}
.dre-consent-modal.visible {
  opacity: 1;
  pointer-events: auto;
}
.dre-consent-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.dre-consent-modal__dialog {
  position: relative;
  background: #fff;
  max-width: 560px;
  margin: 5vh auto 0;
  border-radius: 12px;
  padding: 28px 28px 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  /* Minimal scrollbar — overrides the chunky OS default (esp. Windows)
     which otherwise picks up the page's primary color and looks loud. */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.dre-consent-modal__dialog::-webkit-scrollbar {
  width: 6px;
}
.dre-consent-modal__dialog::-webkit-scrollbar-track {
  background: transparent;
}
.dre-consent-modal__dialog::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}
.dre-consent-modal__dialog::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}
.dre-consent-modal__title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main, #212529);
}
.dre-consent-modal__intro {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
}

/* Categories ----------------------------------------------------------- */

.dre-consent-category {
  border-top: 1px solid #eee;
  padding: 14px 0 12px;
}
.dre-consent-category:first-of-type {
  margin-top: 8px;
}
.dre-consent-category__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 12px;
}
.dre-consent-category__name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main, #212529);
}
.dre-consent-category__locked {
  font-size: 0.82rem;
  color: #888;
  font-style: italic;
}
.dre-consent-category__desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #666;
}

/* Toggle switch -------------------------------------------------------- */

.dre-consent-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.dre-consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.dre-consent-toggle__slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 12px;
  transition: background 0.2s ease;
}
.dre-consent-toggle__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dre-consent-toggle input:checked + .dre-consent-toggle__slider {
  background: var(--primary-color, #0d6efd);
}
.dre-consent-toggle input:checked + .dre-consent-toggle__slider::before {
  transform: translateX(18px);
}
.dre-consent-toggle input:focus-visible + .dre-consent-toggle__slider {
  outline: 2px solid var(--primary-color, #0d6efd);
  outline-offset: 2px;
}

/* Modal actions -------------------------------------------------------- */

.dre-consent-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  .dre-consent-modal__actions .dre-consent-btn {
    flex: 1;
  }
}

/* Floating "Cookie Settings" button (FAB) ------------------------------- */
/* Bottom-left so it doesn't collide with the sticky WhatsApp button which
   sits bottom-right. z-index is below the banner (9999) and modal (10000)
   so neither competes with it when they're open. */

.dre-consent-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color, #0d6efd);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.dre-consent-fab.visible {
  opacity: 0.85;
  transform: scale(1);
  pointer-events: auto;
}
.dre-consent-fab:hover {
  opacity: 1;
  background: var(--primary-hover, #0b5ed7);
}
.dre-consent-fab:focus-visible {
  opacity: 1;
  outline: 2px solid var(--primary-color, #0d6efd);
  outline-offset: 3px;
}
.dre-consent-fab svg {
  display: block;
}
@media (max-width: 480px) {
  .dre-consent-fab {
    bottom: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
  }
}
