/* Recently Viewed Products Component Styles */
:root {
  --border: #e5e7eb; /* gray-200 */
  --primary: #d70018; /* đỏ gạch dưới tiêu đề */
  --price: #0a66ff;
  --discount: #ef4444;
  --pay-later: #0a66ff;
  --art-finalprice-font-size: 16px;
}

/* ----- Tiêu đề kiểu tab + gạch dài ----- */
.recently-viewed-section {
  position: relative;
  margin: 8px 0 20px;
}

.recently-viewed-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
  z-index: 1;
}

.recently-viewed-title {
  display: inline-block;
  background: #fff;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  position: relative;
  z-index: 2;
  /* color: var(--primary); */
}

/* ----- Carousel wrapper để đặt nút hai bên ----- */
.recently-viewed-carousel-wrap {
  position: relative;
  margin: 20px 0;
}

/* ----- Card sản phẩm đầy đủ ----- */
.recently-viewed-product-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
  margin: 10px;
  height: 415px; /* Increased height */
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recently-viewed-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.recently-viewed-product-image {
  width: 100%;
  height: 250px; /* Increased height */
  object-fit: contain;
  background: #f9fafb;
  border-radius: 10px;
  margin-bottom: 16px;
}

.recently-viewed-product-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #d1d5db;
}

.recently-viewed-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--discount);
  color: #fff;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.recently-viewed-pay-later {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--pay-later);
  color: var(--pay-later);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fff;
  font-weight: 500;
}

.recently-viewed-product-title {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  margin: 8px 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 46px;
  line-height: 1.4;
  text-decoration: auto;
}

/* ----- Container cho giá và giá cũ ----- */
.recently-viewed-price-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
  text-align: center;
}

.recently-viewed-price {
  color: var(--price);
  font-weight: 500;
  font-size: var(--art-finalprice-font-size);
  margin: 0;
}

.recently-viewed-old-price {
  color: #9ca3af;
  text-decoration: line-through;
  font-size: 13px;
  margin: 0;
}

.recently-viewed-price-call {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  text-align: left;
}

/* ----- Nút Prev/Next tuỳ chỉnh ----- */
.recently-viewed-product-carousel .slick-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.recently-viewed-product-carousel .slick-prev {
  left: -18px;
}

.recently-viewed-product-carousel .slick-next {
  right: -18px;
}

.recently-viewed-product-carousel .slick-arrow:hover {
  background: #f3f4f6;
}

.recently-viewed-product-carousel .slick-prev:before,
.recently-viewed-product-carousel .slick-next:before {
  font-size: 22px;
  color: #111;
  opacity: 1;
}

/* Chấm chỉ mục (tắt nếu không cần) */
.recently-viewed-product-carousel .slick-dots li button:before {
  font-size: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .recently-viewed-product-image {
    height: 170px;
  }
  
  .recently-viewed-product-carousel .slick-prev {
    left: -8px;
  }
  
  .recently-viewed-product-carousel .slick-next {
    right: -8px;
  }
  
  .recently-viewed-product-card {
    margin: 5px;
    padding: 10px;
  }
  
  .recently-viewed-title {
    font-size: 16px;
    padding: 6px 12px;
  }
  
  .recently-viewed-price-container {
    gap: 4px;
  }
  
  .recently-viewed-price {
    font-size: 16px;
  }
  
  .recently-viewed-old-price {
    font-size: 12px;
  }
}

/* Fallback cho trường hợp không có slick */
.recently-viewed-fallback {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .recently-viewed-fallback {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
}
