﻿.imgForMobile {
  display: none;
}

.zoom-container {
  display: flex;
  width: 100%;
  flex-direction: row-reverse;
  gap: 14px;
  justify-content: flex-end;
  align-items: stretch;
}

.zoom-container > .cloud-zoom-image {
  position: relative;
  flex: 1;
  width: calc(100% - 104px);
  max-width: none;
  height: 581px;
  border-radius: 6px;
  background: #f1f5f9;
  overflow: hidden;
  box-sizing: border-box;
  padding: 16px;
}

.cloud-zoom-thumb-container {
  position: relative;
  flex: 0 0 90px;
  width: 90px;
  height: 581px;
  padding: 0 !important;
  box-sizing: border-box;
  overflow: hidden;
}

.cloud-zoom-thumb-container .swiper-wrapper {
  height: 100%;
}

.swiper-initialized .cloud-zoom-thumb {
  width: 100%;
  height: 105px;
  border: 1px solid var(--light-grey);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
}

a.src-zoom-anchor {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

/* Thumbnails only — cover */
img.src-zoom-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.thumb-next,
.thumb-prev {
  position: absolute;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  padding: 0;
  border-radius: 4px;
  background: var(--theme-color);
  color: var(--white);
  cursor: pointer;
  font-size: 0;
}

.thumb-prev {
  top: 5px;
}

.thumb-next {
  bottom: 5px;
}

.thumb-prev::before,
.thumb-next::before {
  font-family: 'icomoon' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-size: 10px;
  line-height: 1;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Up chevron */
.thumb-prev::before {
  content: '\e992';
}

/* Down chevron */
.thumb-next::before {
  content: '\e98b';
}

/* Hide nav when no more slides in that direction */
.thumb-prev.swiper-button-disabled,
.thumb-next.swiper-button-disabled {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.zoom-container > .cloud-zoom-image > a.cloud-zoom,
.zoom-container > .cloud-zoom-image #wrap > a.cloud-zoom {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

/* Main / selected image — contain, never crop */
.zoom-container > .cloud-zoom-image > img.cloud-zoom-image,
.zoom-container > .cloud-zoom-image img.cloud-zoom-image-size,
.zoom-container > .cloud-zoom-image #wrap img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center;
  mix-blend-mode: normal;
}

.zoom-container > .cloud-zoom-image #wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
  background: #f1f5f9;
  box-sizing: border-box;
  /* cloud-zoom sets inline z-index:9999; keep lens usable but under overlays */
  z-index: 1 !important;
}

/* Ribbons overlay main picture only (above cloud-zoom #wrap) */
.zoom-container > .cloud-zoom-image > .product-ribbon,
.zoom-container > .cloud-zoom-image > .offer-content {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10001;
  pointer-events: none;
}

/* Wishlist overlay main picture */
.zoom-container > .cloud-zoom-image > .add-to-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10002;
  width: auto;
  margin: 0;
}

@media (max-width: 1200px) {
  .zoom-container > .cloud-zoom-image,
  .cloud-zoom-thumb-container {
    height: 520px;
  }
}

@media (max-width: 1024px) {
  .zoom-container {
    flex-direction: column;
    gap: 10px;
  }

  /* Full-bleed main image — no padding / background */
  .zoom-container > .cloud-zoom-image,
  .product-details-page .zoom-container > .cloud-zoom-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 6px;
  }

  .zoom-container > .cloud-zoom-image #wrap,
  .product-details-page .zoom-container > .cloud-zoom-image #wrap {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border-radius: 6px;
  }

  .zoom-container > .cloud-zoom-image > a.cloud-zoom,
  .zoom-container > .cloud-zoom-image #wrap > a.cloud-zoom,
  .product-details-page .zoom-container > .cloud-zoom-image a.cloud-zoom,
  .product-details-page .zoom-container > .cloud-zoom-image #wrap > a.cloud-zoom {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
  }

  .zoom-container > .cloud-zoom-image > img.cloud-zoom-image,
  .zoom-container > .cloud-zoom-image img.cloud-zoom-image-size,
  .zoom-container > .cloud-zoom-image #wrap img,
  .product-details-page .zoom-container > .cloud-zoom-image img.cloud-zoom-image,
  .product-details-page .zoom-container > .cloud-zoom-image img.cloud-zoom-image-size,
  .product-details-page .zoom-container > .cloud-zoom-image #wrap img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center;
  }

  /* Hide thumbs on mobile when product has only one image */
  .cloud-zoom-thumb-container.single-image {
    display: none !important;
  }

  .cloud-zoom-thumb-container,
  .product-details-page .cloud-zoom-thumb-container {
    width: 100%;
    height: auto;
    flex: none;
    padding: 0 !important;
    overflow: hidden;
  }

  .cloud-zoom-thumb-container .swiper-wrapper {
    height: auto;
    justify-content: flex-start;
  }

  /* Mobile thumbs: 51×60 */
  .swiper-initialized .cloud-zoom-thumb {
    width: 51px;
    height: 60px;
    aspect-ratio: auto;
  }

  a.src-zoom-anchor {
    height: 100%;
  }

  /* Horizontal thumb nav — overlay, keep thumbs flush left */
  .thumb-next,
  .thumb-prev {
    display: flex !important;
    top: 50%;
    bottom: auto;
    left: auto;
    right: auto;
    margin-left: 0;
    transform: translateY(-50%);
    z-index: 2;
  }

  .thumb-prev {
    left: 0;
  }

  .thumb-next {
    right: 0;
  }

  .thumb-prev::before {
    content: '\e98c'; /* left */
  }

  .thumb-next::before {
    content: '\e98d'; /* right */
  }

  .thumb-prev.swiper-button-disabled,
  .thumb-next.swiper-button-disabled {
    display: none !important;
  }
}
