  main {
    flex: 1;
  }
  /* Xóa margin-top cho section đầu tiên */
  section:first-of-type {
    margin-top: 0;
  }
  main section:last-of-type {
    margin-bottom: 4rem;
  }


/* Slider Section */
.slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 6;
  height: auto;
}

@supports not (aspect-ratio: 16 / 6) {
  .slider-wrapper {
    height: 0;
    padding-top: 37.5%; /* fallback 6/16 */
  }
}

.slider-track {
  display: flex;
  transition: transform 0.6s ease;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
}

.slider-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;

  /* Quan trọng: để background cover đủ và trung tâm */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.slider-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  color: inherit;
  text-decoration: none;
  user-select: none;
}

.slider-caption {
  position: absolute;
  bottom: 10%;
  left: 5%;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 1em 1.5em;
  border-radius: 10px;
  max-width: 70%;
  z-index: 2;
}

.slider-caption h2 {
  font-size: 1.8rem;
  margin: 0 0 0.5em;
}

.slider-caption p {
  font-size: 1rem;
  margin: 0;
}

/* Nút điều khiển */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.5rem;
  border: none;
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  z-index: 20;
  border-radius: 5px;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slider-btn:hover {
  background: rgba(0,0,0,0.5);
  font-size: 2.5rem;
  padding: 0.5rem 0.5rem;
}
.slider-wrapper:hover .slider-btn {
  opacity: 1;
  visibility: visible;
}

.slider-btn.prev {
  left: 10px;
}

.slider-btn.next {
  right: 10px;
}

/* Dots mặc định */
.slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(0,0,0,0.3);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  gap: 10px;
}

.slider-dots .dot {
  width: 14px;
  height: 14px;
  background: #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.slider-dots .dot.active {
  background: #fff;
  box-shadow: 0 0 6px #fff;
}

  
  /* Style for the promo banner */
  .promo-banner {
    background-color: #fffbe6;
    padding: 15px;
    max-width: 1200px;
    margin: 50px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Arial', sans-serif;
    overflow-x: auto;
  }
  .promo-coupons {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  
  .promo-coupon {
    background-color: #ffffff;
    color: #ff5722;
    border-radius: 10px;
    width: 300px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    scroll-snap-align: start;
    font-weight: bold;
    font-size: 1rem;
  }
  
  /* Button nằm trong từng coupon */
  .cta-button {
    margin-top: 15px;
    padding: 8px 20px;
    font-size: 0.9rem;
    color: #fff;
    background-color: #ff5722;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-start;
  }
  
  .cta-button:hover {
    background-color: #e64a19;
  }
  
  /*---------------------------------------------*/
  .flash-sale {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fffbe6;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-family: 'Arial', sans-serif;
  }
  
  .flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  
  .flash-sale h2 {
    font-size: 1.6rem;
    color: #d32f2f;
    margin: 0;
  }
  
  .countdown-timer {
    font-size: 1rem;
    background-color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    color: #d32f2f;
    font-weight: bold;
  }
  
  .flash-sale-products {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }
  
  .flash-sale-product-card {
    min-width: 180px;
    max-width: 200px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 10px;
    scroll-snap-align: start;
    flex-shrink: 0;
    text-align: center;
  }
  
  .flash-sale-product-card img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
  }
  /* ------------------------------------------------------------------ */
  /* Phần danh mục sản phẩm */
  
/* Layout cho các mục danh mục */
.product-categories {
  position: relative;
  overflow: visible;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  -webkit-overflow-scrolling: touch;
}

/* Tiêu đề cho các section */
.section-title h2 {
  font-size: 24px;
  color: #2E2E2E;
  padding-left: 12px;
  font-weight: 600;
}

/* Ẩn scrollbar */
.category-scroll-wrapper {
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  position: relative;
}

.category-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

/* Danh mục dạng hàng ngang cuộn được */
.category-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row; 
  min-width: max-content;
}

/* Sửa lại để bao quanh bằng thẻ <a> */
.category-item {
  background-color: #f9f9f9;
  flex-shrink: 0;
  border: 1px solid #eee;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px;
  box-sizing: border-box;
  text-decoration: none; /* bỏ gạch chân của thẻ <a> */
}

/* Hover hiệu ứng */
.category-item:hover {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Hình ảnh trong mục danh mục */
.category-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 8px;
}

/* Tên danh mục */
.category-item p {
  font-size: 14px;
  margin: 8px 8px 0;
  color: #333;
  font-weight: 500;
  text-align: center;

  display: -webkit-box;
  -webkit-line-clamp: 2; /* 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  max-width: 80%;
  line-height: 1.3;
  height: 2.6em;
}

/* Quá trình cuộn */
.scroll-buttons {
  position: relative;
  display: flex;
  align-items: center;
}

.category-scroll-wrapper {
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}

.category-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

/* Nút cuộn trái/phải */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  color: #333;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

.scroll-btn.left {
  left: -10px;
}

.scroll-btn.right {
  right: -10px;
}

.scroll-btn:hover {
  background-color: #f0f0f0;
  width: 44px;
  height: 44px;
  font-size: 18px;
}


  /* ----------- Sản phẩm ----------------*/
.product-section {
  padding: 0 0.5rem;
}
.product-container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 5px 0;
  margin-bottom: 10px;
  text-align: start;
  color: #2E2E2E;
  background-color: #fff;
  border-bottom: 4px solid #7BAE4C;
}
.refresh-posts {
  margin-right: 12px;
  font-size: 1rem;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.product-card {
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.12);
  border-bottom: 4px solid #7BAE4C;
}

.product-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.product-info {
  padding: 15px;
}

.product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #222;
  line-height: 1.4;
  max-height: calc(1.4em * 2);
  height: 2.8rem;
}

