/* CSS Variables */
:root {
  --red-dark: #8B0000;
  --red: #C8102E;
  --black: #000000;
  --white: #FFFFFF;
  --gray-light: #F5F5F5;
  --gray: #666666;
  --gray-dark: #333333;
  --border: #E0E0E0;
  --text-color: #333;
  --text-light: #666;
  --success: #27ae60;
}

.reviews-section {
  padding: 60px 0;
  background: var(--white);
  border-top: 2px solid var(--border);
  margin-top: 60px;
  position: relative;
  will-change: auto;
}

.reviews-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  will-change: auto;
}

.reviews-summary {
  position: static;
  height: fit-content;
}

.reviews-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--black);
}

.overall-rating {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.rating-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--black);
}

.rating-stars-large {
  display: flex;
  gap: 2px;
  color: var(--black);
  font-size: 24px;
}

.rating-stars-large .star.half {
  opacity: 0.5;
}

.recommendation {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 30px;
}

.rating-distribution {
  margin-bottom: 30px;
}

.rating-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rating-label {
  width: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
}

.rating-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: var(--black);
  border-radius: 4px;
  transition: width 0.3s;
}

.rating-percent {
  width: 40px;
  font-size: 12px;
  color: var(--gray);
  text-align: right;
}

.product-image-rating {
  position: relative;
  width: 100%;
  max-width: 200px;
  margin-top: 30px;
}

.rating-product-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.rating-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: var(--black);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.reviews-list {
  flex: 1;
}

.reviews-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: var(--black);
  cursor: pointer;
  transition: border-color 0.3s;
}

.filter-select:hover {
  border-color: var(--black);
}

.filter-select:focus {
  outline: none;
  border-color: var(--black);
}

.review-items {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.review-item {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
  position: relative;
  will-change: auto;
}

.review-item:last-child {
  border-bottom: none;
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.review-stars {
  display: flex;
  gap: 3px;
  color: #FFA500;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.review-stars .star {
  display: inline-block;
  color: #FFA500;
}

.review-stars .star {
  display: inline-block;
  color: #FFA500;
  font-size: 18px;
  line-height: 1;
}

.review-details {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--gray);
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.review-author {
  font-weight: 600;
  color: var(--black);
  font-size: 14px;
  margin-right: 0;
}

.review-variant {
  font-weight: 500;
  color: var(--black);
  font-size: 13px;
}

.review-date {
  color: var(--gray);
  font-size: 13px;
}

.review-content {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  position: relative;
  will-change: auto;
}

.review-image-container {
  flex-shrink: 0;
}

.review-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.review-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.7;
  font-weight: 400;
}

.review-helpful {
  margin-top: 10px;
}

.helpful-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Poppins', sans-serif;
}

.helpful-btn:hover {
  border-color: var(--black);
  color: var(--black);
}

.view-all-reviews {
  margin-top: 40px;
  text-align: center;
}

.view-all-btn {
  color: var(--red);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s;
  cursor: pointer;
}

.view-all-btn:hover {
  color: var(--red);
  text-decoration: underline;
}

/* Reviews Modal */
.reviews-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  overflow-y: auto;
}

.reviews-modal.active {
  display: block;
}

.reviews-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.reviews-modal-content {
  position: relative;
  background: var(--white);
  margin: 40px auto;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reviews-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 40px;
  border-bottom: 2px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 20px;
}

.reviews-modal-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--black);
  margin: 0;
}

.reviews-modal-close {
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--gray-dark);
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 11;
}

.reviews-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.reviews-modal-close:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: scale(1.1);
}

.reviews-modal-close:active {
  transform: scale(0.95);
}

.reviews-modal-body {
  padding: 30px 40px;
  overflow-y: auto;
  flex: 1;
}

.reviews-modal-body .reviews-filters {
  margin-bottom: 30px;
}

.reviews-modal-body .review-items {
  max-height: none;
}

@media (max-width: 968px) {
  .reviews-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .reviews-summary {
    text-align: center;
  }

  .reviews-filters {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  .reviews-modal-content {
    width: 95%;
    margin: 20px auto;
    max-height: 95vh;
  }

  .reviews-modal-header {
    padding: 20px;
    gap: 15px;
  }

  .reviews-modal-title {
    font-size: 22px;
  }

  .reviews-modal-close {
    width: 40px;
    height: 40px;
  }

  .reviews-modal-close svg {
    width: 18px;
    height: 18px;
  }

  .reviews-modal-body {
    padding: 20px;
  }
}


