/* ============================================
   CUSTOMER OPINIONS SECTION
   ============================================ */

.customer-opinions-section {
  padding: var(--spacing-4xl) 0;
  background-color: var(--color-surface);
  overflow: hidden;
  position: relative;
}

.customer-opinions-section .container {
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Scroll Container */
.reviews-scroll-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 1.5rem 0;
  margin: 0;
}

.reviews-scroll-container::-webkit-scrollbar {
  display: none;
}

/* Navigation Controls */
.reviews-scroll-ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.reviews-scroll-ctrl:hover {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-50%) scale(1.05);
}

.reviews-scroll-ctrl svg {
  width: 24px;
  height: 24px;
  fill: var(--color-text);
}

.reviews-scroll-ctrl.prev {
  left: -22px;
}

.reviews-scroll-ctrl.next {
  right: -22px;
}

@media (max-width: 1024px) {
  .reviews-scroll-ctrl {
    display: none;
  }
}

/* Review Card */
.review-card {
  flex: 0 0 320px; /* Reduced from 400px */
  scroll-snap-align: start;
  background: var(--color-card-bg);
  padding: 2.5rem;
  border-radius: var(--radius-lg) !important;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  z-index: 2;
}

@media (max-width: 768px) {
  .customer-opinions-section .container {
    padding: 0;
  }

  .customer-opinions-section {
    padding-top: var(--spacing-md) !important;
    padding-bottom: var(--spacing-md) !important;
  }

  .reviews-scroll-container {
    padding: 1.5rem calc(7.5vw - 0.375rem);
    gap: 0.75rem;
    scroll-snap-type: x mandatory;
  }

  .review-card {
    flex: 0 0 85vw;
    scroll-snap-align: center;
    margin: 0;
    padding: 1.5rem;
    /* Optional: minimal scale effect or just plain as per image */
    transform: none;
    opacity: 1;
  }
}

/* Immersive Media Style */
.review-card.style-media {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg); /* Using consistent global radius */
  height: 480px; /* Reduced from 550px */
  border: none;
}

.review-media-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.review-media-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-media-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.4) 40%,
      transparent 100%
    ),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 30%);
  pointer-events: none;
}

[data-theme="dark"] .review-media-container::after {
  background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.6) 50%,
      transparent 100%
    );
}

/* Video Controls Container */
.review-video-controls {
  position: absolute;
  bottom: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

/* Generic Video Control Button */
.review-video-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  opacity: 0.8;
}

.review-video-controls button:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
  opacity: 1;
}

.review-video-controls button svg,
.review-video-controls button img,
.review-video-controls button div {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-video-controls button svg {
  width: 100%;
  height: 100%;
}

/* Content Hiding Logic */
.review-card.content-hidden .review-overlay-top,
.review-card.content-hidden .review-overlay-bottom {
  opacity: 0;
  visibility: hidden;
}

.review-card.content-hidden .review-media-container::after {
  opacity: 0;
}

.review-overlay-top,
.review-overlay-bottom,
.review-media-container::after {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.review-overlay-top {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  color: white;
}

.review-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: white;
}

.review-card.style-media .review-stars {
  color: #fbbf24;
}

.review-card.style-media .review-stars svg {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.review-card.style-media .review-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.review-card.style-media .review-quote-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.review-card.style-media .review-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  /* Height already set to 480px in main block */
}

/* Floating Product Tag */
.review-product-tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-product-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.review-product-tag-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.review-product-tag-info {
  display: flex;
  flex-direction: column;
}

.review-product-tag-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.review-product-tag-action {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

/* Author Info Overlay */
.review-author-overlay {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-author-overlay .review-author-avatar {
  width: 36px;
  height: 36px;
  border: 2px solid white;
}

.review-author-overlay .review-author-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: white;
  text-transform: none;
  letter-spacing: normal;
}

.review-product-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-top: auto;
  text-decoration: none;
  transition: background 0.2s ease;
}

/* RTL Support */
[dir="rtl"] .review-product-tag,
[dir="rtl"] .review-author-overlay,
[dir="rtl"] .review-footer {
  text-align: right;
}

[dir="rtl"] .review-product-tag-info,
[dir="rtl"] .review-author-info {
  align-items: flex-start;
}

/* Ensure margins and gaps handle RTL correctly */
[dir="rtl"] .review-stars {
  flex-direction: row-reverse;
}

.review-product-image {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.review-product-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Header */
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-stars {
  display: flex;
  gap: 4px;
  color: var(--color-accent); /* Dark stars in light mode, Light in dark */
}

.review-stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.review-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card Body */
.review-body {
  flex: 1;
}

.review-quote-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.review-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Card Footer */
.review-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--color-border-light);
  padding-top: 1.5rem;
}

.review-author-avatar {
  width: 42px;
  height: 42px;
  background-color: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  overflow: hidden; /* Added to clip image as circle */
}

.review-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-author-info {
  display: flex;
  flex-direction: column;
}

.review-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

.review-verified-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: #38a169; /* Green for verified */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.review-verified-badge svg {
  width: 12px;
  height: 12px;
}

/* Loading State */
.reviews-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 3rem 0;
}

.reviews-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border-light, #e5e5e5);
  border-top-color: var(--color-text, #333);
  border-radius: var(--radius-full);
  animation: reviewsSpin 0.7s linear infinite;
}

@keyframes reviewsSpin {
  to {
    transform: rotate(360deg);
  }
}
