.wd-demo-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  box-sizing: border-box;
  padding: clamp(12px, 1.5vw, 20px);
}

.wd-demo-modal.is-open {
  display: grid;
  place-items: center;
}

.wd-demo-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 18, .72);
  backdrop-filter: blur(10px);
}

.wd-demo-modal__dialog {
  position: relative;
  width: min(1440px, 100%);
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: clamp(190px, 20vw, 280px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "header header"
    "tabs body"
    "tabs nav";
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: #101820;
  color: #fff;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .45);
}

.wd-demo-modal__header {
  grid-area: header;
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.wd-demo-modal__header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  color: #fff;
}

.wd-demo-modal__close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.wd-demo-modal__tabs {
  grid-area: tabs;
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .025);
}

.wd-demo-modal__tab {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .72);
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.wd-demo-modal__tab.is-active {
  background: #fff;
  color: #111827;
}

.wd-demo-modal__select-wrap {
  display: none;
}

.wd-demo-modal__body {
  grid-area: body;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #fff;
  color: #17202a;
}

.wd-demo-modal__nav {
  grid-area: nav;
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  background:
    radial-gradient(circle at 50% 0, rgba(210, 9, 89, .08), transparent 42%),
    #f8fafc;
}

.wd-demo-modal__nav-button {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, .14);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .09);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.wd-demo-modal__nav-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wd-demo-modal__nav-button:hover {
  border-color: rgba(210, 9, 89, .42);
  background: #fff5f8;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(210, 9, 89, .14);
}

.wd-demo-modal__nav-button:focus-visible {
  outline: 3px solid rgba(210, 9, 89, .28);
  outline-offset: 3px;
}

.wd-demo-modal__nav-button--next {
  background: #D20959;
  border-color: #D20959;
  color: #fff;
  box-shadow: 0 12px 30px rgba(210, 9, 89, .28);
}

.wd-demo-modal__nav-button--next:hover {
  background: #a80747;
  border-color: #a80747;
  color: #fff;
}

.wd-demo-modal__panel > :first-child {
  margin-top: 0;
}

.wd-demo-modal__panel > :last-child {
  margin-bottom: 0;
}

.wd-demo-modal__panel,
.wd-demo-modal__panel figure {
  max-width: 100%;
}

.wd-demo-modal__panel img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wd-demo-modal__panel video,
.wd-demo-modal__panel iframe {
  display: block;
  width: 100%;
  max-width: 100%;
}

.wd-demo-modal__panel video {
  height: auto;
}

.wd-demo-modal__panel iframe[src*="youtube.com/embed/"],
.wd-demo-modal__panel iframe[src*="youtube-nocookie.com/embed/"],
.wd-demo-modal__panel iframe[src*="player.vimeo.com/video/"] {
  height: auto;
  aspect-ratio: 16 / 9;
}

.wd-demo-modal__panel .wp-video,
.wd-demo-modal__panel .mejs-container {
  width: 100% !important;
  max-width: 100%;
}

.wd-demo-modal__panel pre {
  overflow: auto;
  padding: 16px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
}

body.wd-demo-modal-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .wd-demo-modal {
    padding: 8px;
  }

  .wd-demo-modal__dialog {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "header"
      "select"
      "body"
      "nav";
    border-radius: 12px;
  }

  .wd-demo-modal__header,
  .wd-demo-modal__body,
  .wd-demo-modal__nav {
    padding: 16px;
  }

  .wd-demo-modal__tabs {
    display: none;
  }

  .wd-demo-modal__select-wrap {
    grid-area: select;
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: #f8fafc;
    color: #17202a;
  }

  .wd-demo-modal__select-wrap label {
    display: block;
    margin-bottom: 5px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .wd-demo-modal__select-wrap select {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    border: 1px solid rgba(17, 24, 39, .22);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    padding: 8px 36px 8px 10px;
    font: inherit;
  }

  .wd-demo-modal__nav {
    gap: 10px;
  }

  .wd-demo-modal__nav-button {
    width: 42px;
    height: 42px;
  }
}
