/* ==========================================================================
   Marketing go-live: "Leave a Message" fab + panel and WhatsApp fab.
   From the Marketing-Go-Live template, themed for Dr Martelize Weyers Inc.

   Site-specific notes:
   - The site's header utility bar already shows the phone number (tel: link)
     at every width, so the template's navbar block is not used here.
   - The site already defines .btn / .btn--primary, so the template's generic
     .btn, .btn-primary and .btn-outline rules are left out; the panel's submit
     button uses the site's own button classes instead.
   ========================================================================== */

/* ==========================================================================
   THEME — change --main-color to match the site's brand color.
   Everything else derives from it.
   ========================================================================== */
:root {
  --main-color: #063b4d;        /* site navy (--navy in css/styles.css) */
  --main-contrast: #ffffff;      /* text/icon color drawn ON TOP of --main-color */

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

@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);
  }
}

:root {
  /* Neutrals */
  --black: #063b4d;              /* the site uses navy as its text colour */
  --white: #ffffff;
  --grey-100: #f1f5f7;           /* site --grey */
  --grey-300: #d3dde1;
  --grey-600: #4a6c78;

  /* Type: the site's own fonts (loaded in each page's <head>) */
  --font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   Leave a Message — floating action button
   ========================================================================== */
.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 0px;
  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(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--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(--white);
  border-radius: var(--radius);
  box-shadow: var(--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(--grey-100);
  color: var(--black);
  border-radius: 50%;
  cursor: pointer;
}
.contact-modal-close:hover { background: var(--grey-300); }

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

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

.form-group { margin-bottom: 14px; }

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

.contact-modal-submit { width: 100%; margin-top: 6px; }

/* Site additions: POPIA consent line, submit layout and status message */
.contact-modal-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin: 4px 0 14px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--grey-600);
  cursor: pointer;
}
.contact-modal-consent input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--main-color); }
.contact-modal-consent a { color: var(--main-color); text-underline-offset: 0.2em; }

.contact-modal .contact-modal-submit { justify-content: space-between; }

.contact-modal-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 2px solid #66a6ae;
  background: #eef6f7;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--black);
}
.contact-modal-status[data-state="error"] { border-left-color: #b3261e; background: #fbeeed; }

/* ==========================================================================
   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(--shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.whatsapp-fab:hover { background: #1ebe5b; }
.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; }
}

/* ==========================================================================
   Site fit
   ========================================================================== */
/* The fab is the same navy as the footer; a faint light edge keeps it visible there */
.contact-fab {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 0;
}

/* Keep the fabs out of the way while the full-screen mobile menu is open */
body:has(.site-nav.is-open) .contact-fab,
body:has(.site-nav.is-open) .whatsapp-fab { display: none; }

/* On phones the centred fab sits over the last line of the footer */
@media (max-width: 560px) {
  .site-footer__bottom { padding-bottom: 4.5rem; }
}
