html:has(:is(#whatsapp-unidades, #agendamento)[open]) {
  overflow: hidden;
}

:is(#whatsapp-unidades, #agendamento) {
  --margem: clamp(10px, 3vw, 24px);
  --lateral: max(var(--margem), env(safe-area-inset-left), env(safe-area-inset-right));
  --vertical: max(var(--margem), env(safe-area-inset-top), env(safe-area-inset-bottom));
  --recuo: clamp(16px, 4.7vw, 32px);
  width: min(29rem, calc(100% - 2 * var(--lateral)));
  max-width: none;
  max-height: calc(100vh - 2 * var(--vertical));
  max-height: calc(100dvh - 2 * var(--vertical));
  margin: auto;
  padding: var(--recuo);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: .65rem;
  border: 1px solid #d4ded5;
  border-radius: clamp(16px, 4vw, 24px);
  background: #fff;
  color: #20392b;
  box-shadow: 0 20px 64px #12371f33;
  overflow-wrap: anywhere;
}

:is(#whatsapp-unidades, #agendamento)::backdrop {
  background-color: rgb(16 40 29 / 54%);
  backdrop-filter: blur(3px);
}

:is(#whatsapp-unidades, #agendamento) .x {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #cbdacf;
  background: #f1f6f0;
  color: #23533c;
}

#whatsapp-unidades .wa-cabecalho,
#agendamento .dialog-top {
  gap: .8rem;
  align-items: center;
}

#whatsapp-unidades .wa-cabecalho h2,
#agendamento h2 {
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  line-height: 1.13;
  letter-spacing: -.043em;
  text-wrap: balance;
}

#agendamento h2 { margin: .65rem 0 .5rem; }
#agendamento #titulo-dialogo:focus { outline: 0; }
#whatsapp-unidades .wa-cabecalho h2 { margin: 0; }

#wa-instrucao, #pedido-info, #agendamento .nota-ag {
  font-size: 1rem;
  line-height: 1.45;
  color: #3d5445;
  margin: .5rem 0 1rem;
}

#whatsapp-unidades .wa-cidades h3 {
  color: #335641;
  font-size: .94rem;
}

#whatsapp-unidades .wa-cidades li a {
  min-height: 62px;
  padding: .6rem .45rem;
  gap: .65rem;
}

#whatsapp-unidades .wa-cidades li a > span { min-width: 0; }
#whatsapp-unidades .wa-cidades li small { color: #455c4c; font-size: .94rem; }
#whatsapp-unidades .wa-cidades li svg { margin: 0; }

#agendamento label {
  margin: .85rem 0 .35rem;
  font-size: 1rem;
  line-height: 1.35;
  color: #254732;
}

#agendamento select {
  display: block;
  min-width: 0;
  min-height: 48px;
  border-color: #758d7c;
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.35;
}

#agendamento select:disabled {
  opacity: 1;
  border-color: #a6b3a8;
  background-color: #f1f4f0;
  color: #536357;
  -webkit-text-fill-color: #536357;
}

#agendamento #ag-destino:not(:empty) {
  margin: .85rem 0;
  padding: .65rem .8rem;
  font-size: 1rem;
  line-height: 1.45;
}

#agendamento .nota-ag { margin: 1rem 0 .7rem; }

#agendamento :is(#ag-continuar, .ag-ver) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .6rem .7rem;
  text-align: center;
  white-space: normal;
  font-size: 1rem;
  line-height: 1.35;
}

#agendamento .ag-ver { margin: .25rem 0 0; }
#agendamento #ag-continuar[aria-disabled=true] { background: #e6ece6; color: #49584c; }

#agendamento :is(button, a, select):focus-visible,
#whatsapp-unidades :is(button, a):focus-visible {
  outline: 3px solid #0b6647;
  outline-offset: 2px;
}

@media (max-height: 500px) {
  :is(#whatsapp-unidades, #agendamento) {
    --margem: 8px;
    --recuo: 14px;
    scroll-padding-block-start: 3.8rem;
  }

  #whatsapp-unidades .wa-cabecalho, #agendamento .dialog-top {
    position: sticky;
    top: calc(-1 * var(--recuo));
    z-index: 1;
    padding-block: .15rem;
    background: #fff;
  }
  #whatsapp-unidades .wa-cidades section + section { margin-top: .8rem; }
}

@media (max-width: 359px) and (max-height: 500px) {
  #whatsapp-unidades .wa-cabecalho { position: static; }
  #whatsapp-unidades { scroll-padding-block-start: .65rem; }
}

@media (forced-colors: active) {
  :is(#whatsapp-unidades, #agendamento) .x { border-color: ButtonText; }
  #agendamento select { appearance: auto; background-image: none; }
  #agendamento select:disabled { -webkit-text-fill-color: GrayText; }
}