.product-price {
  font-size: 15px;
  font-weight: bold;
  color: #e74c3c;
}

.giveaway-label {
  display: inline-block;
  padding: 2px 6px;
  background-color: #2ecc71;
  color: white;
  font-size: 13px;
  border-radius: 4px;
}

.product-date, .product-location, .product-views{
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.pagination {
  margin-top: 20px;
  text-align: center;
  font-family: Arial, sans-serif;
}

.pagination a, .pagination span {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.pagination a:hover {
  background-color: #eee;
}

.pagination .current-page {
  background-color: #7BAE4C;
  color: white;
  border-color: #7BAE4C;
  font-weight: bold;
  cursor: default;
}

.pagination .disabled {
  color: #999;
  border-color: #eee;
  cursor: default;
}


   /*--------------------------*/
  
   /* Đánh giá */
   .customer-reviews {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 15px;
    font-family: 'Arial', sans-serif;
  }
  
  .reviews-title {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    color: #ff5722;
    margin-bottom: 30px;
  }
  
  .review-slider {
    display: flex;
    gap: 20px;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    position: relative;
  }
  
  .review-slider::-webkit-scrollbar {
    display: none; /* Ẩn thanh cuộn ngang */
  }
  
  .review-card {
    flex: 0 0 300px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
  }
  
  .review-card:hover {
    transform: translateY(-5px);
  }
  
  .customer-reviews {
    position: relative;
  }
  
  /* Mặc định ẩn các nút điều hướng */
  .reviews-button {
    display: none;
    position: absolute;
    top: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s;
  }
  
  .reviews-button:hover {
    background-color: rgba(0, 0, 0, 0.5);
    top: 50%;
    padding: 16px;
    font-size: 16px;
  }
  
  .reviews-button.prev {
    left: 0;
    margin-left: -10px;
  }
  
  .reviews-button.next {
    right: 0;
    margin-right: -10px;
  }
  
  /* Khi hover vào khối customer-reviews thì hiện nút điều hướng */
  .customer-reviews:hover .reviews-button {
    display: block;
  }
  
  
  .review-stars {
    color: #ff9800;
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .review-text {
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
  }
  
  .review-footer {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
  }
  
  .customer-name {
    font-weight: bold;
    color: #555;
    font-size: 0.95rem;
  }
  

 /* Báo lỗi lọc bài */
 .no-results {
  grid-column: 1 / -1;
  padding: 20px;
  background: #f9f9f9;
  border: 1px dashed #ccc;
  text-align: center;
  border-radius: 10px;
  color: #555;
  margin-top: 30px;
}

.no-results p {
  margin: 10px 0;
}
  
  /* Tablet: từ 768px đến 1024px */
  @media screen and (max-width: 1100px) and (min-width: 768px) {
    .flash-sale{
      margin: 50px 1rem 0 1rem;
    }
  
   .product-categories {
    margin: 0 0.5rem
   }
  
  }
  
  
  @media screen and (max-width: 768px) {
  .slider-wrapper {
    aspect-ratio: unset;
    height: 0;
    padding-top: 56.25%; /* 16:9 tỉ lệ phổ biến trên mobile */
    touch-action: pan-y;
  }

  .slider-caption {
    bottom: 5%;
    left: 5%;
    font-size: 0.9rem;
    padding: 0.5em 1em;
  }

  .slider-caption h2 {
    font-size: 1.2rem;
  }

  .slider-caption p {
    font-size: 0.9rem;
  }

  .slider-btn {
    display: none;
  }
  
  .slider-dots {
    bottom: 5px;
    background: none;
  }
  .slider-dots .dot {
    position: relative;
  }
  .slider-dots .dot::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }
  
    /*--------------- Flash Sale ---------------*/
    .flash-sale-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }
  
    .flash-sale-product-card {
      min-width: 90px;
      max-width: 120px;
      padding: 5px;
    }
  
  
    /*------------- Danh mục --------------------*/
    .category-item p {
      font-size: 12px;
      line-height: 1.3;
      height: auto;
      overflow: visible;
      text-overflow: unset;
      white-space: normal;
      display: block;
    }
    .section-title {
      font-size: 1.4rem;
      padding: 8px 0;
      margin-bottom: 1.5rem;
    }
    .category-scroll-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      white-space: nowrap;

      /* Ẩn scrollbar trên tất cả trình duyệt */
      scrollbar-width: none; /* Firefox */
      -ms-overflow-style: none;  /* IE & Edge */
    }

    .category-scroll-wrapper::-webkit-scrollbar {
      display: none; /* Chrome, Safari */
    }
    .scroll-btn {
      display: none !important;
    }

    /*-------- Sản phẩm -----*/
    .product-section {
    padding: 0 0.5rem;
  }

  .section-title {
    font-size: 20px;
    padding: 10px 0;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }

  .product-card {
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }

  .product-image img {
    height: 140px;
  }

  .product-info {
    padding: 10px;
  }

  .product-name {
    font-size: 14px;
    -webkit-line-clamp: 2;
    line-height: 1.3;
    max-height: calc(1.3em * 2);
  }

  .product-price {
    font-size: 14px;
  }

  .giveaway-label {
    font-size: 12px;
    padding: 2px 5px;
  }

  .product-date,
  .product-location {
    font-size: 12px;
  }

  .pagination a,
  .pagination span {
    padding: 6px 10px;
    font-size: 13px;
    margin: 0 3px;
  }
  
  
     /*--- đánh giá */
     .review-card {
      flex: 0 0 260px;
      padding: 15px;
    }
  
    .reviews-title {
      font-size: 1.5rem;
    }
  
    .review-text {
      font-size: 0.95rem;
    }
  
    .customer-name {
      font-size: 0.9rem;
    }
    .reviews-button {
      display: none !important;
    }
  
  }