.dental-pro-popup .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dental-pro-booking-page {
  padding: 16px 0 48px;
}

.dental-pro-booking-page__title {
  margin: 0 0 12px;
}

.dental-pro-booking-page__lead {
  margin: 0 0 24px;
  max-width: 42rem;
  color: #5c666c;
  font-size: 16px;
  line-height: 1.5;
}

.dental-pro-booking {
  width: 100%;
  margin: 0 0 24px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.dental-pro-booking__iframe {
  display: block;
  width: 100%;
  min-height: 800px;
  height: min(900px, 85vh);
  border: 0;
  background: #fff;
}

body.dental-pro-booking-route .button-wrapper-show-all-time-delayed {
  display: none !important;
}

/* Popup */
html.dental-pro-popup-open,
html.dental-pro-popup-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.dental-pro-popup[hidden] {
  display: none !important;
}

.dental-pro-popup {
  --dental-pro-accent: #778087;
  --dental-pro-accent-hover: #656e74;
  --dental-pro-brand: #6b5f58;
  --dental-pro-chrome: #f7f6f4;
  --dental-pro-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dental-pro-dur: 0.38s;
  --dental-pro-safe-top: env(safe-area-inset-top, 0px);
  --dental-pro-safe-right: env(safe-area-inset-right, 0px);
  --dental-pro-safe-bottom: env(safe-area-inset-bottom, 0px);
  --dental-pro-safe-left: env(safe-area-inset-left, 0px);

  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.dental-pro-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 42, 48, 0.52);
  opacity: 0;
  transition: opacity var(--dental-pro-dur) ease;
}

.dental-pro-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(63, 58, 52, 0.18);
  overflow: visible;
  outline: none;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity var(--dental-pro-dur) ease,
    transform var(--dental-pro-dur) var(--dental-pro-ease);
}

.dental-pro-popup.is-open .dental-pro-popup__backdrop {
  opacity: 1;
}

.dental-pro-popup.is-open .dental-pro-popup__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dental-pro-popup.is-closing .dental-pro-popup__backdrop {
  opacity: 0;
}

.dental-pro-popup.is-closing .dental-pro-popup__dialog {
  opacity: 0;
  transform: translateY(12px) scale(0.99);
}

/* Desktop: no chrome bar — close floats on the dialog corner */
.dental-pro-popup__chrome {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
}

.dental-pro-popup__logo {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  color: var(--dental-pro-brand);
}

.dental-pro-popup__logo-svg {
  display: block;
  width: min(220px, 100%);
  height: auto;
  max-height: 18px;
}

.dental-pro-popup__close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.dental-pro-popup__close svg {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.dental-pro-popup__close-bg {
  transition: fill 0.25s ease;
}

.dental-pro-popup__close:hover .dental-pro-popup__close-bg,
.dental-pro-popup__close:focus-visible .dental-pro-popup__close-bg {
  fill: var(--dental-pro-accent-hover);
}

.dental-pro-popup__close:hover {
  transform: scale(1.03);
}

.dental-pro-popup__close:active {
  transform: scale(0.97);
}

.dental-pro-popup__close:focus-visible {
  outline: 2px solid var(--dental-pro-brand);
  outline-offset: 3px;
}

.dental-pro-popup__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
  border-radius: inherit;
  overflow: hidden;
}

.dental-pro-popup__iframe {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding-top: 60px;
  padding-bottom: 60px;
  border: 0;
  background: #fff;
}

/* Tablet / large phones — still roomy, not edge-to-edge */
@media (max-width: 1023px) {
  .dental-pro-popup {
    padding: 12px;
    align-items: stretch;
  }

  .dental-pro-popup__dialog {
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: none;
    border-radius: 20px;
  }
}

/* Phones — full-screen sheet, safe areas, one scroll surface (iframe) */
@media (max-width: 767px) {
  .dental-pro-popup {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .dental-pro-popup__backdrop {
    /* Full-screen sheet: backdrop barely visible, keep for fade */
    background: rgba(35, 42, 48, 0.35);
  }

  .dental-pro-popup__dialog {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transform: translateY(24px);
  }

  .dental-pro-popup.is-open .dental-pro-popup__dialog {
    transform: translateY(0);
  }

  .dental-pro-popup.is-closing .dental-pro-popup__dialog {
    transform: translateY(16px);
  }

  /* Mobile chrome with logo — close stays off the iframe title */
  .dental-pro-popup__chrome {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding-top: calc(6px + var(--dental-pro-safe-top));
    padding-right: calc(8px + var(--dental-pro-safe-right));
    padding-bottom: 6px;
    padding-left: calc(14px + var(--dental-pro-safe-left));
    background: var(--dental-pro-chrome);
    border-bottom: 1px solid rgba(119, 128, 135, 0.18);
    pointer-events: auto;
  }

  .dental-pro-popup__logo {
    display: flex;
  }

  .dental-pro-popup__logo-svg {
    width: min(180px, calc(100vw - 88px));
    max-height: 16px;
  }

  .dental-pro-popup__close {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .dental-pro-popup__close svg {
    width: 40px;
    height: 40px;
  }

  .dental-pro-popup__body {
    border-radius: 0;
    padding-bottom: var(--dental-pro-safe-bottom);
  }

  .dental-pro-popup__iframe {
    padding-top: 0;
    padding-bottom: 0;
  }

  .dental-pro-booking__iframe {
    min-height: 0;
    height: calc(100dvh - 120px);
  }
}

@media (max-width: 380px) {
  .dental-pro-popup__logo-svg {
    width: min(150px, calc(100vw - 84px));
    max-height: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dental-pro-popup__backdrop,
  .dental-pro-popup__dialog,
  .dental-pro-popup__close,
  .dental-pro-popup__close-bg {
    transition: none !important;
  }

  .dental-pro-popup__dialog {
    transform: none;
  }
}
