/**
 * EmotionBox Gallery Styles with Swiper
 * Version: 2.0.0
 */

/* ===== MAIN STRUCTURE ===== */
.emotion-product-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  width: 100%;
  /* margin-bottom: 2rem; */
}

/* ===== THUMBNAIL SECTION ===== */
/* Container */
.emotion-thumbnails-container {
  width: 18%;
  max-height: 500px;
  position: relative;
  z-index: 10;
  /* Flex container for vertical layout */
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  overflow: visible; /* Hide any overflow */
}

/* Wrapper */
.emotion-thumbnails-wrapper {
  height: 100%;
  position: relative;
  overflow: visible;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.emotion-thumbnails-wrapper::-webkit-scrollbar {
  display: none;
}

/* Individual thumbnail items */
.emotion-thumbnail-item {
  padding: 0px;
  cursor: pointer;
  /* border: 2px solid transparent; */
  transform: scale(0.95);
  transition: all 0.3s ease;
  height: 150px; /* Fixed height */
  width: 150px; /* Fixed width */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto; /* Center thumbnails */
}

.emotion-thumbnail-item img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Active thumbnail */
.swiper-slide-thumb-active .emotion-thumbnail-item {
  border-color: transparent;
  border-radius: 5px;
  transform: scale(1);
}

.swiper-pagination {
  bottom: -2rem !important;
}

/* Thumbnail navigation buttons */
.thumbnail-button-prev,
.thumbnail-button-next {
  width: 36px !important;
  height: 36px !important;
  background: #f5f5f5;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin: 10px auto;
  position: relative;
  left: 0 !important;
  right: 0 !important;
  color: #333;
}

.thumbnail-button-prev:after,
.thumbnail-button-next:after {
  font-size: 18px;
  font-weight: bold;
}

.thumbnail-button-prev:hover,
.thumbnail-button-next:hover {
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  border-color: #b7bcbe;
}

#thumbnails-swiper .swiper-button-prev,
#thumbnails-swiper .swiper-button-next {
  left: 50% !important;
  right: unset !important;
  transform: translateX(-50%) rotate(90deg);
  height: 155px !important;
  width: 35px !important;
  box-shadow: none;
  border-radius: 0;
  background-color: rgba(255, 255, 255, 1);
  /* border-radius: 50%; */
  border: none;
  position: absolute;
  z-index: 10;
}

/* Fix Swiper button position for vertical slider */
#thumbnails-swiper {
  height: 100%;
}

#thumbnails-swiper .swiper-button-prev {
  top: -22% !important;
}

#thumbnails-swiper .swiper-button-next {
  top: 85% !important;
}

#thumbnails-swiper .swiper-button-prev:after,
#thumbnails-swiper .swiper-button-next:after {
  font-size: 14px;
  font-weight: bold;
}

#thumbnails-swiper .swiper-slide {
  height: 150px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== MAIN IMAGE SECTION ===== */
/* Container */
.emotion-main-image-container {
  flex: 1;
  max-width: calc(100% - 120px);
  width: 70%;
  position: relative;
}

/* Main swiper container */
#main-swiper {
  height: 100%;
}

/* Image Item */
.emotion-main-image-item {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emotion-image-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  width: 500px;
  max-width: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emotion-main-image-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

/* Main Image Navigation Arrows */
.main-button-prev,
.main-button-next {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 1);
  color: #333;
  /* border-radius: 50%; */
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); */
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.main-button-prev:after,
.main-button-next:after {
  font-size: 20px;
  font-weight: bold;
}

.main-button-prev:hover,
.main-button-next:hover {
  background: #fff;
  transform: scale(1.2);
  transition: transform 0.2s ease;
  /* box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); */
}

/* PDF Icon */
.emotion-pdf-icon {
  height: 48px;
  width: 48px;
  display: block;
  position: absolute;
  bottom: 4rem;
  left: 25%;
  transform: rotate(90deg);
  transition: transform 0.3s ease;
  z-index: 5;
}

.emotion-pdf-icon:hover {
  transform: rotate(90deg) scale(1.1);
}

/* ===== MOBILE VERSION ===== */
.emotion-mobile-gallery {
  display: none; /* Hidden by default, displayed via JS on mobile */
  width: 100%;
  margin-bottom: 0;
}

#mobile-swiper {
  width: 100%;
}

.emotion-mobile-image {
  position: relative;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emotion-mobile-image img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  cursor: zoom-in;
}

/* Mobile pagination dots */
.swiper-pagination {
  margin-top: 20px;
}

.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background-color: #ddd;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: #b7bcbe;
  transform: scale(1.2);
}

/* ===== ZOOM MODAL ===== */
.emotion-zoom-active {
  overflow: hidden; /* Prevents body scrolling when zoom is active */
}

.emotion-zoom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: saturate(180%) blur(5px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.emotion-zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 10000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: background 0.3s ease;
}

.emotion-zoom-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.emotion-zoomed-image {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  cursor: zoom-out;
}

.emotion-zoom-counter {
  color: white;
  font-size: 16px;
  margin-top: 20px;
}

/* Zoom Navigation Arrows */
.emotion-zoom-prev,
.emotion-zoom-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.emotion-zoom-prev {
  left: 20px;
}

