/* 🚨 Tổng quan: Các quy tắc CSS phải tuân thủ BEM, không dùng bộ chọn toàn cục/hậu duệ, đảm bảo độ tương phản màu sắc và hỗ trợ responsive đầy đủ cho cả desktop và mobile (max-width: 768px). */

.page-index {
  color: #333333; /* Văn bản tối cho nền sáng mặc định */
}

/* 🚨 HERO主图区域样式 */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* Giả định shared đã có padding-top cho body */
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__hero-container {
  position: relative;
  margin: 0 auto;
  width: 100%;
}

.page-index__hero-image {
  width: 100%;
  margin: 0;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

@media (min-width: 850px) {
  .page-index__hero-image img {
    aspect-ratio: 16/5;
    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;
    object-fit: contain !important;
    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;
    margin-top: 0;
  }
}

/* 🚨 产品展示图区域样式 */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
  background-color: #FFFFFF;
}

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

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

.page-index__product-card {
  width: 100%;
  max-width: 300px;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.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;
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

@media (max-width: 768px) {
  .page-index__products-section {
    padding: 40px 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__products-container,
  .page-index__products-grid {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__products-grid {
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns */
    gap: 15px;
  }
  .page-index__product-card,
  .page-index__product-card-image {
    max-width: 100%;
  }
}

/* 🚨 模块 3：居中装饰主标题 */
.page-index__section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  padding: 24px 12px;
  box-sizing: border-box;
  text-align: center;
  background-color: #FFFFFF;
}

.page-index__section-title {
  margin: 0;
  font-size: clamp(1.1rem, 4.5vw, 1.75rem);
  line-height: 1.35;
  color: #017439;
  font-weight: 700;
}

.page-index__section-title-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  opacity: 0.6;
  background-color: #017439;
}

@media (max-width: 768px) {
  .page-index__section-title-wrap {
    padding: 20px 10px;
  }
  .page-index__section-title {
    font-size: clamp(1rem, 4.5vw, 1.5rem);
    padding: 0 5px;
  }
  .page-index__section-title-line {
    max-width: 40px;
  }
}

/* 🚨 模块 4：长文 SEO 主体 */
.page-index__article-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 48px;
  box-sizing: border-box;
  overflow-x: hidden;
  background-color: #FFFFFF;
}

.page-index__article-body h2 {
  margin: 2rem 0 1rem;
  color: #017439;
  font-size: 1.8rem;
  line-height: 1.3;
  font-weight: 700;
}

.page-index__article-body h3 {
  margin: 1.25rem 0 0.75rem;
  color: #017439;
  font-size: 1.4rem;
  line-height: 1.4;
  font-weight: 600;
}

.page-index__article-body p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #333333;
}

.page-index__article-body ul {
  margin-bottom: 1rem;
  padding-left: 20px;
  list-style: disc;
}

.page-index__article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: #333333;
}

.page-index__article-figure {
  margin: 1.5rem auto;
  max-width: 800px;
  text-align: center;
}

.page-index__article-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.page-index__article-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666666;
}

.page-index__article-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #017439;
  background-color: #f9f9f9;
  color: #333333;
  font-style: italic;
  line-height: 1.6;
}

/* Static FAQ styles */
.page-index__faq-question-static {
  margin: 1.5rem 0 0.5rem;
  color: #017439;
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 600;
}

.page-index__faq-answer-static {
  margin-bottom: 1rem;
  padding-left: 10px;
  line-height: 1.6;
  color: #333333;
  border-left: 2px solid #e0e0e0;
  padding-bottom: 5px;
}

.page-index__btn-text-link {
  color: #C30808; /* Custom color for register/login links */
  text-decoration: underline;
  font-weight: 600;
}

.page-index__btn-text-link:hover {
  color: #9c0606;
  text-decoration: none;
}

@media (max-width: 768px) {
  .page-index__article-body {
    padding: 0 12px 32px;
    font-size: 16px;
    line-height: 1.5;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    margin: 1.5rem 0 0.75rem;
  }
  .page-index__article-body h3 {
    font-size: clamp(1.1rem, 4.5vw, 1.3rem);
    margin: 1rem 0 0.5rem;
  }
  .page-index__article-figure {
    margin: 1rem auto;
  }
  .page-index__article-figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__article-quote {
    margin: 1rem 0;
    padding: 0.8rem 1rem;
  }
  .page-index__faq-question-static {
    font-size: 1.1rem;
    margin: 1rem 0 0.4rem;
  }
  .page-index__faq-answer-static {
    font-size: 0.95rem;
    padding-left: 8px;
  }

  /* 🚨 移动端图片响应式适配 */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* 🚨 移动端按钮响应式适配 */
  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"],
  .page-index__btn-text-link {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
    text-align: center; /* Center text in full-width buttons */
  }
  
  .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;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
    display: flex;
    flex-direction: column; /* Ensure vertical stacking for multiple buttons */
    align-items: center;
  }
}