.mm-gallery {
  display: grid;
  gap: 12px;
}

.mm-gallery-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #2f3940;
  border-radius: 18px;
  background: #090d10;
}

.mm-gallery-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.mm-gallery-main img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #070a0c;
}

.mm-gallery-arrow,
.mm-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(5,9,11,.76);
  color: #fff;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.mm-gallery-arrow:hover,
.mm-lightbox-arrow:hover {
  border-color: #dfff00;
  color: #dfff00;
}

.mm-gallery-prev,
.mm-lightbox-prev {
  left: 14px;
}

.mm-gallery-next,
.mm-lightbox-next {
  right: 14px;
}

.mm-gallery-counter,
.mm-gallery-expand {
  position: absolute;
  bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(5,9,11,.78);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.mm-gallery-counter {
  right: 12px;
}

.mm-gallery-expand {
  left: 12px;
}

.mm-gallery-thumbs {
  display: grid;
  grid-auto-columns: 108px;
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.mm-gallery-thumb {
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #11181c;
  cursor: pointer;
}

.mm-gallery-thumb.is-active {
  border-color: #dfff00;
}

.mm-gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mm-gallery-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid #2f3940;
  border-radius: 18px;
  background: #0a0f12;
  color: #859198;
}

.mm-lightbox[hidden] {
  display: none;
}

.mm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.mm-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.92);
}

.mm-lightbox-dialog {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
}

.mm-lightbox-dialog img {
  display: block;
  max-width: 94vw;
  max-height: 84vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .2s ease;
}

.mm-lightbox-dialog img.is-zoomed {
  cursor: zoom-out;
  transform: scale(1.45);
}

.mm-lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: rgba(10,14,17,.78);
  color: #fff;
  cursor: pointer;
  font-size: 30px;
}

.mm-lightbox-close:hover {
  border-color: #dfff00;
  color: #dfff00;
}

.mm-lightbox-counter {
  position: absolute;
  bottom: 24px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(10,14,17,.8);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.mm-lightbox-dialog small {
  position: absolute;
  bottom: 2px;
  color: #9ca7ad;
  font-size: 11px;
}

body.mm-lightbox-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .mm-gallery-main img {
    aspect-ratio: 4 / 3;
  }

  .mm-gallery-arrow {
    width: 40px;
    height: 40px;
  }

  .mm-gallery-expand {
    display: none;
  }

  .mm-gallery-thumbs {
    grid-auto-columns: 82px;
  }

  .mm-lightbox-dialog {
    inset: 12px;
  }

  .mm-lightbox-arrow {
    width: 42px;
    height: 42px;
  }

  .mm-lightbox-dialog img.is-zoomed {
    transform: scale(1.2);
  }
}


/* MotoMarket.ba — premium galerija V2 */
.mm-gallery {
  gap: 14px;
}

.mm-gallery-stage {
  border-color: rgba(255,255,255,.11);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(223,255,0,.035), transparent 42%),
    #070a0c;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.mm-gallery-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.32));
}

.mm-gallery-main img {
  aspect-ratio: 16 / 10;
  padding: 8px;
  object-fit: contain;
  transition: transform .38s ease, filter .38s ease;
}

.mm-gallery-stage:hover .mm-gallery-main img {
  transform: scale(1.012);
  filter: contrast(1.02) saturate(1.02);
}

.mm-gallery-arrow,
.mm-lightbox-arrow {
  z-index: 5;
  width: 50px;
  height: 50px;
  border-color: rgba(255,255,255,.16);
  background: rgba(4,7,8,.74);
  box-shadow: 0 12px 28px rgba(0,0,0,.26);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.mm-gallery-arrow:hover,
.mm-lightbox-arrow:hover {
  transform: translateY(-50%) scale(1.06);
}

.mm-gallery-counter,
.mm-gallery-expand {
  z-index: 5;
  bottom: 16px;
  padding: 9px 12px;
  border-color: rgba(255,255,255,.14);
  background: rgba(4,7,8,.72);
}

.mm-gallery-counter {
  right: 16px;
}

.mm-gallery-expand {
  left: 16px;
}

.mm-gallery-thumbs {
  grid-auto-columns: 118px;
  gap: 11px;
  padding: 3px 2px 7px;
}

.mm-gallery-thumb {
  border-radius: 13px;
  opacity: .62;
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}

.mm-gallery-thumb:hover {
  opacity: .88;
  transform: translateY(-2px);
}

.mm-gallery-thumb.is-active {
  opacity: 1;
  border-color: #dfff00;
  box-shadow: 0 0 0 3px rgba(223,255,0,.08);
}

.mm-gallery-empty {
  min-height: 480px;
  border-radius: 24px;
}

.mm-lightbox-backdrop {
  background: rgba(0,0,0,.95);
  backdrop-filter: blur(8px);
}

@media (max-width: 700px) {
  .mm-gallery-stage {
    border-radius: 18px;
  }

  .mm-gallery-main img {
    padding: 0;
  }

  .mm-gallery-thumbs {
    grid-auto-columns: 88px;
  }
}


/* MotoMarket.ba — kompaktnija galerija FINAL V2 */
.mm-gallery-stage {
  max-height: 610px;
}

.mm-gallery-main img {
  max-height: 590px;
  aspect-ratio: 16 / 9;
}

@media (min-width: 1051px) {
  .mm-gallery-stage {
    min-height: 480px;
  }

  .mm-gallery-main img {
    min-height: 480px;
  }
}

@media (max-width: 700px) {
  .mm-gallery-stage,
  .mm-gallery-main img {
    min-height: 0;
    max-height: none;
  }

  .mm-gallery-main img {
    aspect-ratio: 4 / 3;
  }
}


/* MotoMarket.ba — završno poliranje galerije V3 */
.mm-gallery-expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mm-expand-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

.mm-expand-icon::before,
.mm-expand-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border: solid currentColor;
  border-width: 2px 0 0 2px;
}

.mm-expand-icon::after {
  transform: rotate(180deg);
}

.mm-gallery-thumbs:empty {
  display: none;
}