.emotion-zoom-next {
  right: 20px;
}

.emotion-zoom-prev:hover,
.emotion-zoom-next:hover {
  background: rgba(255, 255, 255, 0.4);
}

.emotion-zoom-prev svg,
.emotion-zoom-next svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* ===== PDF MODAL ===== */
.emotion-pdf-active {
  overflow: hidden;
}

.emotion-pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.emotion-pdf-modal-inner {
  width: 96%;
  height: 96%;
  /* max-width: 1200px; */
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.emotion-pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.emotion-pdf-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
}

.emotion-pdf-close {
  font-size: 24px;
  color: #555;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.emotion-pdf-close:hover {
  background-color: #eee;
  color: #000;
}

/* .emotion-pdf-content {
  flex: 1;
  position: relative;
  overflow: hidden;
} */

/* Styles pour le viewer PDF avec PDF.js */
/* Styles pour le viewer PDF avec PDF.js */
.emotion-pdf-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
  overflow: auto;
}

.emotion-pdf-canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0 auto;
  overflow: auto;
  max-height: calc(100vh - 180px);
}

.emotion-pdf-canvas {
  display: block;
  height: auto;
  border: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Style pour la barre de progression et le message de téléchargement sur mobile */
.emotion-pdf-download-message {
  width: 80%;
  text-align: center;
  padding: 20px;
  color: #333;
  font-size: 16px;
}

.emotion-pdf-progress-container {
  width: 100%;
  height: 20px;
  background-color: #f1f1f1;
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
}

.emotion-pdf-progress-bar {
  width: 0%;
  height: 100%;
  background-color: #ef6368;
  transition: width 0.3s ease;
}

.emotion-pdf-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  padding: 1px 15px;
  background-color: #f5f5f5;
  border-radius: 5px;
  width: 80%;
}

.emotion-pdf-controls button,
.emotion-pdf-download {
  background-color: #ef6368;
  color: white;
  border: none;
  border-radius: 5px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 15px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.emotion-pdf-controls button:hover,
.emotion-pdf-download:hover {
  background-color: #d85a5f;
  transform: scale(1.05);
}

.emotion-pdf-download {
  background-color: #333;
  color: white;
  border: none;
  border-radius: 5px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 15px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.emotion-pdf-download svg {
  width: 20px;
  height: 20px;
}

.emotion-pdf-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.emotion-pdf-page-info {
  font-size: 14px;
  color: #333;
  margin: 0 10px;
  text-align: center;
  min-width: 100px;
}

.emotion-pdf-error {
  color: #ef6368;
  text-align: center;
  font-size: 16px;
  margin-top: 20px;
  padding: 15px;
  background-color: #fff3f3;
  border-radius: 5px;
  border: 1px solid #ffd0d0;
  width: 80%;
}

/* Ajustements pour mobile */
@media (max-width: 768px) {
  .emotion-pdf-canvas,
  .emotion-pdf-controls,
  .emotion-pdf-error {
    width: 100%;
  }

  .emotion-pdf-canvas-wrapper {
    height: 80%;
  }

  .emotion-pdf-controls {
    padding: 8px;
  }

  .emotion-pdf-controls button {
    width: 36px;
    height: 36px;
    margin: 0 8px;
    font-size: 16px;
  }

  .emotion-pdf-page-info {
    font-size: 13px;
    min-width: 80px;
  }
}

.emotion-pdf-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 1;
  font-size: 18px;
  color: #555;
}

.emotion-pdf-viewer {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 991px) {
  .emotion-image-wrapper {
    width: 400px;
  }
}

@media (max-width: 768px) {
  /* Show mobile version */
  .emotion-mobile-gallery {
    display: block;
  }

  /* Hide desktop versions */
  .emotion-thumbnails-container,
  #main-swiper {
    display: none;
  }

  /* Adapt the structure */
  .emotion-product-gallery {
    flex-direction: column;
    margin-bottom: 0;
  }

  .emotion-main-image-container {
    max-width: 100%;
    width: 100%;
    margin-bottom: 0;
  }

  /* Mobile image sizing */
  .emotion-mobile-image img {
    width: 100%;
    max-width: 350px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
  }

  .emotion-image-wrapper {
    width: 300px;
    max-width: 100%;
  }

  /* Mobile zoom adaptations */
  .emotion-zoom-prev,
  .emotion-zoom-next {
    width: 40px;
    height: 40px;
  }

  .emotion-zoom-prev svg,
  .emotion-zoom-next svg {
    width: 24px;
    height: 24px;
  }

  .emotion-zoom-prev {
    left: 10px;
  }

  .emotion-zoom-next {
    right: 10px;
  }

  .emotion-zoomed-image {
    max-width: 95%;
    max-height: 75%;
  }

  .emotion-pdf-modal-header {
    padding: 10px 15px;
  }

  .emotion-pdf-title {
    font-size: 16px;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .emotion-pdf-modal-inner {
    width: 95%;
    height: 85%;
  }
}

/* For very small screens */
@media (max-width: 480px) {
  .emotion-mobile-image img {
    max-width: 500px;
  }

  .emotion-pdf-icon {
    bottom: 2rem;
    left: 20%;
  }
}
