/* =========================================================
 * Global popups — template-parts/global-popups.php
 *
 * Matches the landing popup as it renders on live: landing.css, the
 * "Global popup forms" blocks in the theme's root style.css and the
 * radius from Additional CSS. Those only target .lp-popup__*, so the
 * resulting values are repeated here for .site-popup__*.
 * ========================================================= */

body.site-popup-open {
  overflow: hidden;
}

.site-popup {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.site-popup[hidden] {
  display: none;
}

/* Fixed, not absolute, so it always covers the whole screen. */
.site-popup__backdrop {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(34, 34, 34, 0.55);
}

/* The dialog scrolls on its own when the form is taller than the screen. */
.site-popup__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  width: min(780px, calc(100vw - 24px));
  max-width: 780px;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  margin: auto;
  padding: 30px 40px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background-color: #fff;
  border: 1px solid #f1eeeb;
  border-radius: 20px;
  box-shadow: 0 20px 60px -20px rgba(34, 34, 34, 0.35);
}

.site-popup__close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f4efe7;
  color: #222;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-popup__close:hover,
.site-popup__close:focus-visible {
  color: #aa8453;
}

.site-popup__title {
  margin: 0 56px 8px;
  color: #222;
  font-family: "Gilda Display";
  font-size: 36px;
  font-size: clamp(36px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.08;
  text-align: center;
}

.site-popup__text {
  max-width: 610px;
  margin: 0 28px 18px;
  font-size: 18px;
  line-height: 1.4;
  text-align: center;
}

.site-popup__text p {
  margin: 0;
  color: #666;
  font-size: 17px;
  line-height: 1.5;
}

.site-popup__text a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-popup__text a:hover {
  color: #aa8453;
  text-decoration: underline;
}

/* ---------- Form (CF7 markup: .form-control / .form-file / .form-acceptance / .form-control-btn) ---------- */

.site-popup__form .wpcf7-form > br {
  display: none;
}

.site-popup .cf7apps-honeypot-wrap,
.site-popup .wpcf7_hp_field,
.site-popup input[name="wpcf7_hp_field"] {
  display: none !important;
}

.site-popup__form .form-control {
  margin: 0 0 10px;
}

.site-popup__form .form-control > p,
.site-popup__form .form-file > p,
.site-popup__form .form-control-btn > p {
  margin: 0;
}

.site-popup__form .form-control input:not([type="checkbox"]):not([type="submit"]):not([type="file"]),
.site-popup__form .form-control textarea {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  box-sizing: border-box;
  border: 1px solid #dcd5cb;
  border-radius: 0;
  background: #fff;
  color: #222;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.site-popup__form .form-control input:not([type="checkbox"]):not([type="submit"]):not([type="file"]) {
  height: 52px;
  min-height: 52px;
  padding: 13px 16px;
}

.site-popup__form .form-control textarea {
  height: 96px;
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
}

.site-popup__form .form-control input:focus,
.site-popup__form .form-control textarea:focus {
  border-color: #aa8453;
  outline: 2px solid rgba(170, 132, 83, 0.2);
  outline-offset: 0;
}

.site-popup__form .form-file {
  margin: 4px 0 22px;
}

.site-popup__form .codedropz-upload-handler {
  min-height: 40px;
  margin: 2px 0 12px;
  padding: 8px 0;
  border: 0;
}

.site-popup__form .codedropz-upload-container {
  padding: 10px 0;
}

.site-popup__form .codedropz-upload-inner h3,
.site-popup__form .codedropz-upload-inner > span,
.site-popup__form .dnd-upload-counter {
  display: none;
}

.site-popup__form .cd-upload-btn {
  color: #b18c59;
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: underline;
}

.site-popup__form .form-acceptance {
  margin: 2px 0 14px;
}

.site-popup__form .form-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.site-popup__form .form-acceptance input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
}

.site-popup__form .form-acceptance .wpcf7-list-item {
  margin: 0;
}

.site-popup__form .form-control-btn {
  margin: 0;
  padding: 0;
}

.site-popup__form input[type="submit"] {
  width: 100%;
  height: 70px;
  min-height: 70px;
  padding: 0 24px;
  border: 1px solid #aa8453;
  border-radius: 999px;
  background-color: #aa8453;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-popup__form input[type="submit"]:hover {
  background-color: transparent;
  color: #222;
  border-color: rgba(34, 34, 34, 0.5);
}

.site-popup__close:focus-visible,
.site-popup__form input:focus-visible,
.site-popup__form textarea:focus-visible {
  outline: 2px solid #aa8453;
  outline-offset: 2px;
}

@media only screen and (max-width: 575px) {
  .site-popup {
    padding: 8px;
  }

  .site-popup__dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 28px 16px 20px;
  }

  .site-popup__title {
    margin: 0 42px 8px 0;
    font-size: 32px;
    text-align: left;
  }

  .site-popup__text {
    margin: 0 0 16px;
    font-size: 16px;
    text-align: left;
  }

  .site-popup__form .form-control input:not([type="checkbox"]):not([type="submit"]):not([type="file"]) {
    height: 50px;
    min-height: 50px;
    padding: 12px 14px;
  }

  .site-popup__form .form-control textarea {
    height: 88px;
    min-height: 88px;
    padding: 13px 14px;
  }

  .site-popup__form .codedropz-upload-handler {
    min-height: 36px;
    margin-bottom: 10px;
    padding: 6px 0;
  }

  .site-popup__form input[type="submit"] {
    height: 62px;
    min-height: 62px;
    font-size: 12px;
  }

  .site-popup__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}
