/* style/index.css */
/* 智能文字颜色选择器 - Sử dụng màu chữ phù hợp với độ sáng nền */
.page-index {
  color: #333333; /* Mặc định cho nền sáng */
  background-color: var(--page-bg-color, #FFFFFF); /* Lấy từ shared.css, mặc định trắng */
}

/* Các phần tử có nền đậm */
.page-index__dark-bg {
  background-color: #017439; /* Màu chủ đạo */
  color: #ffffff; /* Chữ trắng cho nền đậm */
}

/* Các phần tử có nền sáng */
.page-index__light-bg {
  background-color: #ffffff;
  color: #333333;
}

/* Buttons */
.page-index__btn-primary {
  background-color: #C30808; /* Màu đỏ cho nút Đăng ký/Đăng nhập */
  color: #FFFF00; /* Chữ vàng cho nút Đăng ký/Đăng nhập */
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-index__btn-primary:hover {
  background-color: #a30707; /* Đỏ đậm hơn khi hover */
}

/* 🚨 桌面端HERO主图区域样式（必须严格遵守） */
/* 🚨 留白只做一处：若 shared 已设置 body 的 padding-top: var(--header-offset)，则 hero 禁止再写 padding-top: var(--header-offset)；仅用约 10px 级顶距，避免与 body 双倍留白 */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* shared 已给 body 留白：约 10px 级；若 shared 未给 body lưu trắng thì đổi thành var(--header-offset, 120px) */
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.page-index__hero-container {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.page-index__hero-image {
  width: 100%;
  margin: 0;
  overflow: hidden; /* Ensure image doesn't bleed */
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
/* 桌面横幅可用 cover；移动禁止 cover+固定比例裁切两侧 */
@media (min-width: 850px) {
  .page-index__hero-image img {
    aspect-ratio: 16/5; /* 1920x600 is roughly 16:5. Use aspect-ratio for consistent height */
    object-fit: cover;
  }
}
/* 🚨 移动端主图防裁切（必读）：禁止 aspect-ratio + object-fit:cover + max-height 限高组合 */
@media (max-width: 849px) {
  .page-index__hero-section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__hero-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: unset !important; /* Remove fixed aspect ratio for mobile */
    object-fit: contain !important; /* Ensure full image is visible */
    max-height: none !important;
    display: block !important;
  }
}
/* 🚨 移动端响应式设计（必须严格遵守） */
@media (max-width: 768px) {
  .page-index__hero-section {
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 10px !important; /* Consistent small top padding */
    margin-top: 0;
  }
}

/* Sản phẩm trưng bày */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
  background-color: #f8f8f8; /* Nền nhẹ cho phần sản phẩm */
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page-index__products-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(6, 1fr); /* Desktop: 6 cột */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__product-card {
  width: 100%;
  max-width: 300px; /* Tối đa 300px mỗi card */
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 0.3s ease;
  justify-self: center; /* Căn giữa card trong grid cell */
  align-self: center;
}

.page-index__product-card:hover {
  transform: translateY(-3px);
}

.page-index__product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.page-index__product-card-image {
  width: 100%;
  max-width: 300px; /* Tối đa 300px cho ảnh */
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto; /* Giữ tỷ lệ ảnh gốc */
  display: block;
}

@media (max-width: 768px) {
  .page-index__products-section {
    padding: 40px 15px;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .page-index__products-container,
  .page-index__products-grid {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .page-index__products-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Mobile: 2 cột x 3 hàng */
    gap: 15px;
  }
  .page-index__product-card,
  .page-index__product-card-image {
    max-width: 100% !important; /* Đảm bảo card không tràn */
  }
}

/* Tiêu đề chính trang trí */
.page-index__section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  padding: 40px 12px;
  box-sizing: border-box;
  text-align: center;
  background-color: #FFFFFF; /* Nền trắng */
}
.page-index__section-title {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2.5rem); /* Tăng kích thước H1 */
  line-height: 1.35;
  color: #017439; /* Màu chủ đạo cho H1 */
  font-weight: 700;
}
.page-index__section-title-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  background-color: #017439; /* Màu chủ đạo cho đường kẻ */
  opacity: 0.6;
}
@media (max-width: 768px) {
  .page-index__section-title-wrap {
    padding: 30px 10px;
  }
  .page-index__section-title {
    font-size: clamp(1.25rem, 6vw, 2rem); /* Điều chỉnh H1 cho di động */
  }
  .page-index__section-title-line {
    max-width: 40px;
  }
}

/* Nội dung SEO dài */
.page-index__article-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 60px; /* Tăng padding dưới */
  box-sizing: border-box;
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 17px; /* Tăng cỡ chữ nội dung */
  background-color: #FFFFFF; /* Nền trắng */
}
.page-index__article-body h2 {
  margin: 2.5rem 0 1.25rem; /* Tăng khoảng cách H2 */
  color: #017439; /* Màu chủ đạo cho H2 */
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.25rem); /* Kích thước H2 */
}
.page-index__article-body h3 {
  margin: 1.5rem 0 0.85rem; /* Tăng khoảng cách H3 */
  color: #017439; /* Màu chủ đạo cho H3 */
  font-weight: 500;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem); /* Kích thước H3 */
}
.page-index__article-body p {
  margin-bottom: 1em;
}
.page-index__article-body ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 1em;
}
.page-index__article-body li {
  margin-bottom: 0.5em;
}
.page-index__article-figure {
  margin: 2rem auto;
  max-width: 800px;
  text-align: center;
}
.page-index__article-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /* Thêm bo góc nhẹ cho ảnh */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Thêm đổ bóng nhẹ */
}
.page-index__article-figure figcaption {
  font-size: 0.9em;
  color: #666666;
  margin-top: 10px;
}
.page-index__article-quote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 5px solid #017439; /* Đường kẻ màu chủ đạo */
  background-color: #f5fcf5; /* Nền nhẹ cho blockquote */
  font-style: italic;
  color: #333333;
  font-size: 1.1em;
  border-radius: 0 5px 5px 0;
}

@media (max-width: 768px) {
  .page-index__article-body {
    padding: 15px 15px 40px;
    font-size: 16px;
    line-height: 1.6;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    margin: 2rem 0 1rem;
  }
  .page-index__article-body h3 {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    margin: 1rem 0 0.5rem;
  }
  .page-index__article-figure {
    margin: 1.5rem auto;
    max-width: 100%;
  }
  .page-index__article-figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__article-quote {
    padding: 1rem 1.25rem;
    font-size: 1em;
  }
}

/* 移动端通用图片适配 */
@media (max-width: 768px) {
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__products-container,
  .page-index__products-grid {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Remove padding for full-width sections that don't need it */
  .page-index__hero-section,
  .page-index__products-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* 移动端按钮响应式适配 */
@media (max-width: 768px) {
  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px !important; /* Ensure padding for text */
    padding-right: 15px !important; /* Ensure padding for text */
    text-align: center; /* Center button text on mobile */
  }
  /* 按钮容器移动端适配 */
  .page-index__cta-buttons,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    /* 多个按钮横向排列时，允许换行 */
    display: flex !important; /* Ensure flex for wrapping */
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 10px !important; /* Spacing between stacked buttons */
  }
}