/* ============================================================
   MADE GLOW — cookie consent banner + customize modal
   GDPR + CCPA compliant pattern. Loaded on every page; appears
   on first visit until a choice is stored in localStorage as
   `mg-cookie-prefs`.
   ============================================================ */

#mg-cookie-banner,
#mg-cookie-modal-backdrop {
  font-family: var(--mg-font-body, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  color: var(--mg-ink, #2A1F4D);
  box-sizing: border-box;
}

#mg-cookie-banner *,
#mg-cookie-modal-backdrop * { box-sizing: border-box; }

#mg-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--mg-border, #ececec);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(42, 31, 77, 0.16);
  padding: 18px 20px;
  z-index: 9999;
  display: none;
  font-size: 14px;
  line-height: 1.55;
}

#mg-cookie-banner.is-visible { display: block; }

#mg-cookie-banner .mg-cb-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--mg-ink, #2A1F4D);
}

#mg-cookie-banner p { margin: 0 0 14px; color: #555; }
#mg-cookie-banner a { color: var(--mg-pink, #F584CB); text-decoration: underline; }

#mg-cookie-banner .mg-cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

#mg-cookie-banner button,
#mg-cookie-modal-backdrop button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
#mg-cookie-banner button:active,
#mg-cookie-modal-backdrop button:active { transform: translateY(1px); }

#mg-cookie-banner .mg-cb-primary,
#mg-cookie-modal-backdrop .mg-cb-primary {
  background: var(--mg-pink, #F584CB);
  color: #fff;
}
#mg-cookie-banner .mg-cb-secondary,
#mg-cookie-modal-backdrop .mg-cb-secondary {
  background: #fff;
  color: var(--mg-ink, #2A1F4D);
  border-color: var(--mg-border, #ddd);
}

/* ---- Customize modal ---- */
#mg-cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 77, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
}
#mg-cookie-modal-backdrop.is-visible { display: flex; }

#mg-cookie-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(42, 31, 77, 0.24);
}
#mg-cookie-modal h3 { margin: 0 0 4px; font-size: 18px; color: var(--mg-ink, #2A1F4D); }
#mg-cookie-modal .mg-cb-sub { font-size: 13px; color: #666; margin: 0 0 16px; }

#mg-cookie-modal .mg-cb-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--mg-border, #f1f1f1);
}
#mg-cookie-modal .mg-cb-row strong { display: block; font-size: 14px; margin-bottom: 2px; }
#mg-cookie-modal .mg-cb-row p { margin: 0; font-size: 13px; color: #666; line-height: 1.5; }

#mg-cookie-modal .mg-cb-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 9999px;
  background: #d4d4d4;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s ease;
}
#mg-cookie-modal .mg-cb-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
#mg-cookie-modal .mg-cb-toggle:checked { background: var(--mg-pink, #F584CB); }
#mg-cookie-modal .mg-cb-toggle:checked::after { transform: translateX(16px); }
#mg-cookie-modal .mg-cb-toggle:disabled { opacity: 0.6; cursor: not-allowed; }

#mg-cookie-modal .mg-cb-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--mg-border, #f1f1f1);
}

@media (max-width: 540px) {
  #mg-cookie-banner { padding: 16px; font-size: 13px; }
  #mg-cookie-banner .mg-cb-actions { justify-content: stretch; }
  #mg-cookie-banner .mg-cb-actions button { flex: 1 1 auto; }
}
