/* Base styles for the page-index */
.page-index {
  color: #FFF6D6; /* Light text for dark body background */
  background-color: var(--bg-color, #0A0A0A);
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #F2C14E; /* Brand color for titles */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.page-index__section-description {
  font-size: 18px;
  text-align: center;
  margin-bottom: 40px;
  color: #FFF6D6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-index__btn-primary {
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(242, 193, 78, 0.4);
}

.page-index__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(242, 193, 78, 0.6);
}

.page-index__btn-secondary {
  background: #111111;
  color: #F2C14E;
  border: 2px solid #F2C14E;
  box-shadow: 0 4px 10px rgba(58, 42, 18, 0.4);
}

.page-index__btn-secondary:hover {
  background: #F2C14E;
  color: #111111;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(242, 193, 78, 0.6);
}

.page-index__btn-tertiary {
  background: #3A2A12;
  color: #FFF6D6;
  padding: 10px 20px;
  font-size: 14px;
}

.page-index__btn-tertiary:hover {
  background: #F2C14E;
  color: #111111;
}

.page-index__btn-text {
  background: transparent;
  color: #F2C14E;
  padding: 0;
  font-size: 15px;
}

.page-index__btn-text:hover {
  text-decoration: underline;
  color: #FFD36B;
}

/* HERO主图区域 */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* Assuming shared.css already sets body padding-top */
  margin-top: 0;
  background-color: var(--bg-color, #0A0A0A);
}

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

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

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

/* Sản phẩm trưng bày hình ảnh khu vực */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  background: #0A0A0A;
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 2fr; /* Desktop: First 4 take 4 parts, last 2 take 2 parts */
  gap: 20px;
}

.page-index__products-grid {
  display: grid;
  gap: 20px;
}

.page-index__products-grid--small {
  grid-template-columns: repeat(4, 1fr);
}

.page-index__products-grid--large {
  grid-template-columns: repeat(2, 1fr);
}

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

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

/* Giới thiệu trang chủ */
.page-index__intro-section {
  padding: 60px 20px;
  background: #0A0A0A;
  text-align: center;
}

.page-index__intro-container {
  max-width: 900px;
}

.page-index__main-title {
  font-size: clamp(28px, 3.5vw, 48px); /* Responsive font size */
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 25px;
  color: #F2C14E;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.page-index__intro-description {
  font-size: 18px;
  color: #FFF6D6;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Liên kết truy cập nhanh và liên kết dự phòng */
.page-index__quick-links-section {
  padding: 60px 20px;
  background: #111111; /* Card BG color */
  text-align: center;
}

.page-index__links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.page-index__link-item {
  background: #0A0A0A;
  color: #FFF6D6;
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 1px solid #3A2A12;
  display: block;
  text-align: center;
}

.page-index__link-item:hover {
  background: #F2C14E;
  color: #111111;
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(242, 193, 78, 0.3);
}

/* Giới thiệu trò chơi/dịch vụ cốt lõi */
.page-index__games-section {
  padding: 60px 20px;
  background: #0A0A0A;
}

.page-index__game-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__game-card {
  background: #111111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #3A2A12;
}

.page-index__game-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
}

.page-index__game-card-title {
  font-size: 24px;
  font-weight: bold;
  color: #F2C14E;
  margin-bottom: 15px;
  padding: 0 15px;
}

.page-index__game-card-text {
  font-size: 15px;
  color: #FFF6D6;
  margin-bottom: 25px;
  padding: 0 15px;
  flex-grow: 1;
}

/* Ưu đãi và khuyến mãi */
.page-index__promotions-section {
  padding: 60px 20px;
  background: #111111;
}

.page-index__promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__promo-card {
  background: #0A0A0A;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #3A2A12;
}

.page-index__promo-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
}

.page-index__promo-card-title {
  font-size: 22px;
  font-weight: bold;
  color: #F2C14E;
  margin-bottom: 10px;
  padding: 0 15px;
}

.page-index__promo-card-text {
  font-size: 15px;
  color: #FFF6D6;
  margin-bottom: 20px;
  padding: 0 15px;
  flex-grow: 1;
}

/* An toàn và dịch vụ khách hàng */
.page-index__security-section {
  padding: 60px 20px;
  background: #0A0A0A;
}

.page-index__security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__security-item {
  background: #111111;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid #3A2A12;
}

.page-index__security-item-title {
  font-size: 22px;
  font-weight: bold;
  color: #FFD36B;
  margin-bottom: 15px;
}

.page-index__security-item-text {
  font-size: 15px;
  color: #FFF6D6;
}

.page-index__security-cta {
  margin-top: 50px;
  text-align: center;
}

/* Câu hỏi thường gặp (FAQ) */
.page-index__faq-section {
  padding: 60px 20px;
  background: #111111;
}

