.eglm-load-more,
[data-eglm-enabled="1"] .elementor-button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.eglm-load-more::before,
.eglm-load-more::after,
[data-eglm-enabled="1"] .elementor-button::before,
[data-eglm-enabled="1"] .elementor-button::after {
  pointer-events: none;
}

.eglm-interaction-lock,
.eglm-interaction-lock * {
  pointer-events: none !important;
}

.eglm-interaction-lock + [data-eglm-enabled="1"],
.eglm-interaction-lock ~ [data-eglm-enabled="1"] {
  opacity: 0.6 !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease;
}

.elementor-gallery__container.eglm-is-compacted {
  overflow: hidden !important;
}

/* Override Elementor's gallery height/aspect-ratio system */
.elementor-gallery__container.eglm-managed-gallery {
  height: auto !important;
  overflow: visible !important;
  --container-aspect-ratio: none !important;
}

/* Prevent Elementor's gallery from using padding-bottom aspect ratio trick */
.elementor-gallery__container.eglm-managed-gallery::before {
  content: none !important;
  padding-bottom: 0 !important;
}

/* Disable ALL Elementor animations on managed items */
.elementor-gallery__container.eglm-managed-gallery .eglm-managed-item {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  will-change: opacity;
  contain: layout style;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  animation: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* Promote background-image divs to own compositing layer on Safari
   to prevent re-decode/flash when parent styles change */
.elementor-gallery__container.eglm-managed-gallery .eglm-managed-item .e-gallery-image {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Lock opacity on items that have completed their reveal — prevents Elementor's
   animation handler from resetting opacity on visible items */
.elementor-gallery__container.eglm-managed-gallery .eglm-visible {
  opacity: 1 !important;
  transition: none !important;
}

.elementor-gallery__container.eglm-managed-gallery .eglm-hidden-item {
  display: none !important;
}

/* Prevent Elementor gallery animated class from causing layout shifts */
.elementor-gallery__container.eglm-managed-gallery.e-gallery--animated .eglm-managed-item {
  animation: none !important;
  animation-duration: 0s !important;
}

@media (max-width: 767px) {
  .elementor-gallery__container.eglm-managed-gallery {
    display: grid !important;
    gap: var(--hgap, 10px) !important;
    grid-gap: var(--hgap, 10px) !important;
    grid-template-columns: repeat(var(--columns, 2), minmax(0, 1fr)) !important;
  }
}
