/* Rea Medika Persistent Floating WhatsApp CTA */

html {
  scroll-padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

/* Keep footer navigation and social links clear of the persistent floating CTA */
html body .footer {
  padding-bottom: max(92px, calc(84px + env(safe-area-inset-bottom, 0px)));
}

/* Accessible visually-hidden utility (clip-path pattern) */
.rea-wa-sr-only {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Persistent Floating WhatsApp Pill CTA */
html body a.rea-wa-float,
html body a.rea-wa-float:visited {
  position: fixed;
  right: max(22px, env(safe-area-inset-right, 0px));
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  z-index: 995;

  display: inline-flex;
  align-items: center;
  gap: 13px;

  min-block-size: 66px;
  min-inline-size: 66px;
  max-inline-size: calc(100vw - 28px);
  padding: 10px 24px 10px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);

  background: linear-gradient(135deg, #0f7a3b 0%, #0b6330 100%);
  color: #ffffff !important;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-decoration: none !important;
  line-height: 1.2;

  box-shadow:
    0 12px 28px rgba(10, 74, 37, 0.34),
    0 4px 12px rgba(0, 0, 0, 0.16) !important;

  transition:
    transform 180ms ease-out,
    scale 150ms ease-out,
    box-shadow 180ms ease-out,
    background 180ms ease-out;
  -webkit-font-smoothing: antialiased;
  cursor: pointer;
}

html body a.rea-wa-float:hover {
  background: linear-gradient(135deg, #0c6b33 0%, #095529 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-2px);
  box-shadow:
    0 16px 34px rgba(10, 74, 37, 0.42),
    0 6px 14px rgba(0, 0, 0, 0.2) !important;
}

html body a.rea-wa-float:active {
  scale: 0.97;
  transform: translateY(0);
  color: #ffffff !important;
  box-shadow:
    0 6px 16px rgba(10, 74, 37, 0.32),
    0 2px 6px rgba(0, 0, 0, 0.16) !important;
}

/* Override theme global focus-outline suppression for WCAG 2.4.7 / 1.4.11 */
html body a.rea-wa-float:focus-visible {
  outline: 3px solid #1e1e1e !important;
  outline-offset: 4px !important;
  box-shadow:
    0 0 0 6px #ffffff,
    0 14px 30px rgba(10, 74, 37, 0.4) !important;
}

/* Circular WhatsApp brand emblem */
.rea-wa-icon {
  position: relative;
  flex: 0 0 46px;
  inline-size: 46px;
  block-size: 46px;
  border-radius: 50%;
  background: #ffffff;
  color: #0e7438;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.rea-wa-icon svg {
  inline-size: 27px;
  block-size: 27px;
  display: block;
  fill: currentColor;
}

/* Subtle pulsing attention ring (compositor-only, respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .rea-wa-icon::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.72);
    opacity: 0;
    pointer-events: none;
    animation: rea-wa-pulse 2.8s ease-out infinite;
  }

  html body a.rea-wa-float:hover .rea-wa-icon::after {
    animation-play-state: paused;
  }

  @keyframes rea-wa-pulse {
    0% {
      transform: scale(0.95);
      opacity: 0.72;
    }
    70% {
      transform: scale(1.24);
      opacity: 0;
    }
    100% {
      transform: scale(1.24);
      opacity: 0;
    }
  }
}

/* Two-line CTA copy */
.rea-wa-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-inline-size: 0;
  text-align: left;
}

.rea-wa-title {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.18;
  color: #ffffff;
  white-space: nowrap;
}

.rea-wa-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.22;
  color: #edfdf3;
  white-space: nowrap;
}

/* Hide floating Google reCAPTCHA v3 badge cleanly (protection stays active; disclosure shown inline in CF7 forms) */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Subtle inline Google reCAPTCHA compliance notice inside CF7 forms */
.rea-recaptcha-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: #4a4a4a;
}

html body .rea-recaptcha-note a,
html body .rea-recaptcha-note a:visited {
  color: inherit !important;
  text-decoration: underline !important;
  font-weight: 600;
}

html body #ask .rea-recaptcha-note,
html body .contact-content .rea-recaptcha-note,
html body .booking-content .rea-recaptcha-note {
  color: rgba(255, 255, 255, 0.94) !important;
}

html body #ask .rea-recaptcha-note a,
html body #ask .rea-recaptcha-note a:visited,
html body .contact-content .rea-recaptcha-note a,
html body .contact-content .rea-recaptcha-note a:visited,
html body .booking-content .rea-recaptcha-note a,
html body .booking-content .rea-recaptcha-note a:visited {
  color: #ffffff !important;
  text-decoration: underline !important;
  font-weight: 600;
}

/* Mobile Layout (<= 767px) */
@media (max-width: 767px) {
  html body a.rea-wa-float,
  html body a.rea-wa-float:visited {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    min-block-size: 56px;
    min-inline-size: 56px;
    padding: 8px 18px 8px 8px;
    gap: 10px;
  }

  .rea-wa-icon {
    flex: 0 0 40px;
    inline-size: 40px;
    block-size: 40px;
  }

  .rea-wa-icon svg {
    inline-size: 23px;
    block-size: 23px;
  }

  .rea-wa-title {
    font-size: 15px;
  }

  .rea-wa-subtitle {
    font-size: 11.5px;
  }

  /* Keep legacy mobile phone button cleanly aligned on bottom-left (also overrides header.php CF7 lift) */
  html body #fixed-phone,
  html body:has(.wpcf7-form) #fixed-phone {
    right: auto !important;
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 990;
  }

  html body .footer {
    padding-bottom: max(96px, calc(88px + env(safe-area-inset-bottom, 0px)));
  }
}

/* Narrow viewports (320px–369px): keep WhatsApp & Call cleanly side-by-side in one compact row */
@media (max-width: 369px) {
  html body a.rea-wa-float,
  html body a.rea-wa-float:visited {
    right: max(12px, env(safe-area-inset-right, 0px));
    max-inline-size: calc(100vw - 82px);
    padding: 7px 14px 7px 7px;
    gap: 8px;
  }

  .rea-wa-icon {
    flex: 0 0 38px;
    inline-size: 38px;
    block-size: 38px;
  }

  .rea-wa-icon svg {
    inline-size: 21px;
    block-size: 21px;
  }

  .rea-wa-title {
    font-size: 14px;
  }

  .rea-wa-subtitle {
    font-size: 11px;
    white-space: normal;
  }

  html body #fixed-phone {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
  }
}

/* Hide floating CTA while the mobile navigation drawer is open */
@media (max-width: 991px) {
  html body.mobile-menu-open a.rea-wa-float {
    display: none !important;
  }
}

/* High contrast / Forced Colors Mode support */
@media (forced-colors: active) {
  html body a.rea-wa-float {
    border: 2px solid ButtonText;
    forced-color-adjust: auto;
  }
}

/* Hide from printed documents */
@media print {
  html body a.rea-wa-float {
    display: none !important;
  }
}
