/* CSS cho phần sản phẩm liên quan và bài viết liên quan */

/* Phần chung */
.related-section {
  padding: 60px 0;
  background-color: #f9f9f9;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}

.related-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0058dd, #f97316);
}

.related-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.related-section .section-title {
  font-size: 28px;
  font-weight: 600;
  color: #1c2332;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

.related-section .section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #0058dd, #f97316);
  border-radius: 3px;
}

.related-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 30px;
}

/* Card thiết kế mới */
.related-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.related-card .card-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  /* Tỷ lệ khung hình vuông */
  overflow: hidden;
}

.related-card .card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related-card:hover .card-image img {
  transform: scale(1.05);
}

.related-card .card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-card .card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1c2332;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 50px;
}

.related-card .card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  font-size: 14px;
  color: #666;
}

.related-card .card-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 63px;
  /* 3 lines * 1.5 line-height * 14px font-size */
}

.related-card .card-meta i {
  margin-right: 5px;
  color: #0058dd;
}

.related-card .card-meta span {
  margin-right: 15px;
}

.related-card .card-price {
  font-weight: 600;
  color: #0058dd;
  margin-bottom: 15px;
  font-size: 18px;
}

.related-card .card-button {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(90deg, #0058dd, #0046b1);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: auto;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.related-card .card-button:hover {
  background: linear-gradient(90deg, #0046b1, #003a8c);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 88, 221, 0.3);
}

/* Badge cho sản phẩm */
.related-card .promo-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(90deg, #f97316, #ea580c);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.3);
}

.related-card .new-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(90deg, #0058dd, #0046b1);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(0, 88, 221, 0.3);
}

/* Responsive */
@media (max-width: 992px) {
  .related-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .related-section {
    padding: 40px 0;
  }

  .related-section .section-title {
    font-size: 24px;
  }
}

@media (max-width: 576px) {
  .related-items {
    grid-template-columns: 1fr;
  }

  .related-card .card-title {
    font-size: 16px;
    height: auto;
    -webkit-line-clamp: 2;
  }

  .related-card .card-button {
    padding: 8px 16px;
    font-size: 14px;
  }
}