/* General styles for the main content area */
.page-index {
  color: #333333; /* Default text color for light background */
  background: #ffffff; /* Default body background is white */
}

/* Module 1: HERO主图区域 */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* Small top padding, assuming shared.css handles body padding-top */
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

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

.page-index__hero-image {
  width: 100%;
  margin: 0;
  overflow: hidden; /* Ensure no overflow */
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover; /* Desktop uses cover */
}

/* Desktop aspect ratio for HERO image */
@media (min-width: 850px) {
  .page-index__hero-image img {
    aspect-ratio: 16/5;
    object-fit: cover;
  }
}

/* Module 2: Sản phẩm nổi bật (Product Showcase) */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
  background-color: #f5f5f5; /* Light background for this section */
}

.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 columns */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__product-card {
  width: 100%;
  max-width: 300px; /* Max width for each card */
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 0.3s ease;
  display: flex; /* To center the image if smaller than max-width */
  justify-content: center;
  align-items: center;
}

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

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

.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;
}

/* Module 3: Tiêu đề chính có trang trí */
.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;
  margin-top: 20px;
  margin-bottom: 20px;
}
.page-index__section-title {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.75rem); /* Adjusted for H1 */
  line-height: 1.35;
  color: #017439; /* Brand color for H1 */
  font-weight: 700;
}
.page-index__section-title-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  background-color: #017439; /* Brand color for line */
  opacity: 0.6;
}

/* Module 4: Nội dung SEO dài */
.page-index__article-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 48px;
  box-sizing: border-box;
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 17px;
}
.page-index__article-body h2 {
  margin: 2.5rem 0 1.25rem;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  color: #017439;
  font-weight: 700;
}
.page-index__article-body h3 {
  margin: 1.75rem 0 0.85rem;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  color: #017439;
  font-weight: 600;
}
.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; /* Slightly rounded corners for article images */
}
.page-index__article-figure figcaption {
  font-size: 0.9em;
  color: #666;
  margin-top: 0.5em;
}
.page-index__article-quote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 5px solid #017439;
  background-color: #f9f9f9;
  font-style: italic;
  color: #555;
  font-size: 1.1em;
}
.page-index__article-quote p {
  margin: 0;
}

/* Link style within article body */
.page-index__article-body a {
  color: #017439;
  text-decoration: underline;
}
.page-index__article-body a:hover {
  color: #005f2b; /* Darker shade on hover */
}

/* Custom button text for article links */
.page-index__btn-text {
  color: #C30808; /* Custom color for register/login links */
  font-weight: bold;
  text-decoration: none;
}
.page-index__btn-text:hover {
  text-decoration: underline;
}

/* Text highlight for 'h bet' within content */
.text-hbet {
  color: #017439;
  font-weight: bold;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-index__products-section {
    padding: 50px 15px;
  }
  .page-index__products-grid {
    gap: 15px;
  }
}

@media (max-width: 849px) { /* Adjust breakpoint for hero object-fit */
  .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; /* Mobile: contain to prevent cropping */
    max-height: none !important;
    display: block !important;
  }
}

@media (max-width: 768px) {
  /* General mobile adaptations */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__products-section,
  .page-index__products-container,
  .page-index__products-grid,
  .page-index__hero-section,
  .page-index__hero-container,
  .page-index__article-body,
  .page-index__section-title-wrap {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow-x: hidden !important; /* Ensure no horizontal scroll */
  }

  /* Module 1: HERO主图区域 mobile */
  .page-index__hero-section {
    padding-top: 10px !important; /* Small top padding for mobile */
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .page-index__hero-image {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: unset !important;
    object-fit: contain !important; /* Mobile: contain to prevent cropping */
  }

  /* Module 2: Sản phẩm nổi bật (Product Showcase) mobile */
  .page-index__products-section {
    padding: 40px 15px !important;
  }
  .page-index__products-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Mobile: 2 columns */
    gap: 15px !important;
  }
  .page-index__product-card,
  .page-index__product-card-image {
    max-width: 100% !important;
  }

  /* Module 3: Tiêu đề chính có trang trí mobile */
  .page-index__section-title-wrap {
    padding: 20px 15px !important;
    gap: 10px;
  }
  .page-index__section-title {
    font-size: clamp(1.5rem, 6vw, 2rem) !important; /* Adjust font size for mobile H1 */
  }
  .page-index__section-title-line {
    max-width: 40px !important;
  }

  /* Module 4: Nội dung SEO dài mobile */
  .page-index__article-body {
    padding: 0 15px 32px !important;
    font-size: 16px !important;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem) !important;
    margin: 2rem 0 1rem !important;
  }
  .page-index__article-body h3 {
    font-size: clamp(1.2rem, 4.5vw, 1.5rem) !important;
    margin: 1.5rem 0 0.75rem !important;
  }
  .page-index__article-figure {
    margin: 1.5rem auto !important;
  }
  .page-index__article-figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__article-quote {
    padding: 1rem 1.25rem !important;
  }
  .page-index__article-body p,
  .page-index__article-body ul {
    font-size: 16px !important;
  }

  /* Buttons and button containers mobile */
  .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 { /* Added .page-index__btn-text for article links */
    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 on buttons */
    padding-right: 15px !important;
  }
  .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;
    overflow: hidden !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .page-index__cta-buttons {
    display: flex !important;
    flex-direction: column !important; /* Stack buttons vertically */
  }
}