/* CSS Reset & Base Styles */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-main); /* Sử dụng màu chữ chính từ custom colors */
  background-color: var(--color-background); /* Sử dụng màu nền từ custom colors */
}

/* HERO Section Styles */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* shared đã cho body padding-top, nên ở đây chỉ 10px */
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}

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

/* Products Section Styles */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
}

.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 cột */
  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;
}

/* Section Title Styles */
.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;
  color: var(--color-text-main);
}

.page-index__section-title {
  margin: 0;
  font-size: clamp(1.1rem, 4.5vw, 1.75rem);
  line-height: 1.35;
  color: var(--color-gold); /* Sử dụng màu Gold cho H1 */
}

.page-index__section-title-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  opacity: 0.6;
  background-color: var(--color-divider); /* Màu đường kẻ */
}

/* Article Body Styles */
.page-index__article-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 48px;
  box-sizing: border-box;
  overflow-x: hidden;
  color: var(--color-text-main);
}

.page-index__article-body h2 {
  margin: 2rem 0 1rem;
  color: var(--color-text-main);
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.page-index__article-body h3 {
  margin: 1.25rem 0 0.75rem;
  color: var(--color-text-secondary);
  font-size: clamp(1.1rem, 4vw, 1.5rem);
}

.page-index__article-body p,
.page-index__article-body li {
  margin-bottom: 1rem;
  color: var(--color-text-main);
}

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

.page-index__article-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

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

.page-index__article-figure figcaption {
  font-style: italic;
  font-size: 0.9em;
  margin-top: 0.5rem;
  color: var(--color-text-secondary);
}

.page-index__article-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--color-glow); /* Sử dụng màu Glow cho border */
  background-color: var(--color-card-bg); /* Sử dụng màu Card BG cho quote */
  border-radius: 4px;
  color: var(--color-text-main);
}

/* CTA Buttons */
.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
}

.page-index__btn-primary {
  background: var(--color-button); /* Sử dụng màu Button gradient */
  color: var(--color-text-main); /* Màu chữ chính */
  border: 2px solid transparent;
}

.page-index__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.page-index__btn-secondary {
  background: transparent;
  color: var(--color-primary); /* Màu chính */
  border: 2px solid var(--color-border); /* Màu border */
}

.page-index__btn-secondary:hover {
  background: var(--color-border);
  color: var(--color-text-main);
  transform: translateY(-2px);
}

/* Global Image Styles for responsiveness */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Media Queries for Responsiveness */

/* Mobile Hero Image Fix: object-fit:contain for smaller screens */
@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) {
  /* General mobile container/section styles */
  .page-index__hero-section,
  .page-index__products-section,
  .page-index__section-title-wrap,
  .page-index__article-body,
  .page-index__cta-buttons {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow-x: hidden !important; /* Ensure no horizontal scroll */
  }

  /* HERO Section mobile */
  .page-index__hero-section {
    padding-top: 10px !important; /* Vẫn 10px cho hero */
  }

  /* Products Section mobile */
  .page-index__products-section {
    padding: 40px 15px !important;
  }
  .page-index__products-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Mobile: 2 cột x 3 hàng */
    gap: 15px !important;
  }
  .page-index__product-card,
  .page-index__product-card-image {
    max-width: 100% !important;
  }

  /* Section Title mobile */
  .page-index__section-title-wrap {
    padding: 20px 15px !important;
  }
  .page-index__section-title {
    font-size: clamp(1rem, 6vw, 1.5rem) !important; /* Điều chỉnh font-size cho di động */
  }
  .page-index__section-title-line {
    max-width: 40px !important;
  }

  /* Article Body mobile */
  .page-index__article-body {
    padding: 0 15px 32px !important;
    font-size: 16px !important;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem) !important;
  }
  .page-index__article-body h3 {
    font-size: clamp(1rem, 4.5vw, 1.25rem) !important;
  }
  .page-index__article-figure {
    margin: 1rem auto !important;
  }
  .page-index__article-figure img {
    border-radius: 4px !important;
  }

  /* CTA Buttons mobile */
  .page-index__cta-buttons {
    flex-direction: column !important; /* Nút xếp dọc trên di động */
    gap: 10px !important;
    margin-top: 30px !important;
  }
  .page-index__btn-primary,
  .page-index__btn-secondary {
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* General images mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
}