.sd-popup {
  --sd-popup-surface: #fff;
  --sd-popup-accent: #174f43;
  --sd-popup-edge: #d3ded7;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--sd-popup-edge);
  border-radius: 8px;
  background: var(--sd-popup-surface);
  color: #242820;
  box-shadow: 0 16px 48px #0005;
  text-align: left;
  overscroll-behavior: contain;
}

.sd-popup:not([open]) { display: none; }
.sd-popup::backdrop { background: #10251ec2; }

.sd-popup--christmas {
  --sd-popup-surface: #fffaf1;
  --sd-popup-accent: #872c3c;
  --sd-popup-edge: #c49349;
  border-top: 5px solid var(--sd-popup-edge);
}

.sd-popup .sd-popup__image {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  background: #173a30;
}

.sd-popup .sd-popup__content { padding: 24px; }
.sd-popup:not(:has(.sd-popup__image)) .sd-popup__content { padding-top: 60px; }

.sd-popup #sd-popup-title {
  margin: 0 0 12px;
  color: var(--sd-popup-accent);
  font-size: 1.65rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sd-popup #sd-popup-text p {
  margin: 0 0 12px;
  color: inherit;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sd-popup a.sd-popup__link {
  box-sizing: border-box;
  display: block;
  margin-top: 18px;
  border-radius: 6px;
  padding: 11px 14px;
  background: var(--sd-popup-accent);
  color: #fff !important;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sd-popup a.sd-popup__link:hover { text-decoration: underline; }
.sd-popup .sd-popup__close-form { margin: 0; }

.sd-popup button.sd-popup__close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #d3ded7;
  border-radius: 50%;
  background: #fff;
  color: #173a30;
  cursor: pointer;
  font: 28px/1 system-ui, sans-serif;
}

.sd-popup :is(button, a):focus-visible {
  outline: 2px solid #173a30;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

@media (max-width: 480px), (max-height: 640px) {
  .sd-popup .sd-popup__image { height: min(144px, 24dvh); }
  .sd-popup .sd-popup__content { padding: 18px; }
  .sd-popup #sd-popup-title { font-size: 1.35rem; }
}
