/* Keep pages scrollable without displaying browser scrollbars. */
.mobile-property-menu-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 70px !important;
}

.mobile-property-menu-head > strong {
  min-width: 0;
  flex: 1;
}

.mobile-property-menu-head .property-sidebar-close {
  position: absolute !important;
  top: 50% !important;
  right: 18px !important;
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.14) !important;
  color: #fff !important;
  font: 400 25px/1 Inter, sans-serif !important;
  transform: translateY(-50%) !important;
  cursor: pointer;
}

.mobile-property-menu-head .property-sidebar-close:hover,
.mobile-property-menu-head .property-sidebar-close:focus-visible {
  background: #fff !important;
  color: #006b67 !important;
}

html,
body,
.mobile-profile-menu,
.profile-drawer,
.property-sidebar-links {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.mobile-profile-menu::-webkit-scrollbar,
.profile-drawer::-webkit-scrollbar,
.property-sidebar-links::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* A sidebar must never compete with the fixed mobile bottom navigation. */
.mob-nav {
  transition: opacity .2s ease, visibility .2s ease, transform .25s ease;
}

body.profile-menu-layer-open .mob-nav {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(120%) !important;
}

body:has(.mobile-side-menu.open) .mob-nav {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(120%) !important;
}

/* Desktop profile uses the same contextual right-side modal, not a popover. */
@media (min-width: 769px) {
  .profile-popover {
    display: none !important;
  }

  .mobile-profile-menu {
    display: flex;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(390px, 92vw);
    max-height: none;
    height: 100dvh;
    flex-direction: column;
    padding: 26px;
    border-radius: 24px 0 0 24px;
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  }

  .mobile-profile-menu.open {
    transform: translateX(0);
  }

  .mobile-profile-menu-handle {
    display: none;
  }

  .mobile-profile-menu:has(.property-sidebar-links) {
    width: min(390px, 92vw);
    padding: 0;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .mobile-property-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 28px 24px;
    border-radius: 24px 0 0 0;
    background: #006b67;
    color: #fff;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .mobile-property-menu-head span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: #006b67;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .mobile-property-menu-head svg {
    width: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .property-sidebar-links {
    display: block !important;
    overflow-y: auto;
    padding: 8px 0 !important;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .property-sidebar-links > a {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    color: #3f4146;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .property-sidebar-icon svg {
    width: 21px;
    fill: none;
    stroke: currentColor;
  }

  .mobile-profile-menu:has(.property-sidebar-links) .property-sidebar-links strong {
    font: 500 14px Inter, sans-serif;
  }
}

@media (max-width: 390px) {
  .mobile-property-menu-head {
    gap: 10px;
    padding-right: 58px !important;
  }

  .mobile-property-menu-head .property-sidebar-close {
    right: 12px !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 22px !important;
  }
}