.page-index__faq-list {
  margin-top: 40px;
}

details.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #3A2A12;
  overflow: hidden;
  background: #0A0A0A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

details.page-index__faq-item summary.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
  color: #F2C14E;
}

details.page-index__faq-item summary.page-index__faq-question::-webkit-details-marker {
  display: none;
}

details.page-index__faq-item summary.page-index__faq-question:hover {
  background: #1a1a1a;
}

.page-index__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}

.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: #FFD36B;
  flex-shrink: 0;
  margin-left: 15px;
  width: 32px;
  text-align: center;
}

details.page-index__faq-item .page-index__faq-answer {
  padding: 0 25px 20px;
  background: #0A0A0A;
  border-radius: 0 0 8px 8px;
  color: #FFF6D6;
  font-size: 16px;
}

details.page-index__faq-item .page-index__faq-answer p {
  margin-bottom: 10px;
}

/* Nội dung blog mới nhất */
.page-index__blog-section {
  padding: 60px 20px;
  background: #0A0A0A;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__blog-card {
  background: #111111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid #3A2A12;
  display: flex;
  flex-direction: column;
}

.page-index__blog-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-index__blog-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-index__blog-card-title {
  font-size: 20px;
  font-weight: bold;
  color: #F2C14E;
  margin-bottom: 10px;
}

.page-index__blog-card-title a {
  color: #F2C14E;
  text-decoration: none;
}

.page-index__blog-card-title a:hover {
  color: #FFD36B;
  text-decoration: underline;
}

.page-index__blog-card-meta {
  font-size: 14px;
  color: #FFD36B;
  margin-bottom: 15px;
}

.page-index__blog-card-excerpt {
  font-size: 15px;
  color: #FFF6D6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-index__blog-cta {
  text-align: center;
  margin-top: 50px;
}

/* Mobile responsive styles */
@media (max-width: 1024px) {
  .page-index__products-container {
    grid-template-columns: 1fr; /* Stack product grids vertically */
  }

  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__products-grid--large {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-index__main-title {
    font-size: 38px;
  }

  .page-index__section-title {
    font-size: 30px;
  }

  .page-index__section-description {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  /* General mobile adaptations for images and containers */
  .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;
  }

  /* HERO主图区域 */
  .page-index__hero-section {
    padding-top: 10px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Sản phẩm trưng bày hình ảnh khu vực */
  .page-index__products-section {
    padding: 40px 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .page-index__products-container {
    grid-template-columns: 1fr; /* Stack product grids vertically */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr); /* 2x2 grid */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-index__products-grid--small .page-index__product-card,
  .page-index__products-grid--small .page-index__product-card-image {
    max-width: 300px; /* Ensure max-width is respected */
  }

  .page-index__products-grid--small .page-index__product-card-image img {
    max-width: 100%;
    width: 100%;
    height: auto; /* Maintain original aspect ratio */
  }

  .page-index__products-grid--large {
    grid-template-columns: 1fr; /* Each large card on its own row */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-index__products-grid--large .page-index__product-card,
  .page-index__products-grid--large .page-index__product-card-image {
    max-width: 300px; /* Ensure max-width is respected */
  }

  .page-index__products-grid--large .page-index__product-card-image img {
    max-width: 100%;
    width: 100%;
    height: auto; /* Maintain original aspect ratio */
  }

  /* Buttons and button containers */
  .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;
    padding-right: 15px;
  }

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

  .page-index__cta-buttons {
    flex-direction: column;
  }

  /* Other content modules */
  .page-index__container {
    padding: 30px 15px;
  }

  .page-index__main-title {
    font-size: 32px;
    margin-bottom: 20px;
  }

  .page-index__intro-description,
  .page-index__section-description {
    font-size: 15px;
    margin-bottom: 30px;
  }

  .page-index__section-title {
    font-size: 26px;
  }

  .page-index__links-grid,
  .page-index__game-cards-wrapper,
  .page-index__promo-grid,
  .page-index__security-grid,
  .page-index__blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-index__link-item,
  .page-index__game-card,
  .page-index__promo-card,
  .page-index__security-item,
  .page-index__blog-card {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  details.page-index__faq-item summary.page-index__faq-question {
    padding: 15px;
  }

  .page-index__faq-qtext {
    font-size: 16px;
  }

  .page-index__faq-toggle {
    font-size: 24px;
    width: 28px;
  }

  details.page-index__faq-item .page-index__faq-answer {
    padding: 0 15px 15px;
    font-size: 15px;
  }

  .page-index__blog-card-title {
    font-size: 18px;
  }

  .page-index__blog-card-meta,
  .page-index__blog-card-excerpt {
    font-size: 14px;
  }
}