/* Modal Header base styles */
.mh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}
.mh-overlay.is-open { display: flex; }

.mh-dialog {
  width: 100%;
  max-width: 720px;
  max-height: min-content;
  background: var(--global-palette9, #fff);
  color: var(--global-palette9-contrast, #111);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  outline: none;
  transform: translateY(12px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.mh-overlay.is-open .mh-dialog {
  transform: translateY(0);
  opacity: 1;
}
.mh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.mh-title {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 600;
}

/* Close button */
.mh-close {
  appearance: none;
  border: 0;
  background: #007CBA;
  color: #FAF7F6;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.mh-close:hover,
.mh-close:focus {
  opacity: .9;
}

.mh-body { padding: 20px; }

.mh-body .wpcf7 form { margin: 0; }
.mh-body .wpcf7 .wpcf7-form-control-wrap { width: 100%; }
.mh-body .wpcf7 input[type="text"],
.mh-body .wpcf7 input[type="email"],
.mh-body .wpcf7 input[type="tel"],
.mh-body .wpcf7 textarea { width: 100%; }

@media (max-width: 1100px) {
  .mh-body {
	padding: 0px 8px 8px 8px !important;
    margin-top: -25px !important;
	}
  #mh-overlay .mh-body .mh-cf7 #send-button-block {
    margin-top: -40px !important;  
	}
}

@media (max-width: 600px) {
  .mh-dialog {
    max-width: none;
    width: 100%;
    height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
  }
  .mh-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
	padding: 0px 8px 8px 8px !important;
    margin-top: -25px !important;
  }
  #mh-overlay .mh-body .mh-cf7 #send-button-block {
    margin-top: -40px !important;
	}  
}

html.mh-locked, body.mh-locked { overflow: hidden; }

/* === CF7 styles for HEADER modal only (namespaced via .mh-cf7) === */
#mh-overlay .mh-body .mh-cf7 * { box-sizing: border-box; }

/* Labels (headings and checkbox labels) */
#mh-overlay .mh-body .mh-cf7 label {
  display: inline-block;
  margin-top: 0;
  margin-bottom: 0;
  color: #007CBA;
  font-weight: 500;
  vertical-align: middle;
}

/* Checkbox labels layout */
#mh-overlay .mh-body .mh-cf7 label:has(> input[type="checkbox"]) {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.35;
  margin-bottom: 8px;
}

/* Checkbox descriptions text */
#mh-overlay .mh-body .mh-cf7 .wpcf7-list-item-label {
  color: #007CBA;
}

/* Inputs & textarea */
#mh-overlay .mh-body .mh-cf7 input[type="text"],
#mh-overlay .mh-body .mh-cf7 input[type="email"],
#mh-overlay .mh-body .mh-cf7 input[type="url"],
#mh-overlay .mh-body .mh-cf7 input[type="tel"],
#mh-overlay .mh-body .mh-cf7 input[type="number"],
#mh-overlay .mh-body .mh-cf7 input[type="date"],
#mh-overlay .mh-body .mh-cf7 textarea {
  width: 100%;
  max-width: 100%;
  background: #FAF7F6;
  color: #3E3732;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 12px 14px;
  line-height: 1.4;
  margin-bottom: 0;
}

/* Focus state */
#mh-overlay .mh-body .mh-cf7 input[type="text"]:focus,
#mh-overlay .mh-body .mh-cf7 input[type="email"]:focus,
#mh-overlay .mh-body .mh-cf7 input[type="url"]:focus,
#mh-overlay .mh-body .mh-cf7 input[type="tel"]:focus,
#mh-overlay .mh-body .mh-cf7 input[type="number"]:focus,
#mh-overlay .mh-body .mh-cf7 input[type="date"]:focus,
#mh-overlay .mh-body .mh-cf7 textarea:focus {
  outline: none;
  border-color: #007CBA;
  box-shadow: 0 0 0 3px rgba(0,124,186,0.15);
}

