/*
 * Vedah Image Carousel — responsive frontend styles.
 * Uses viewport breakpoints and container queries so the widget also adapts
 * when placed inside narrow Elementor columns or nested containers.
 */

.vms-carousel,
.vms-carousel * {
  box-sizing: border-box;
}

.vms-carousel {
  --vms-lime: #B1E346;
  --vms-charcoal: #171A1A;
  --vms-arrow-size: 52px;
  --vms-arrow-bg: #B1E346;
  --vms-arrow-color: #171A1A;
  --vms-image-fit: contain;
  --vms-image-max-height: 760px;

  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: #fff;
  font-family: Manrope, Arial, sans-serif;
  container-name: vms-carousel;
  container-type: inline-size;
}

.vms-carousel__layout {
  display: grid;
  grid-template-columns: var(--vms-arrow-size) minmax(0, 1fr) var(--vms-arrow-size);
  align-items: center;
  column-gap: clamp(6px, 1.7cqi, 22px);
  width: 100%;
  max-width: min(1320px, 100%);
  min-width: 0;
  margin: 0 auto;
}

.vms-carousel__viewport {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 15px 45px rgba(0,0,0,.22);
  outline: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.vms-carousel__viewport:focus-visible {
  outline: 2px solid var(--vms-lime);
  outline-offset: 4px;
}

.vms-carousel__track {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  transform: translate3d(-100%, 0, 0);
  transition: transform var(--vms-speed, 480ms) cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}

.vms-carousel__slide {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.vms-carousel__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: var(--vms-image-max-height, 760px);
  max-height: min(var(--vms-image-max-height, 760px), 78vh);
  margin: 0 auto;
  object-fit: var(--vms-image-fit, contain);
  object-position: center;
  background: #fff;
}

.vms-carousel__arrow {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vms-arrow-size);
  height: var(--vms-arrow-size);
  min-width: 0;
  padding: 0;
  border: 1px solid var(--vms-arrow-bg);
  border-radius: 50%;
  background: var(--vms-arrow-bg);
  color: var(--vms-arrow-color);
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .22s ease, background .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.vms-carousel__arrow svg {
  display: block;
  width: clamp(16px, 2.2cqi, 22px);
  height: clamp(16px, 2.2cqi, 22px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vms-carousel__arrow:hover {
  border-color: #fff;
  background: #fff;
  color: #171A1A;
  box-shadow: 0 5px 20px rgba(177,227,70,.2);
}

.vms-carousel__prev:hover { transform: translateX(-3px); }
.vms-carousel__next:hover { transform: translateX(3px); }

.vms-carousel__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.vms-carousel__arrow:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.vms-carousel__empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 4vw, 32px);
  border: 1px dashed rgba(177,227,70,.6);
  border-radius: 12px;
  background: #171A1A;
  color: #fff;
  text-align: center;
}

.vms-carousel__empty strong { color: #B1E346; }
.vms-carousel__empty span { color: rgba(255,255,255,.7); font-size: 13px; }

/* Tablet and smaller laptop screens */
@media (max-width: 1024px) {
  .vms-carousel {
    --vms-arrow-size: 42px;
    --vms-image-max-height: 620px;
  }

  .vms-carousel__layout {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    column-gap: 14px;
  }

  .vms-carousel__arrow {
    width: 42px;
    height: 42px;
  }
}

/* Phones and narrow tablets */
@media (max-width: 767px) {
  .vms-carousel {
    --vms-arrow-size: 34px;
    --vms-image-max-height: 460px;
  }

  .vms-carousel__layout {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    column-gap: 8px;
  }

  .vms-carousel__arrow {
    width: 34px;
    height: 34px;
  }

  .vms-carousel__arrow svg {
    width: 17px;
    height: 17px;
  }

  .vms-carousel__viewport {
    border-radius: 10px;
  }
}

/* Small phones — keep image useful and arrows outside it */
@media (max-width: 480px) {
  .vms-carousel {
    --vms-arrow-size: 30px;
  }

  .vms-carousel__layout {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    column-gap: 6px;
  }

  .vms-carousel__arrow {
    width: 30px;
    height: 30px;
  }

  .vms-carousel__arrow svg {
    width: 15px;
    height: 15px;
  }

  .vms-carousel__viewport {
    border-radius: 8px;
  }
}

/* Very narrow phones / embedded columns */
@media (max-width: 360px) {
  .vms-carousel {
    --vms-arrow-size: 26px;
  }

  .vms-carousel__layout {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    column-gap: 5px;
  }

  .vms-carousel__arrow {
    width: 26px;
    height: 26px;
  }

  .vms-carousel__arrow svg {
    width: 14px;
    height: 14px;
  }
}

/* Container-aware rules: also work in narrow Elementor columns on desktop */
@container vms-carousel (max-width: 767px) {
  .vms-carousel__layout {
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
    column-gap: 8px !important;
  }

  .vms-carousel__arrow {
    width: 34px !important;
    height: 34px !important;
  }

  .vms-carousel__viewport {
    border-radius: 10px;
  }
}

@container vms-carousel (max-width: 480px) {
  .vms-carousel__layout {
    grid-template-columns: 30px minmax(0, 1fr) 30px !important;
    column-gap: 6px !important;
  }

  .vms-carousel__arrow {
    width: 30px !important;
    height: 30px !important;
  }

  .vms-carousel__arrow svg {
    width: 15px;
    height: 15px;
  }
}

@container vms-carousel (max-width: 360px) {
  .vms-carousel__layout {
    grid-template-columns: 26px minmax(0, 1fr) 26px !important;
    column-gap: 5px !important;
  }

  .vms-carousel__arrow {
    width: 26px !important;
    height: 26px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vms-carousel__track,
  .vms-carousel__arrow {
    transition: none !important;
  }
}

/* Click/tap affordance for the optional full-screen viewer */
.vms-carousel__image--zoomable {
  cursor: zoom-in;
}

.vms-carousel__image--zoomable:focus-visible {
  outline: 3px solid var(--vms-lime);
  outline-offset: -3px;
}

/*
 * Full-screen gallery viewer.
 * The viewer is portalled to <body>, locks page scrolling and confines
 * zoom/pan transforms to the displayed image only.
 */
html.vms-lightbox-open,
body.vms-lightbox-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.vms-lightbox,
.vms-lightbox * {
  box-sizing: border-box;
}

.vms-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: block !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  isolation: isolate;
  background: rgba(7,9,9,.985);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
  overscroll-behavior: contain;
  touch-action: none;
  transform: none !important;
  filter: none !important;
  -webkit-tap-highlight-color: transparent;
}

.vms-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.vms-lightbox__toolbar {
  position: absolute;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  pointer-events: none;
}

.vms-lightbox__counter {
  display: inline-flex;
  align-items: center;
  min-width: 54px;
  color: rgba(255,255,255,.9);
  font: 700 13px/1.2 Manrope, Arial, sans-serif;
  letter-spacing: .4px;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
  pointer-events: auto;
}

.vms-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.vms-lightbox__tool,
.vms-lightbox__close,
.vms-lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(31,35,34,.94);
  color: #fff;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, opacity .18s ease;
}

.vms-lightbox__tool:hover,
.vms-lightbox__close:hover,
.vms-lightbox__nav:hover {
  border-color: #B1E346;
  background: #B1E346;
  color: #171A1A;
}

.vms-lightbox__tool:focus-visible,
.vms-lightbox__close:focus-visible,
.vms-lightbox__nav:focus-visible {
  outline: 2px solid #B1E346;
  outline-offset: 3px;
}

.vms-lightbox__tool {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font: 600 13px/1 Manrope, Arial, sans-serif;
}

.vms-lightbox__tool svg,
.vms-lightbox__nav svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vms-lightbox__zoom-reset {
  min-width: 54px;
  padding: 0 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.vms-lightbox__tool:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.vms-lightbox__close {
  width: 42px;
  height: 42px;
  border-color: #B1E346;
  border-radius: 10px;
  background: #B1E346;
  color: #171A1A;
  font: 400 30px/1 Arial, sans-serif;
}

/* The stage clips zoom to this box. The website behind it never scales. */
.vms-lightbox__stage {
  position: absolute;
  z-index: 1;
  inset: 70px 12px 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: contain;
}

.vms-lightbox__stage.is-zoomed {
  cursor: grab;
}

.vms-lightbox__stage:active.is-zoomed {
  cursor: grabbing;
}

.vms-lightbox__image {
  position: relative;
  display: block !important;
  flex: 0 0 auto;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px;
  object-fit: contain !important;
  object-position: center center;
  background: #fff;
  box-shadow: 0 18px 70px rgba(0,0,0,.42);
  transform: translate3d(0,0,0) scale(1);
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.vms-lightbox__image.is-zoomed {
  /* Keep the image's fitted layout size; only its visual transform is scaled. */
}

.vms-lightbox__nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.vms-lightbox__prev { left: max(12px, env(safe-area-inset-left)); }
.vms-lightbox__next { right: max(12px, env(safe-area-inset-right)); }
.vms-lightbox__prev:hover { transform: translate(-3px,-50%); }
.vms-lightbox__next:hover { transform: translate(3px,-50%); }

.vms-lightbox [hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .vms-lightbox__toolbar {
    top: max(8px, env(safe-area-inset-top));
    left: max(9px, env(safe-area-inset-left));
    right: max(9px, env(safe-area-inset-right));
    min-height: 38px;
    gap: 6px;
  }

  .vms-lightbox__counter {
    min-width: 42px;
    font-size: 12px;
  }

  .vms-lightbox__actions { gap: 5px; }

  .vms-lightbox__tool {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .vms-lightbox__tool svg { width: 17px; height: 17px; }

  .vms-lightbox__zoom-reset {
    min-width: 46px;
    padding: 0 5px;
    font-size: 10px;
  }

  .vms-lightbox__close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 27px;
  }

  .vms-lightbox__stage {
    inset: 58px 2px 30px;
  }

  .vms-lightbox__nav {
    width: 34px;
    height: 34px;
  }

  .vms-lightbox__nav svg { width: 17px; height: 17px; }

  .vms-lightbox__prev { left: max(5px, env(safe-area-inset-left)); }
  .vms-lightbox__next { right: max(5px, env(safe-area-inset-right)); }
}

@media (max-width: 380px) {
  .vms-lightbox__actions { gap: 3px; }
  .vms-lightbox__tool,
  .vms-lightbox__close { width: 32px; height: 32px; }
  .vms-lightbox__zoom-reset { min-width: 40px; font-size: 9px; }
  .vms-lightbox__stage { inset: 54px 1px 25px; }
  .vms-lightbox__nav { width: 30px; height: 30px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .vms-lightbox__toolbar { top: 5px; }
  .vms-lightbox__tool,
  .vms-lightbox__close { width: 32px; height: 32px; }
  .vms-lightbox__stage { inset: 44px 2px 12px; }
  .vms-lightbox__nav { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .vms-lightbox,
  .vms-lightbox__tool,
  .vms-lightbox__close,
  .vms-lightbox__nav { transition: none !important; }
}
