/* WiFi4Rent mobile fixes - loaded after the theme's responsive.css */

/* ---------- Page width ---------- */
/* Stops sideways scrolling caused by carousel arrows that sit outside their container.
   "clip" (unlike "hidden") does not turn body into a scroll container, so window scroll events keep working. */
@supports (overflow: clip) {
  html,
  html body {
    overflow-x: clip;
  }
}

/* ---------- Buttons that replaced role="button" divs ---------- */
button.hamburger {
  border: 0;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
button.close-sidebar {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  line-height: 1;
  text-align: right;
  cursor: pointer;
}
.hamburger:focus-visible,
.close-sidebar:focus-visible,
.w4r-submenu-toggle:focus-visible,
#sidebar1 a:focus-visible,
.offcanvas-div button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- Mobile menu ---------- */
.w4r-menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  z-index: 2147483000;
}
.w4r-menu-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

@media screen and (max-width: 1024px) {
  #sidebar1.w4r-sidebar {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: var(--w4r-menu-width, 250px);
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    z-index: 2147483001;
  }
  #sidebar1.w4r-sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.3s ease;
  }

  /* Collapsible submenus (the theme forced every submenu open with !important). */
  #sidebar1.w4r-has-toggles .side-navigation li.menu-item-has-children,
  #sidebar1.w4r-has-toggles .side-navigation li.page_item_has_children {
    position: relative;
  }
  #sidebar1.w4r-has-toggles .side-navigation li.menu-item-has-children > a,
  #sidebar1.w4r-has-toggles .side-navigation li.page_item_has_children > a {
    display: block;
    padding-right: 48px;
  }
  #sidebar1.w4r-has-toggles .side-navigation li.menu-item-has-children > a:after,
  #sidebar1.w4r-has-toggles .side-navigation li.page_item_has_children > a:after {
    content: none;
  }
  #sidebar1.w4r-has-toggles .side-navigation ul ul {
    display: none !important;
  }
  #sidebar1.w4r-has-toggles .side-navigation li.w4r-sub-open > ul {
    display: block !important;
  }
  #sidebar1 .w4r-submenu-toggle {
    position: absolute;
    top: 2px;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  #sidebar1 .w4r-submenu-toggle i {
    transition: transform 0.2s ease;
  }
  #sidebar1 li.w4r-sub-open > .w4r-submenu-toggle i {
    transform: rotate(180deg);
  }
}

@media screen and (min-width: 1025px) {
  #sidebar1.w4r-sidebar,
  .w4r-menu-overlay {
    display: none !important;
  }
}

/* While the menu or side panel is open: lock the page behind it and hide the back-to-top button,
   whose theme z-index would otherwise sit above the menu. */
html.w4r-menu-open {
  overflow: hidden;
}
html.w4r-menu-open .scrollup,
html.w4r-panel-open .scrollup {
  display: none !important;
}

/* ---------- Header side panel (Bootstrap offcanvas) ---------- */
/* The panel is moved to the end of <body> by custom.js; these values keep it and its backdrop above the sticky header. */
.offcanvas-backdrop {
  z-index: 2147483002;
}
.w4r-portal .offcanvas {
  z-index: 2147483003;
}
.offcanvas-div .offcanvas-end {
  max-width: 100vw;
}
@media screen and (max-width: 575px) {
  .offcanvas-div .offcanvas-header {
    margin-right: 0;
    margin-top: 10px;
  }
  .offcanvas-div .offcanvas-body {
    padding: 1rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sidebar1.w4r-sidebar,
  #sidebar1.w4r-sidebar.is-open,
  .w4r-menu-overlay,
  .w4r-menu-overlay.is-visible,
  #sidebar1 .w4r-submenu-toggle i {
    transition: none;
  }
}