/* intl-tel-input */
#mh-overlay .mh-body .mh-cf7 .intl-tel-input { width: 100%; }
#mh-overlay .mh-body .mh-cf7 .intl-tel-input input[type="tel"] {
  width: 100% !important;
  background: #FAF7F6;
  color: #3E3732;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 12px 14px 12px 52px;
}

/* Checkbox group */
#mh-overlay .mh-body .mh-cf7 .checkboxes { margin-bottom: 0; }

/* Checkbox visual */
#mh-overlay .mh-body .mh-cf7 input[type="checkbox"].kb-checkbox {
  accent-color: #007CBA;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

/* CF7 hints and response messages: hide them inside header modal */
#mh-overlay .mh-body .mh-cf7 .wpcf7-not-valid-tip {
  display: none !important;
}
#mh-overlay .mh-body .mh-cf7 .wpcf7-response-output {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* CF7 response outputs base colors kept for other forms (if needed) */
#mh-overlay .mh-body .mh-cf7 .wpcf7 form.invalid .wpcf7-response-output,
#mh-overlay .mh-body .mh-cf7 .wpcf7 form.unaccepted .wpcf7-response-output,
#mh-overlay .mh-body .mh-cf7 .wpcf7 form.payment-required .wpcf7-response-output {
  border-color: #ffb900;
  background: #FAF7F6;
  color: #dc3232;
}
#mh-overlay .mh-body .mh-cf7 .wpcf7 form.sent .wpcf7-response-output {
  border-color: #46b450;
  background: #FAF7F6;
  color: #3E3732;
}

/* Submit button */
#mh-overlay .mh-body .mh-cf7 input[type="submit"] {
  background: #007CBA;
  color: #FAF7F6;
  border: none;
  border-radius: 6px;
  padding: 18px 16px;
  font-weight: 600;
  line-height: 1;
  width: auto;
  display: block;
  margin: 14px auto 0;
  cursor: pointer;
  transition: transform .05s ease, opacity .2s ease;
}
#mh-overlay .mh-body .mh-cf7 input[type="submit"]:hover { opacity: .95; }
#mh-overlay .mh-body .mh-cf7 input[type="submit"]:active { transform: translateY(1px); }

/* Required star */
#mh-overlay .mh-body .mh-cf7 .required {
  color: #007CBA;
  margin-left: 4px;
}

/* Screen reader text */
#mh-overlay .mh-body .mh-cf7 .screen-reader-text {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Send button block */
#mh-overlay .mh-body .mh-cf7 #send-button-block { text-align: center; margin-top: 14px; }
#mh-overlay .mh-body .mh-cf7 #send-button-block > p {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-left: -25px;
}

/* Spinner */
#mh-overlay .mh-body .mh-cf7 .wpcf7-spinner {
  order: -1;
  top: 8px;
  left: -15px;
  margin: 0;
  background-color: #A5A5A5;
}
#mh-overlay .mh-body .mh-cf7 .wpcf7 form.submitting .wpcf7-spinner { opacity: 1; }

/* Error states */
#mh-overlay .mh-body .mh-cf7 .intl-tel-input.tel-error { outline: none !important; }
#mh-overlay .mh-body .mh-cf7 .wpcf7 form .is-error input[type="text"],
#mh-overlay .mh-body .mh-cf7 .wpcf7 form .is-error input[type="email"],
#mh-overlay .mh-body .mh-cf7 .intl-tel-input.tel-error input[type="tel"] {
  border: 2px solid #dc3232 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(220,50,50,0.15) !important;
  border-radius: 6px;
}
#mh-overlay .mh-body .mh-cf7 .wpcf7 form .is-error input[type="checkbox"],
#mh-overlay .mh-body .mh-cf7 .wpcf7 form .is-error input[type="radio"] {
  outline: 2px solid #dc3232 !important;
  outline-offset: 2px;
}
