/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.product-card {
  background-color: var(--light);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background-color: #f7f7f7;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.08);
}

.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--primary);
  color: var(--light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #777;
}

.product-card-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  height: 2.8em; /* fixed height for 2 lines */
}

.product-card-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-box {
  display: flex;
  flex-direction: column;
}

.price-current {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.price-old {
  font-size: 0.85rem;
  color: #999;
  text-decoration: line-through;
}

.add-to-cart-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(200, 30, 30, 0.2);
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background-color: var(--secondary);
  color: var(--dark);
  transform: rotate(90deg);
  box-shadow: 0 4px 10px rgba(212, 160, 23, 0.3);
}

/* Product Detail Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(58, 43, 32, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-container {
  background-color: var(--light);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 16px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background-color: var(--light);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--dark);
  z-index: 10;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--primary);
  transform: rotate(90deg);
}

.modal-content-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 30px;
  padding: 40px;
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.main-image-wrapper {
  background-color: #f7f7f7;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1/1;
}

.main-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}

.gallery-thumb.active {
  border-color: var(--primary);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.2;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 15px;
}

.detail-price {
  margin-bottom: 20px;
}

.detail-price-current {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.detail-price-old {
  font-size: 1.1rem;
  color: #999;
  text-decoration: line-through;
  margin-left: 10px;
}

.detail-desc {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.5;
}

.detail-tabs {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-bottom: 25px;
}

.tab-nav {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
}

.tab-btn {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  padding-bottom: 10px;
  position: relative;
}

.tab-btn.active {
  color: var(--dark);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.tab-pane {
  display: none;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}

.tab-pane.active {
  display: block;
}

.qty-input-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.qty-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 15px;
  background-color: #FAF8F5;
}

.qty-input-btn {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-input-val {
  width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.detail-add-btn {
  flex: 1;
}

/* Reviews Layout */
.reviews-section {
  background-color: #FAF8F5;
  padding: 80px 0;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 50px;
}

.reviews-summary {
  background-color: var(--light);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}

.summary-score {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.1;
}

.summary-stars {
  margin: 10px 0;
}

.summary-total {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 25px;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.rating-bar-lbl {
  width: 50px;
  text-align: left;
}

.rating-bar-outer {
  flex: 1;
  height: 8px;
  background-color: #EEE;
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-inner {
  height: 100%;
  background-color: var(--secondary);
  border-radius: 4px;
}

.rating-bar-pct {
  width: 35px;
  text-align: right;
  color: #777;
}

.reviews-list-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.review-item {
  background-color: var(--light);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 10px;
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.review-author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.review-date {
  font-size: 0.8rem;
  color: #999;
}

.review-comment {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
}
