/* ==========================================================================
   Mo-Health popup components — Leave a Message fab + panel, WhatsApp fab.
   Generated from popup-components-template.md using popup-config.yaml.

   THEME — change --main-color to re-theme; everything else derives from it.
   Class names are scoped to .contact-* / .whatsapp-* so they do not collide
   with the site's existing .btn / .form-group rules.
   ========================================================================== */
:root {
  --main-color: #cb2271;         /* Mo-Health pink */
  --main-contrast: #ffffff;

  /* Fallback shades (used only if the browser lacks color-mix()) */
  --main-color-dark: #a51a5b;
  --main-color-light: #fdeaf2;
}

@supports (color: color-mix(in srgb, red, red)) {
  :root {
    --main-color-dark: color-mix(in srgb, var(--main-color) 82%, black);
    --main-color-light: color-mix(in srgb, var(--main-color) 12%, white);
  }
}

.contact-fab,
.contact-modal,
.whatsapp-fab {
  --popup-black: #111111;
  --popup-white: #ffffff;
  --popup-grey-100: #f3f4f6;
  --popup-grey-300: #e5e7eb;
  --popup-grey-600: #6b7280;
  --popup-font-sans: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --popup-font-serif: "Playfair Display", Georgia, serif;
  --popup-radius: 14px;
  --popup-radius-sm: 8px;
  --popup-shadow-md: 0 8px 30px rgba(0, 0, 0, 0.14);
  --popup-shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   Leave a Message — floating action button
   ========================================================================== */
.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 0;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--main-color);
  color: var(--main-contrast);
  border: none;
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  font-family: var(--popup-font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--popup-shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.contact-fab:hover { background: var(--main-color-dark); }
.contact-fab svg { flex: 0 0 auto; }

@media (max-width: 560px) {
  .contact-fab {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 65px;
    font-size: 0.85rem;
  }
  .contact-fab:hover { transform: translateX(-50%); }
}

/* ==========================================================================
   Leave a Message — modal panel
   ========================================================================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1300; /* stays above the WhatsApp fab */
}

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent; /* click-outside-to-close catcher, no dimming */
}

.contact-modal-dialog {
  position: fixed;
  right: 24px;
  bottom: 60px; /* sits just above the fab */
  width: min(380px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 140px));
  background: var(--popup-white);
  border-radius: var(--popup-radius);
  box-shadow: var(--popup-shadow-lg);
  padding: 28px 26px;
  overflow-y: auto;
  transform-origin: bottom right;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-modal.is-open .contact-modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (max-width: 560px) {
  .contact-modal-dialog {
    right: 12px;
    left: 12px;
    bottom: 76px;
    width: auto;
    padding: 22px 20px;
  }
}

.contact-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--popup-grey-100);
  color: var(--popup-black);
  border-radius: 50%;
  cursor: pointer;
}
.contact-modal-close:hover { background: var(--popup-grey-300); }

.contact-modal-dialog h2 {
  font-family: var(--popup-font-serif);
  font-size: 1.5rem;
  margin: 0 0 8px;
  padding-right: 30px;
  color: var(--popup-black);
}

.contact-modal-intro {
  color: var(--popup-grey-600);
  font-family: var(--popup-font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.contact-modal .contact-field { margin-bottom: 14px; }

.contact-modal .contact-field input,
.contact-modal .contact-field textarea {
  width: 100%;
  font-family: var(--popup-font-sans);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--popup-grey-300);
  border-radius: var(--popup-radius-sm);
  background: var(--popup-white);
  color: var(--popup-black);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-modal .contact-field input:focus,
.contact-modal .contact-field textarea:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 0 3px var(--main-color-light);
}
.contact-modal .contact-field textarea { min-height: 110px; resize: vertical; }

.contact-modal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  font-family: var(--popup-font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--popup-radius-sm);
  background: var(--main-color);
  color: var(--main-contrast);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.contact-modal-submit:hover { background: var(--main-color-dark); color: var(--main-contrast); }
.contact-modal-submit:active { transform: translateY(1px); }

/* ==========================================================================
   WhatsApp — floating action button
   ========================================================================== */
.whatsapp-fab {
  position: fixed;
  right: 24px;
  bottom: 64px; /* stacked directly above the "Leave a Message" fab */
  z-index: 1200;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: var(--popup-shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.whatsapp-fab:hover { background: #1ebe5b; color: #ffffff; }
.whatsapp-fab svg { width: 30px; height: 30px; flex: 0 0 auto; }

@media (max-width: 560px) {
  .whatsapp-fab {
    right: 16px;
    bottom: 45px;
    width: 45px;
    height: 45px;
  }
  .whatsapp-fab svg { width: 26px; height: 26px; }
}
