/**
 * Galerie anunț — mobil: o imagine mare + thumbs în slider orizontal
 */
.offer-gallery__main {
  border-radius: inherit;
  overflow: hidden;
}

.offer-gallery__main-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.offer-gallery__main-btn img,
.offer-gallery__main img[data-offer-gallery-main] {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.offer-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.offer-gallery__thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.offer-gallery__thumb.is-active,
.offer-gallery__thumb:hover {
  border-color: #2b7dff;
}

.offer-gallery__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.offer-gallery__lightbox-src {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  list-style: none;
}

@media (max-width: 767px) {
  .offer-gallery__main-btn {
    position: relative;
  }

  .offer-gallery__main-btn::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23fff' stroke-width='2' d='M4 8V4h4M20 16v4h-4M16 4h4v4M8 20H4v-4'/%3E%3C/svg%3E") center / 18px no-repeat;
    pointer-events: none;
  }

  .offer-gallery__thumbs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .offer-gallery__thumb {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    scroll-snap-align: start;
    border-radius: 8px;
  }

  .offer-gallery__thumb img {
    width: 72px;
    height: 54px;
    aspect-ratio: auto;
    object-fit: cover;
  }
}

/* V4 reference — nu mai forța toate img din galerie la 100% */
body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery.offer-gallery > .offer-gallery__main img,
body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery img#v4-ref-offer-main-img,
body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery img[data-offer-gallery-main] {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery-thumbs.offer-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

@media (max-width: 767px) {
  body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery-thumbs,
  body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-gallery-thumbs.offer-gallery__thumbs {
    display: flex;
    flex-wrap: nowrap;
    grid-template-columns: unset;
    overflow-x: auto;
  }

  body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-thumb {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
  }

  body.theme-v4.profile-v4_reference_samolet_plus .v4-ref-offer-thumb img {
    width: 72px;
    height: 54px;
    aspect-ratio: auto;
  }
}

@media (max-width: 767px) {
  body.theme-v6 .v6-offer__gallery-thumbs.offer-gallery__thumbs,
  body.theme-v7 .v6-offer__gallery-thumbs.offer-gallery__thumbs {
    display: flex;
    flex-wrap: nowrap;
    grid-template-columns: unset;
    overflow-x: auto;
    gap: 8px;
  }

  body.theme-v6 .v6-offer__thumb.offer-gallery__thumb,
  body.theme-v7 .v6-offer__thumb.offer-gallery__thumb {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
  }

  body.theme-v6 .v6-offer__thumb.offer-gallery__thumb img,
  body.theme-v7 .v6-offer__thumb.offer-gallery__thumb img {
    width: 72px;
    height: 54px;
    aspect-ratio: auto;
  }
}
