/**
 * Galerij carrousel: bij "buiten" pijlen buiten swiper (geen crop); bij "binnen" pijlen in swiper.
 */
.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-root {
  max-width: 100%;
}

.elementor-widget-autoflow_pro_gallery_carousel .elementor-image-carousel-wrapper {
  position: relative;
}

/* Wrapper positioning for outside pagination */
.elementor-widget-autoflow_pro_gallery_carousel .elementor-image-carousel-wrapper.swiper {
  position: relative;
}

.elementor-widget-autoflow_pro_gallery_carousel .elementor-image-carousel-wrapper .swiper-wrapper {
  align-items: center;
}

.elementor-widget-autoflow_pro_gallery_carousel .elementor-image-carousel-wrapper .swiper-slide {
  height: auto !important;
  box-sizing: border-box;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-slide a,
.elementor-widget-autoflow_pro_gallery_carousel .swiper-slide-inner {
  display: block;
  width: 100%;
  line-height: 0;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-slide-image {
  display: inline-block;
  max-width: 100%;
  width: auto;
  height: auto !important;
  vertical-align: middle;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-image-stretch .swiper-slide-image {
  display: block;
  width: 100%;
}

.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-outside .elementor-image-carousel-wrapper.swiper,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-outside .autoflow-carousel-outer .elementor-image-carousel-wrapper.swiper {
  padding-bottom: 0;
}

/* Outside pagination sibling (avoid overflow clip) */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-outside .autoflow-carousel-root > .swiper-pagination {
  position: relative;
  bottom: auto;
  top: auto;
  left: 0;
  width: 100%;
  margin-top: 10px;
  z-index: 20;
  pointer-events: auto;
}

/* Reset Elementor swiper button defaults */
.elementor-widget-autoflow_pro_gallery_carousel .elementor-swiper-button {
  background: none;
  border: none;
  width: auto;
  height: auto;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.elementor-widget-autoflow_pro_gallery_carousel .elementor-swiper-button svg {
  width: 1em;
  height: 1em;
}

/* Inside arrows above slides (z-index) */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-image-carousel-wrapper .swiper-slide,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-image-carousel-wrapper .swiper-slide a {
  z-index: 0;
}
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-image-carousel-wrapper.swiper .elementor-swiper-button-prev,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-swiper-button-prev {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - var(--autoflow-arrows-vertical-offset, 0px)));
  left: var(--autoflow-arrows-distance, 10px);
  right: auto;
  z-index: 50;
  pointer-events: auto;
  cursor: pointer;
}
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-image-carousel-wrapper.swiper .elementor-swiper-button-next,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-inside .elementor-swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - var(--autoflow-arrows-vertical-offset, 0px)));
  right: var(--autoflow-arrows-distance, 10px);
  left: auto;
  z-index: 50;
  pointer-events: auto;
  cursor: pointer;
}

/* Outside arrows: grid columns beside swiper */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside > .elementor-widget-container {
  overflow: visible;
}

.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-outer.autoflow-arrows-outside {
  display: grid;
  grid-template-columns: min-content minmax(0, 1fr) min-content;
  align-items: center;
  column-gap: 0;
  width: 100%;
  position: relative;
  overflow: visible;
  --autoflow-arrows-distance: 16px;
}

/* Override Elementor outside swiper width; grid handles layout */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside .autoflow-carousel-outer .elementor-image-carousel-wrapper.swiper {
  grid-column: 2;
  grid-row: 1;
  width: 100% !important;
  min-width: 0;
}

/* Nav buttons as swiper siblings */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside .autoflow-carousel-outer > .elementor-swiper-button-prev,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside .autoflow-carousel-outer > .elementor-swiper-button-next,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside .autoflow-carousel-outer .swiper ~ .elementor-swiper-button-prev,
.elementor-widget-autoflow_pro_gallery_carousel.elementor-arrows-position-outside .autoflow-carousel-outer .swiper ~ .elementor-swiper-button-next {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateY(calc(-1 * var(--autoflow-arrows-vertical-offset, 0px))) !important;
  align-self: center;
  flex-shrink: 0;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
  grid-row: 1;
}

.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-outer.autoflow-arrows-outside > .autoflow-carousel-arrow--prev,
.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-outer.autoflow-arrows-outside > .elementor-swiper-button-prev {
  grid-column: 1;
  margin-left: 0;
  margin-right: var(--autoflow-arrows-distance, 16px);
}

.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-outer.autoflow-arrows-outside > .autoflow-carousel-arrow--next,
.elementor-widget-autoflow_pro_gallery_carousel .autoflow-carousel-outer.autoflow-arrows-outside > .elementor-swiper-button-next {
  grid-column: 3;
  margin-right: 0;
  margin-left: var(--autoflow-arrows-distance, 16px);
}

/* Lightbox trigger on slide link */
.elementor-widget-autoflow_pro_gallery_carousel .swiper-slide a {
  cursor: zoom-in;
  display: block;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-slide figure {
  margin: 0;
  pointer-events: auto;
}

/* Pagination vertical offset */
.elementor-widget-autoflow_pro_gallery_carousel .swiper-pagination {
  left: 0;
  width: 100%;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(calc(-1 * var(--autoflow-dots-vertical-offset, 0)));
  z-index: 20;
  pointer-events: auto;
}

.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-outside .swiper-pagination {
  position: relative;
  bottom: 0;
}

.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-inside .swiper-pagination {
  position: absolute;
  margin-top: 0;
  bottom: 5px;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #ccc;
  opacity: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.elementor-widget-autoflow_pro_gallery_carousel .swiper-pagination-bullet-active {
  background: #000;
}

/* Inside pagination at bottom of swiper */
.elementor-widget-autoflow_pro_gallery_carousel.elementor-pagination-position-outside .elementor-image-carousel-wrapper.swiper > .swiper-pagination {
  position: absolute !important;
  bottom: 5px !important;
  top: auto !important;
}

/* Custom lightbox (Kit styles) */
.autoflow-gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--autoflow-lb-overlay, rgba(0, 0, 0, 0.9));
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.autoflow-gallery-lightbox--open {
  display: flex;
  flex-direction: column;
}

.autoflow-gallery-lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--autoflow-lb-close-bg, rgba(255, 255, 255, 0.2));
  color: var(--autoflow-lb-close-color, #fff);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}

.autoflow-gallery-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
}

.autoflow-gallery-lightbox-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
  max-height: calc(100vh - 140px);
  width: 100%;
}

.autoflow-gallery-lightbox-main img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.autoflow-gallery-lightbox-prev,
.autoflow-gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: var(--autoflow-lb-nav-bg, rgba(255, 255, 255, 0.2));
  color: var(--autoflow-lb-nav-color, #fff);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  z-index: 1;
}

.autoflow-gallery-lightbox-prev { left: 10px; }
.autoflow-gallery-lightbox-next { right: 10px; }

.autoflow-gallery-lightbox-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 15px 0 0;
  max-width: 100%;
  overflow-x: auto;
  flex-shrink: 0;
}

.autoflow-gallery-lightbox-thumb {
  flex: 0 0 auto;
  width: var(--autoflow-lb-thumb-size, 60px);
  height: var(--autoflow-lb-thumb-size, 60px);
  padding: 0;
  border: 2px solid var(--autoflow-lb-thumb-border, transparent);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
}

.autoflow-gallery-lightbox-thumb.active {
  border-color: var(--autoflow-lb-thumb-active, #fff);
}

.autoflow-gallery-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
