/* === Desktop dropdown flyout submenus === */
@media (min-width: 1025px) {
  .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100%; left: 0;
    background: #fff !important;
    min-width: 220px; width: max-content; max-width: 320px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14) !important;
    z-index: 10000 !important;
  }
  .elementor-nav-menu--main .menu-item-has-children:hover > .sub-menu {
    display: block !important;
  }
  /* Nested flyout to the right */
  .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
    position: absolute !important;
    top: 0 !important; left: 100% !important;
    background: #fff !important;
    z-index: 10001 !important;
  }
}

/* === Mobile dropdown positioning === */
@media (max-width: 1024px) {
  /* Allow dropdown to escape the narrow column */
  .elementor-location-header .elementor-column,
  .elementor-location-header .elementor-widget-wrap,
  .elementor-location-header .elementor-widget-container,
  .elementor-location-header .elementor-widget-nav-menu {
    overflow: visible !important;
  }

  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    width: 100vw !important;
    max-height: calc(100vh - 80px) !important;
    height: auto !important;
    z-index: 99998 !important;
    background: #fff !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
  }

  .elementor-menu-toggle { z-index: 99999 !important; }

  .elementor-nav-menu--stretch .elementor-nav-menu__container.elementor-nav-menu--dropdown {
    position: fixed !important;
    width: 100vw !important;
    left: 0 !important;
  }
}

/* === Gallery Lightbox === */
#gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
}
#gallery-lightbox.gl-open {
  display: flex;
}
#gallery-lightbox .gl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}
#gallery-lightbox .gl-img-wrap {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gallery-lightbox .gl-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
}
#gallery-lightbox .gl-close {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 2;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
#gallery-lightbox .gl-close:hover {
  opacity: 1;
}
#gallery-lightbox .gl-prev,
#gallery-lightbox .gl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
#gallery-lightbox .gl-prev:hover,
#gallery-lightbox .gl-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.25);
}
#gallery-lightbox .gl-prev {
  left: 20px;
}
#gallery-lightbox .gl-next {
  right: 20px;
}
