  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 {
  position: relative;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0.95;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  z-index: 10;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  cursor: default;
}

.badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.badge-new {
  background: linear-gradient(135deg, #28a745, #218838);
  box-shadow: 0 0 8px #28a745aa;
}

.badge-hot {
  background: linear-gradient(135deg, #dc3545, #b02a37);
  box-shadow: 0 0 8px #dc3545aa;
}

.badge-limited {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #333;
  box-shadow: 0 0 8px #ffc107aa;
}

/* Nếu muốn 2 badge cùng lúc thì cách 1: */
/* căn badge tiếp theo cách badge đầu 40px để không chồng chéo */
.product-image .badge + .badge {
  top: 12px;
  left: auto;
  right: 12px;
  transform-origin: top right;
}

.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;
}


/*----------- Trợ lý ---------------*/
.assistant-chat {
  position: fixed;
  bottom: 80px;
  right: 10px;
  width: 280px;
  max-height: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,0.15);
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.chat-inner {
  flex: 1;
  max-height: 340px;
  overflow-y: auto;
  box-sizing: border-box;
}


.options.uniform-options button {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.options.uniform-options button:hover {
  background: #eef2ff;
  border-color: #4e54c8;
  color: #4e54c8;
}

.bot-footer {
  text-align: right;
  margin-top: 10px;
}
.bot-footer button {
  background: none;
  color: gray;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chọn khu vực và giá trong chợ lý*/
.bot-message {
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.4;
  display: block !important;         /* Luôn hiện */
  visibility: visible !important;    /* Không bị ẩn */
  opacity: 1 !important;  
}

.bot-message.highlight-choice {
  background: #f3f4f6;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
}

.bot-message.back-link a {
  color: #4e54c8;
  text-decoration: none;
  font-weight: 600;
}

.bot-message.back-link a:hover {
  text-decoration: underline;
}

.bot-form input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: border 0.3s ease;
}

.bot-form input:focus {
  border-color: #4e54c8;
}

.submit-btn {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #3f44a2, #7a80f3);
}

.hide-btn {
  background: none;
  color: gray;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

/* Nút trợ lý */
.reopen-assistant {
  position: fixed;
  bottom: 80px;
  right: 5px;
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: #fff;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(78, 84, 200, 0.4);
  z-index: 9998;
  transition: all 0.25s ease-in-out;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  animation: pulse 3s infinite;
}
.reopen-assistant:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(78, 84, 200, 0.5);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 rgba(143, 148, 251, 0.6); }
  50% { box-shadow: 0 0 15px rgba(143, 148, 251, 0.8); }
  100% { box-shadow: 0 0 0 rgba(143, 148, 251, 0.6); }
}
.assistant-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Hiển thị bài post trong trợ lý */
.assistant-item {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 1.5px 5px rgba(0,0,0,0.12);
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.assistant-item:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.assistant-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f0f0f0;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.06);
}

.assistant-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assistant-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.assistant-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #222;
  margin-bottom: 6px;
  line-height: 1.3;
  
  /* Cho phép xuống dòng, tối đa 3 dòng, overflow dấu ... */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;  
  overflow: hidden;
  word-break: break-word;
}

.assistant-price {
  font-weight: 600;
  color: #e74c3c;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.assistant-location {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
  /* Cho phép xuống dòng nếu dài */
  white-space: normal;
  word-break: break-word;
}

.assistant-detail-link {
  font-size: 0.9rem;
  color: #2980b9;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-start;
  transition: color 0.3s ease;
}

.assistant-detail-link:hover {
  color: #1c5980;
  text-decoration: underline;
}


/* Scrollbar mượt, đẹp cho Chrome, Edge */
.bot-message.posts-list::-webkit-scrollbar {
  width: 8px;
}

.bot-message.posts-list::-webkit-scrollbar-track {
  background: transparent;
}

.bot-message.posts-list::-webkit-scrollbar-thumb {
  background-color: rgba(78, 84, 200, 0.4);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.bot-message.posts-list:hover::-webkit-scrollbar-thumb {
  background-color: rgba(78, 84, 200, 0.7);
}

 /* Nút Xem nhiều hơn */
.see-more-btn {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(78, 84, 200, 0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}

.see-more-btn:hover {
  background: linear-gradient(135deg, #3f44a2, #7a80f3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(78, 84, 200, 0.4);
}

  

 /* 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;
    }
  
  }