.page-index {
  color: #333333; /* Default text color for light body background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #FFFFFF; /* Assuming body-bg-color is white or light */
}

/* HERO Section */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* Shared has body padding-top, so only small top margin here */
  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; /* Desktop banner aspect ratio */
    object-fit: cover;
  }
}

/* Product Showcase Section */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
  background-color: #FFFFFF; /* Ensure light background for product section */
}

.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;
  justify-items: center; /* Center items in grid */
}

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

.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; /* Max width for image container */
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto; /* Maintain aspect ratio */
  display: block;
}

/* Decorative H1 Section */
.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; /* Ensure light background */
}

.page-index__section-title {
  margin: 0;
  font-size: clamp(1.1rem, 4.5vw, 1.75rem); /* Responsive font size */
  line-height: 1.35;
  color: #017439; /* Brand primary color for H1 */
  font-weight: bold;
}

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

/* Long SEO Article Body */
.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; /* Ensure light background */
}

.page-index__article-body h2 {
  margin: 2rem 0 1rem;
  color: #017439; /* Brand primary color for H2 */
  font-size: 1.8em;
  font-weight: bold;
}

.page-index__article-body h3 {
  margin: 1.25rem 0 0.75rem;
  color: #017439; /* Brand primary color for H3 */
  font-size: 1.4em;
  font-weight: bold;
}

.page-index__article-body p {
  margin-bottom: 1em;
  color: #333333;
}

.page-index__article-body ul {
  margin-bottom: 1em;
  padding-left: 20px;
  color: #333333;
}

.page-index__article-body li {
  margin-bottom: 0.5em;
  color: #333333;
}

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

.page-index__article-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 5px; /* Slight rounded corners for article images */
}

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

.page-index__article-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #017439; /* Brand primary color for quote border */
  background-color: #f8f8f8;
  color: #333333;
  font-style: italic;
}

.page-index__btn-text-link {
  color: #017439; /* Brand primary color for text links */
  text-decoration: underline;
  font-weight: bold;
}

.page-index__btn-text-link:hover {
  color: #005f2c; /* Slightly darker green on hover */
  text-decoration: none;
}

/* Button styles for custom colors - "Đăng ký" and "Đăng nhập" */
.page-index__button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
}

.page-index__btn-register,
.page-index__btn-login,
.page-index__btn-download {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-register {
  background-color: #C30808; /* Custom color for Register */
  color: #FFFF00; /* Custom color for Register/Login font */
  border: none;
}

.page-index__btn-register:hover {
  background-color: #a00606; /* Slightly darker on hover */
  transform: translateY(-2px);
}

.page-index__btn-login {
  background-color: #C30808; /* Custom color for Login */
  color: #FFFF00; /* Custom color for Register/Login font */
  border: none;
}

.page-index__btn-login:hover {
  background-color: #a00606; /* Slightly darker on hover */
  transform: translateY(-2px);
}

.page-index__btn-download {
  background-color: #017439; /* Primary color for Download */
  color: #FFFFFF; /* White text for contrast */
  border: none;
}

.page-index__btn-download:hover {
  background-color: #005f2c;
  transform: translateY(-2px);
}

/* General image responsive styles */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive styles for mobile (max-width: 768px) */
@media (max-width: 849px) { /* HERO specific breakpoint */
  .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 HERO: contain */
    max-height: none !important;
    display: block !important;
  }
}

@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

  /* HERO Section (mobile) */
  .page-index__hero-section {
    padding-top: 10px !important; /* Ensure small top padding */
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Product Showcase Section (mobile) */
  .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%; /* Ensure cards are responsive */
  }

  /* Decorative H1 Section (mobile) */
  .page-index__section-title-wrap {
    padding: 20px 10px;
  }
  .page-index__section-title {
    font-size: clamp(1.25rem, 5vw, 1.5rem); /* Adjust clamp for mobile */
  }
  .page-index__section-title-line {
    max-width: 40px; /* Shorter lines for mobile */
  }

  /* Long SEO Article Body (mobile) */
  .page-index__article-body {
    padding: 0 15px 32px; /* Adjusted padding for mobile */
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }
  .page-index__article-body h3 {
    font-size: clamp(1.1rem, 4.5vw, 1.3em);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
  .page-index__article-figure {
    margin: 1rem auto;
  }
  .page-index__article-figure img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .page-index__article-quote {
    margin: 1rem 0;
    padding: 0.8rem 1rem;
  }

  /* General image and container responsive styles (mobile) */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .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;
  }

  /* Buttons responsive styles (mobile) */
  .page-index__button-group {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
    padding: 0 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__btn-register,
  .page-index__btn-login,
  .page-index__btn-download,
  .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;
    padding-right: 15px;
  }
}

/* Ensure contrast for text on primary brand color background */
.page-index__dark-section {
  background: #017439;
  color: #ffffff; /* Forced white text */
}

/* Ensure contrast for text on secondary brand color background (if used as background) */
.page-index__light-section {
  background: #FFFFFF;
  color: #333333; /* Forced dark text */
}

/* Additional contrast helpers */
.page-index h1, .page-index h2, .page-index h3, .page-index h4, .page-index h5, .page-index h6 {
  color: #017439; /* Default titles to brand primary */
}

.page-index__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}