/* Core pop-ups stay theme-independent and do not alter page layouts. */
.cp-popup-dialog[hidden] { display: none !important; }
html.cp-popup-open, html.cp-popup-open body { overflow: hidden !important; }
.cp-popup-dialog {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  box-sizing: border-box;
  isolation: isolate;
}
.cp-popup-dialog, .cp-popup-dialog * { box-sizing: border-box; }
.cp-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 7, .74);
}
.cp-popup-panel {
  position: relative;
  width: min(840px, 100%);
  max-height: min(90dvh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fffaf0;
  color: #26211a;
  border: 1px solid #b38a39;
  border-radius: 18px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .4);
  scrollbar-width: thin;
}
.cp-popup-content { overflow-wrap: anywhere; }
.cp-popup-content > :first-child { margin-top: 0; }
.cp-popup-content > :last-child { margin-bottom: 0; }
.cp-popup-content img, .cp-popup-content video, .cp-popup-content iframe { max-width: 100%; height: auto; }
.cp-popup-content .wp-block-image { margin-inline: auto; }
.cp-popup-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  margin: -14px -14px 8px 14px;
  width: 42px;
  height: 42px;
  border: 1px solid #bcaa88;
  border-radius: 100%;
  background: #fff;
  color: #332613;
  font: 30px/38px Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}
.cp-popup-close:hover, .cp-popup-close:focus-visible { background: #f4e8d0; }
.cp-popup-close:focus-visible, .cp-popup-cta:focus-visible {
  outline: 3px solid #765719;
  outline-offset: 3px;
}
.cp-popup-actions { margin-top: 24px; text-align: center; }
.cp-popup-cta {
  display: inline-block;
  max-width: 100%;
  padding: 12px 22px;
  border-radius: 8px;
  background: #765719;
  color: #fff !important;
  text-align: center;
  font-weight: 700;
  text-decoration: none !important;
}
.cp-popup-cta:hover { background: #5a400d; }
@media (max-width: 600px) {
  .cp-popup-panel { max-height: 86dvh; border-radius: 12px; padding: 20px; }
  .cp-popup-close { margin: -10px -10px 12px 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cp-popup-panel { animation: cp-popup-in .18s ease-out; }
  @keyframes cp-popup-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
}
