#p-main-img .prod-image {
  position: relative;
}

.swiper {
  width: 100%;
  aspect-ratio: 1 / 1;
}


.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center; 
  aspect-ratio: 1 / 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #fff;
}

.swiper-slide img,
.swiper-slide video,
.swiper-slide iframe {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.youtube-thumbnail {
  position: relative;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  flex: 1;
}

.vidplay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  transition: all 0.3s;
}

.vidplay-btn::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
}

.youtube-thumbnail:hover .vidplay-btn {
  background: rgba(255, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.swiper-slide iframe {
  width: 100%;
  height: 95%;
  position: absolute;
  inset: 0;
  border:0;
}


.swiper-slide .bg {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  transform: scale(1.1);
  opacity: 0.3;
  z-index: 1;
  contain: paint;
}

.swiper-slide img,
.swiper-slide video,
.youtube-thumbnail {
  position: relative;
  z-index: 2;
}

.swiper-slide video {
  inset: 0;
  width: 100%;
  height: 95%;
  object-fit: contain;
  background: black;
}

/*product thumbs*/
#swiper-thumbs {
  margin-top: 10px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
}

#swiper-thumbs .swiper-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#swiper-thumbs img {
  width: 100%;
  height: 100%;
  /*object-fit: cover;*/
  object-fit: contain;
}

.thumb-more {
  cursor: pointer;
  font-size: 2em;
  background: none;
  color: black;
  font-weight: initial;
  font-size: 1.5em;
}
.thumb-more:hover {
  background: #f0f0f0;
}

.swg-thumb .vidplay-btn,
#swiper-thumbs .vidplay-btn {
  z-index: 3;
  height: 30px;
  width: 30px;
  font-size: 20px;
  background: rgba(255, 0, 0, 0.84);
}

/*main swiper gallery*/
#sw-gal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.swiper-mainpanel {
  width: 70%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
#sw-gal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Full-width panel */
.swg-panel {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: row;
  transform: scale(0.95);
  transition: transform 0.4s ease, opacity 0.3s ease;
}

#sw-gal.is-open .swg-panel {
  transform: scale(1);
}

/* main swiper */
.swg-main {
  height: 100%;
}

.swg-main img,
.swg-main video,
.swg-main iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* thumbs list */
.swg-thumbs-list {
  width: 30%;
  height: 100%;
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  overflow-y: auto;
  background: #eee;
  align-content: start;
}

.swg-thumb {
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  position: relative;
  box-shadow: 5px 5px 3px #cecece;
  padding: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.swg-thumb.active,
.swiper-thumb.active,
.swg-thumb:hover {
  opacity: 1;
  outline: 2px solid #35a1ff;
}

.swg-thumb img {
  width: 100%;
  /* height: 100%;*/
  object-fit: cover;
}

.swg-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;

  background: rgba(0, 0, 0, 0.6);
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 3px;
}

.swiper-customer-icon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 30px;
  height: 30px;
  background-color: white;
  background-image: url("/files/misc/photo-icon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 25px;
  border-radius: 50%;
  outline: 2px solid #ccc;
  outline-offset: 0; /* default */
}

.main-filter-cntrl,
.swiper-gal-cntrl {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  justify-content: center;
}

.main-filter-cntrl button,
.swiper-gal-cntrl button {
  cursor: pointer;
  border-radius: 50px;
  padding: 5px 20px;
  text-transform: initial;
  font-size: 1em;
  font-weight: 500;
  letter-spacing: initial;
}

.swiper-gal-cntrl button.active {
  opacity: 1;
  outline: 2px solid #35a1ff;
  border: none;
}
.main-filter-cntrl button:hover,
.swiper-gal-cntrl button:hover {
  background: #f0f0f0;
}

/*reviews*/
.sw-rev-overlay {
  position: absolute;
  bottom: 18px;
  left: 40px;
  max-width: calc(100% - 80px); 
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 4px;
  z-index: 3;
  font-size: 1em;
  max-height: 90%;
  display: flex;
  flex-direction: column;
}
#sw-gal .sw-rev-overlay {
	 max-width: calc(100% - 80px - max(0px, 50vw - 600px));
} 
.sw-rev-header {
  position: relative;
  height: 16px;
  padding: 6px;
  flex-shrink: 0;
  display: none;
}
.sw-rev-content {
  padding: 0 8px 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sw-rev-overlay.expanded .sw-rev-content {
  padding-top: 7px;
}
.sw-rev-overlay.expanded .sw-rev-text {
  text-wrap: initial;
  overflow: initial;
}
.sw-rev-overlay.expanded .toggle-review {
  display: none;
}
.sw-rev-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: #000;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
}

.sw-rev-close:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
}

.sw-rev-overlay.expanded .sw-rev-header {
  display: block;
  right: 0;
}

.sw-rev-user-info {
  padding-bottom: 5px;
  line-height: 1.2;
}

.sw-rev-rating {
  color: #ffcc00;
  letter-spacing: 2px;
  font-size: 1.5em;
}

.sw-rev-author {
  font-weight: bold;
}
.sw-rev-text {
  text-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.textwrap {
  display: flex;
  width: 100%;
}
.toggle-review {
  display: block;
  text-wrap: nowrap;
  text-decoration: underline;
  color: white;
  cursor: pointer;
}
.sw-rev-title {
  font-style: italic;
}

@media (max-width: 768px) {
  .swiper-mainpanel {
    width: 100%;
  }

  .swg-panel {
    flex-direction: column;
    height: 100dvh;
  }
  .swg-main {
    flex: 1 1 auto; /* fills remaining space */
    min-height: 0; /* VERY important for flex children */
    width: 100%;
  }

  #sw-gal.is-open .swg-panel {
    transform: translateY(0);
  }

  .swg-panel {
    transform: translateY(100%);
    transition: transform 0.4s ease, opacity 0.3s ease;
  }

  .swg-thumbs-list {
    flex: 0 0 150px;
    height: 150px;
    min-height: 150px;

    padding: 5px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(100px, auto);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    width: 100%;
  }

  #sw-gal {
    padding: 0;
  }
}
@media screen and (min-width: 1000px) {
  #swiper-thumbs {
    flex-direction: column;
    position: absolute;
    top: 0;
    left: -20%;
  }
}
/*swiper overrides*/
.swiper-zoom-container {
  align-items: initial;
}
.swiper-button-prev svg,
.swiper-button-next svg {
  width: 20px;
  height: 20px;
}
.swiper-button-prev,
.swiper-button-next {
  border-radius: 50%; /* circular */
  background: rgba(255, 255, 255, 0.61);
  color: black;
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);
}
.swiper-button-prev:hover,
.swiper-button-next:hover {
  box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.15);
}
