/*!
Vouch app code (c) Rofsky Solutions. Unauthorized copying or reuse prohibited. Merchant content and third-party licenses unaffected.
*/
body.review-modal-open {
  overflow: hidden !important;
}

.review-image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #00000082;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.review-image-modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.review-modal-content {
  display: flex;
  width: 90%;
  height: 90%;
  max-width: 900px;
  max-height: 90vh;
  margin: auto;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.review-modal-content,
.review-modal-left,
.review-modal-right,
.review-modal-thumbnails {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
}

.review-image-modal :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #222;
}

/* Close Button */
.review-modal-close {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  width: 44px;
  height: 44px;
  background: #000000a8;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.review-modal-close:hover {
  background: #00000068;
}

/* Left Side - Image Carousel */
.review-modal-left {
  flex: 1;
  background: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  overflow: hidden;
}

/* Blurred background layer - covers entire left section */
.review-modal-left::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  filter: blur(10px);
  transform: scale(1.1);
  z-index: 0;
}

.review-modal-carousel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.review-modal-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.review-modal-image {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Carousel Navigation Arrows */
.review-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
}

.review-carousel-arrow svg {
  width: 24px;
  height: 24px;
}

[dir="rtl"] .review-carousel-arrow svg {
  transform: scaleX(-1);
}

.review-carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.review-carousel-arrow.prev {
  inset-inline-start: 20px;
}

.review-carousel-arrow.next {
  inset-inline-end: 20px;
}

.review-carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Thumbnails */
.review-modal-thumbnails {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 20px;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 20;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.review-modal-thumbnail {
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  transition: all 0.2s ease;
  opacity: 0.8;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.review-modal-thumbnail:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.review-modal-thumbnail.active {
  border-color: white;
  opacity: 1;
}

/* Right Side - Review Details */
.review-modal-right {
  width: 400px;
  background: white;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* No-media variant: review has no images, so the left panel is hidden and
   the right panel becomes the whole modal (centered, narrower max width). */
.review-image-modal.no-media .review-modal-content {
  max-width: 500px;
}
.review-image-modal.no-media .review-modal-right {
  width: 100%;
}

.review-modal-header {
  margin-bottom: 20px;
}

.review-modal-reviewer {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-modal-date {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.review-modal-rating {
  display: flex;
  margin-bottom: 20px;
}

.review-modal-rating .star.empty {
  color: #ccc;
}

.review-modal-rating .star.filled,
.review-modal-rating .star.half {
  color: var(--review-modal-star-color, #000000);
}

.review-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
}

.review-modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
}

.review-modal-product {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.review-modal-product-title {
  font-size: 14px;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .review-modal-content {
    flex-direction: column;
  }

  .review-modal-left {
    height: 60%;
  }

  .review-modal-right {
    width: 100%;
    height: 40%;
  }

  .review-carousel-arrow {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .review-carousel-arrow.prev {
    inset-inline-start: 10px;
  }

  .review-carousel-arrow.next {
    inset-inline-end: 10px;
  }

  .review-modal-close {
    top: 10px;
    inset-inline-end: 10px;
  }

  .review-modal-thumbnails {
    padding: 10px;
  }

  .review-modal-thumbnail {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-image-modal,
  .review-image-modal * {
    animation: none;
    transition: none;
  }
}
