html.ap-popup-lock,
html.ap-popup-lock body { overflow: hidden !important; }

[data-ap-popup][hidden] { display: none !important; }

[data-ap-popup] {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: auto;
  overscroll-behavior: contain;
}

.ap-native-form { width: 100%; }
.ap-native-form *, .ap-native-form *::before, .ap-native-form *::after { box-sizing: border-box; }
.ap-native-form__grid { display: flex; flex-wrap: wrap; margin: -7.5px; align-items: flex-end; }
.ap-native-form__field { flex: 0 0 var(--ap-col, 100%); max-width: var(--ap-col, 100%); padding: 7.5px; }
.ap-native-form__field label:not(.ap-native-form__acceptance):not(.ap-native-form__choice) { display: block; margin: 0 0 6px; color: #212121; font-size: 15px; font-weight: 600; line-height: 1.35; }
.ap-native-form input:not([type="checkbox"]):not([type="radio"]),
.ap-native-form textarea,
.ap-native-form select {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(80, 50, 24, .28);
  border-radius: 10px;
  background: #fff;
  color: #212121;
  font: inherit;
  line-height: 1.4;
  box-shadow: none;
}
.ap-native-form textarea { min-height: 110px; resize: vertical; }
.ap-native-form input[type="file"] { padding: 10px; }
.ap-native-form input:focus,
.ap-native-form textarea:focus,
.ap-native-form select:focus { outline: 2px solid rgba(255, 106, 42, .25); border-color: #ff6a2a; }
.ap-native-form__acceptance,
.ap-native-form__choice { display: flex; align-items: flex-start; gap: 9px; color: #212121; font-size: 14px; line-height: 1.45; cursor: pointer; }
.ap-native-form__acceptance input,
.ap-native-form__choice input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: #ff6a2a; }
.ap-native-form__acceptance a { color: #0066cc; text-decoration: underline; }
.ap-native-form small { display: block; margin-top: 5px; color: rgba(33,33,33,.68); font-size: 12px; }
.ap-native-form__button {
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 0;
  border-radius: 10px;
  background: #ff6a2a;
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
  box-shadow: 0 9px 22px rgba(255, 106, 42, .22);
}
.ap-native-form__button:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 106, 42, .3); }
.ap-native-form__button:disabled { opacity: .65; cursor: wait; transform: none; }
.ap-native-form__status { min-height: 24px; margin-top: 10px; font-size: 15px; line-height: 1.45; }
.ap-native-form__status.is-success { color: #267a3f; }
.ap-native-form__status.is-error { color: #a32525; }
.ap-native-form__status.is-pending { color: #503218; }
.ap-form-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.ap-form-error { padding: 12px; border: 1px solid #b32d2e; background: #fff1f1; color: #8a2424; }

@media (max-width: 1024px) {
  .ap-native-form__field { flex-basis: var(--ap-col-tablet, 100%); max-width: var(--ap-col-tablet, 100%); }
}
@media (max-width: 767px) {
  .ap-native-form__grid { margin: -6px; }
  .ap-native-form__field { flex-basis: var(--ap-col-mobile, 100%); max-width: var(--ap-col-mobile, 100%); padding: 6px; }
}


/* Общий popup, выводимый один раз через wp_footer. */
.ap-global-popup {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(37, 22, 12, .72);
  backdrop-filter: blur(7px);
}
.ap-global-popup__dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 24px;
  background: #fffaf4;
  color: #212121;
  box-shadow: 0 28px 80px rgba(27, 13, 5, .36);
}
.ap-global-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(80, 50, 24, .09);
  color: #503218;
  font: 400 30px/1 Arial, sans-serif;
  cursor: pointer;
}
.ap-global-popup__close:hover { background: rgba(80, 50, 24, .16); }
.ap-global-popup__eyebrow {
  margin: 0 52px 8px 0;
  color: #ff6a2a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ap-global-popup__title {
  margin: 0 52px 10px 0;
  color: #503218;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.08;
}
.ap-global-popup__lead {
  max-width: 650px;
  margin: 0 0 22px;
  color: rgba(33, 33, 33, .72);
  font-size: 16px;
  line-height: 1.55;
}
.ap-popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: 12px;
  background: #ff6a2a;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 106, 42, .25);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ap-popup-button:hover { transform: translateY(-2px); background: #503218; box-shadow: 0 14px 30px rgba(80, 50, 24, .25); }
.ap-popup-trigger-widget { width: 100%; }

@media (max-width: 767px) {
  .ap-global-popup { padding: 10px; align-items: end; }
  .ap-global-popup__dialog { max-height: calc(100vh - 20px); padding: 26px 18px 20px; border-radius: 20px 20px 14px 14px; }
  .ap-global-popup__close { top: 10px; right: 10px; width: 38px; height: 38px; }
  .ap-global-popup__title { margin-right: 38px; font-size: 28px; }
  .ap-global-popup__eyebrow { margin-right: 38px; }
}
