/* Cookie consent banner — GDPR/ePrivacy compliant
   Equal visibility for Accept / Reject (ANSPDCP 2026 requirement). */

/* Hide cookie banner while mobile drawer is open so it doesn't cover menu items. */
.nav.menu-open ~ #mdd-cookie-banner,
body:has(.nav.menu-open) #mdd-cookie-banner { display: none !important; }

#mdd-cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 9998;
  display: none;
  background: var(--md-bg);
  border: 1px solid var(--md-teal-text);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(4,106,56, 0.18);
  padding: 18px 22px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  max-width: 720px;
  margin: 0 auto;
}
#mdd-cookie-banner.mdd-cb-show { display: block; }

.mdd-cb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mdd-cb-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--md-teal-text);
  font-family: 'Playfair Display', Georgia, serif;
}
#mdd-cb-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--md-muted);
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
#mdd-cb-close:hover { color: var(--md-teal-text); }

.mdd-cb-body p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--md-text);
}
.mdd-cb-body a { color: var(--md-teal-text); text-decoration: underline; }

.mdd-cb-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mdd-cb-btn {
  flex: 1;
  min-width: 130px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, border-color 0.15s;
}
.mdd-cb-btn-accept {
  background: #046A38;
  color: #ffffff;
  border-color: var(--md-teal-text);
}
.mdd-cb-btn-accept:hover { background: #023a6e; }
.mdd-cb-btn-reject {
  background: var(--md-bg);
  color: var(--md-teal-text);
  border-color: var(--md-teal-text);
}
.mdd-cb-btn-reject:hover { background: var(--md-bg); }
.mdd-cb-btn-customize {
  background: transparent;
  color: var(--md-muted);
  border-color: var(--md-line);
}
.mdd-cb-btn-customize:hover { color: var(--md-teal-text); border-color: var(--md-teal-text); }

/* Modal */
#mdd-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(4,20,12,0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#mdd-cookie-modal.mdd-cb-show { display: flex; }

.mdd-cb-modal-inner {
  background: var(--md-bg);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.mdd-cb-modal-head {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--md-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mdd-cb-modal-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--md-teal-text);
  font-family: 'Playfair Display', Georgia, serif;
}
#mdd-cb-modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--md-muted);
  line-height: 1;
}

.mdd-cb-modal-body { padding: 16px 24px; }
.mdd-cb-modal-body > p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--md-text);
  margin: 0 0 18px;
}

.mdd-cb-category {
  padding: 14px 0;
  border-bottom: 1px solid var(--md-line);
}
.mdd-cb-category:last-child { border-bottom: 0; }
.mdd-cb-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.mdd-cb-cat-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--md-teal-text);
}
.mdd-cb-cat-desc {
  font-size: 13px;
  color: var(--md-muted);
  margin: 0;
  line-height: 1.55;
}

/* Toggle switch */
.mdd-cb-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.mdd-cb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.mdd-cb-toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--md-bg-soft);
  border-radius: 24px;
  transition: 0.2s;
}
.mdd-cb-toggle .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.mdd-cb-toggle input:checked + .slider { background: #046A38; }
.mdd-cb-toggle input:checked + .slider::before { transform: translateX(18px); }
.mdd-cb-toggle input:disabled + .slider {
  background: #046A38;
  cursor: not-allowed;
  opacity: 0.7;
}

.mdd-cb-modal-foot {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--md-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mdd-cb-modal-foot .mdd-cb-btn { flex: 1; min-width: 120px; }

@media (max-width: 520px) {
  #mdd-cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px 16px; }
  .mdd-cb-btn { font-size: 13px; padding: 9px 12px; min-width: 110px; }
  .mdd-cb-actions { gap: 8px; }
}
