/* Platecraft Addons – popups (Popup widget, Platecraft → Popups). A popup is a
   <dialog>; sizes and colors are CSS variables or widget style controls. */

/* ---------- The button ---------- */
.plp .plp__row {
  display: flex;
  justify-content: var(--plp-justify, flex-start);
}
.plp .plp__open {
  display: inline-flex;
  flex: var(--plp-grow, 0) 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 14px 28px;
  border: 0 solid transparent;
  border-radius: 999px;
  background-color: #222;
  box-shadow: var(--pl-popup-button-shadow, none);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.plp .plp__open:hover,
.plp .plp__open:focus-visible {
  background-color: #000;
  box-shadow: var(--pl-popup-button-shadow-h, var(--pl-popup-button-shadow, none));
  color: #fff;
}
.plp__icon {
  display: inline-flex;
  font-size: var(--plp-icon, 1em);
  line-height: 1;
}
.plp__icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}
.plp__notice {
  margin: 8px 0 0;
  padding: 10px 14px;
  background: #fff8e5;
  color: #1d2327;
  font-size: 13px;
}

/* ---------- The popup ---------- */
dialog.pl-popup {
  box-sizing: border-box;
  width: var(--pl-popup-w, 600px);
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: var(--pl-popup-pad, 24px);
  overflow: auto;
  border: 0 solid transparent;
  border-radius: var(--pl-popup-radius, 16px);
  background-color: var(--pl-popup-bg, #fff);
  box-shadow: var(--pl-popup-popup-shadow, 0 24px 60px rgba(0, 0, 0, 0.25));
  color: inherit;
  overscroll-behavior: contain;
}
dialog.pl-popup::backdrop {
  background-color: var(--pl-popup-overlay, rgba(10, 10, 10, 0.6));
}
dialog.pl-popup:not([open]) {
  display: none;
}
dialog.pl-popup.is-preview {
  position: relative;
  display: block;
  margin: 20px auto 0;
}

/* Places. */
dialog.pl-popup--top {
  margin-top: 16px;
  margin-bottom: auto;
}
dialog.pl-popup--bottom {
  margin-top: auto;
  margin-bottom: 16px;
}
dialog.pl-popup--left,
dialog.pl-popup--right {
  width: var(--pl-popup-w, 420px);
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
}
dialog.pl-popup--left {
  margin-right: auto;
}
dialog.pl-popup--right {
  margin-left: auto;
}
dialog.pl-popup.is-preview.pl-popup--left,
dialog.pl-popup.is-preview.pl-popup--right {
  height: auto;
}

/* Animations. */
dialog.pl-popup--anim-zoom[open] {
  animation: pl-popup-zoom 0.28s ease;
}
dialog.pl-popup--anim-fade[open] {
  animation: pl-popup-fade 0.3s ease;
}
dialog.pl-popup--anim-slide[open] {
  animation: pl-popup-slide-up 0.32s ease;
}
dialog.pl-popup--anim-slide.pl-popup--top[open] {
  animation-name: pl-popup-slide-down;
}
dialog.pl-popup--anim-slide.pl-popup--left[open] {
  animation-name: pl-popup-slide-right;
}
dialog.pl-popup--anim-slide.pl-popup--right[open] {
  animation-name: pl-popup-slide-left;
}
dialog.pl-popup.is-preview[open] {
  animation: none;
}
@keyframes pl-popup-zoom { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes pl-popup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-popup-slide-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes pl-popup-slide-down { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes pl-popup-slide-right { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes pl-popup-slide-left { from { transform: translateX(100%); } to { transform: none; } }

/* Close button. */
dialog.pl-popup .pl-popup__close {
  position: absolute;
  top: var(--pl-popup-close, 12px);
  right: var(--pl-popup-close, 12px);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 2em;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
dialog.pl-popup .pl-popup__close svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}
dialog.pl-popup .pl-popup__title {
  margin: 0 40px 16px 0;
}
.pl-popup__content > .elementor {
  width: 100%;
}
html.pl-popup-lock {
  overflow: hidden;
  padding-right: var(--pl-popup-gap, 0px);
}

@media (prefers-reduced-motion: reduce) {
  dialog.pl-popup[open] {
    animation: none;
  }
}
