/* style/faq.css */

/* Biến CSS toàn cục cho màu sắc chính */
:root {
  --primary-color: #0A2463;
  --secondary-color: #E34234;
  --text-light: #ffffff;
  --text-dark: #333333;
  --background-dark: #0f0f0f;
  --background-light: #ffffff;
  --border-color: #e0e0e0;
}

/* Reset cơ bản cho phần nội dung trang FAQ */
.page-faq {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  background-color: var(--background-dark); /* Thừa kế từ body, đảm bảo màu nền chính */
  color: var(--text-light); /* Chữ màu sáng trên nền tối */
  padding-bottom: 60px; /* Đảm bảo có khoảng trống cho footer */
}

.page-faq h1, .page-faq h2, .page-faq h3, .page-faq h4, .page-faq h5, .page-faq h6 {
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-faq h1 {
  font-size: 44px;
  text-align: center;
  font-weight: bold;
}

.page-faq h2 {
  font-size: 36px;
  text-align: center;
  font-weight: bold;
}

.page-faq h3 {
  font-size: 24px;
}

.page-faq p {
  margin-bottom: 15px;
}

.page-faq .highlight {
  color: var(--secondary-color);
}

/* Padding cho phần nội dung chính để tránh bị che bởi header cố định */
.page-faq__title-section {
  position: relative;
  width: 100%;
  padding: 120px 20px 60px; /* Desktop: padding-top để tránh header */
  background: var(--primary-color);
  color: var(--text-light);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-faq__title-container {
  max-width: 900px;
  margin: 0 auto;
}

.page-faq__main-title {
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-faq__title-description {
  font-size: 18px;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
}

.page-faq__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.page-faq__cta-button {
  display: inline-block;
  padding: 15px 35px;
  background: var(--secondary-color);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  max-width: 100%; /* Đảm bảo nút không vượt quá chiều rộng */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-faq__cta-button:hover {
  background: darken(var(--secondary-color), 10%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Phần Câu Hỏi Thường Gặp */
.page-faq__faq-section {
  padding: 60px 20px;
  background-color: var(--background-dark);
  color: var(--text-light);
}

.page-faq__faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.page-faq__section-title {
  margin-bottom: 40px;
  color: var(--text-light);
}

.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #1a1a1a; /* Nền tối hơn một chút cho câu hỏi */
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-faq__faq-question:hover {
  background: #2a2a2a;
  border-color: #444;
}

.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-light);
  pointer-events: none; /* Ngăn h3 chặn sự kiện click */
}

.page-faq__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn toggle chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  color: var(--text-light);
  transform: rotate(45deg); /* Biểu tượng xoay khi mở */
}

.page-faq__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 25px;
  opacity: 0;
  background: #222; /* Nền cho câu trả lời */
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Đủ lớn để chứa mọi nội dung */
  padding: 20px 25px !important;
  opacity: 1;
}

.page-faq__faq-answer p {
  margin-bottom: 0;
}

/* Phần Giới Thiệu Thương Hiệu */
.page-faq__brand-section {
  padding: 60px 20px;
  background-color: var(--primary-color);
  color: var(--text-light);
}

.page-faq__brand-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-faq__brand-item {
  background: rgba(255, 255, 255, 0.08); /* Nền hơi trong suốt */
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, background 0.3s ease;
}

.page-faq__brand-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.page-faq__brand-item h3 {
  color: var(--secondary-color);
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 22px;
}

.page-faq__brand-item p {
  font-size: 16px;
  opacity: 0.8;
}

.page-faq__brand-image {
  width: 100%;
  max-width: 300px; /* Kích thước tối đa cho hình ảnh thương hiệu */
  height: auto;
  object-fit: contain;
  margin-bottom: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block; /* Đảm bảo hình ảnh là block để căn giữa */
  margin-left: auto;
  margin-right: auto;
}

/* Phần Blog Mới Nhất */
.page-faq__blog-section {
  padding: 60px 20px;
  background-color: var(--background-dark);
  color: var(--text-light);
}

.page-faq__blog-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-faq__blog-item {
  background: #1a1a1a; /* Nền tối cho bài viết */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-faq__blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-faq__blog-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-faq__blog-item-image {
  width: 100%;
  height: 200px; /* Chiều cao cố định cho hình ảnh blog */
  object-fit: cover;
  display: block;
}

.page-faq__blog-item-content {
  padding: 20px;
}

.page-faq__blog-item-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-light);
  margin-top: 0;
  margin-bottom: 10px;
}

.page-faq__blog-item-excerpt {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
}

.page-faq__blog-item-date {
  font-size: 14px;
  color: var(--secondary-color);
  display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-faq h1 {
    font-size: 38px;
  }
  .page-faq h2 {
    font-size: 32px;
  }
  .page-faq h3 {
    font-size: 22px;
  }
  .page-faq__title-description {
    font-size: 17px;
  }
}

@media (max-width: 768px) {
  .page-faq {
    font-size: 16px;
    line-height: 1.6;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .page-faq h1 {
    font-size: 32px;
  }
  .page-faq h2 {
    font-size: 28px;
  }
  .page-faq h3 {
    font-size: 20px;
  }

  /* Điều chỉnh padding-top cho mobile để tránh header */
  .page-faq__title-section {
    padding-top: 100px !important; /* Mobile: padding-top để tránh header */
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .page-faq__title-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-faq__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-faq__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    width: 100% !important; /* Đảm bảo nút chiếm toàn bộ chiều rộng */
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-faq__faq-section, .page-faq__brand-section, .page-faq__blog-section {
    padding: 40px 15px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .page-faq__faq-question {
    padding: 15px 20px;
    flex-wrap: wrap;
  }
  
  .page-faq__faq-question h3 {
    font-size: 16px;
    width: calc(100% - 40px);
  }
  
  .page-faq__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 24px;
  }
  
  .page-faq__faq-answer {
    padding: 0 20px;
  }
  
  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px 20px !important;
  }

  .page-faq__brand-content, .page-faq__blog-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-faq__brand-item, .page-faq__blog-item {
    padding: 25px;
  }

  .page-faq__brand-item h3 {
    font-size: 20px;
  }

  .page-faq__blog-item-image {
    height: 180px;
  }
  
  /* Đảm bảo tất cả hình ảnh responsive */
  .page-faq img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-faq__brand-item, .page-faq__blog-item, .page-faq__blog-container, .page-faq__brand-container, .page-faq__faq-container, .page-faq__title-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }
  .page-faq__brand-section, .page-faq__blog-section, .page-faq__faq-section {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  .page-faq h1 {
    font-size: 28px;
  }
  .page-faq h2 {
    font-size: 24px;
  }
  .page-faq__main-title {
    margin-bottom: 15px;
  }
  .page-faq__title-description {
    font-size: 15px;
    margin-bottom: 25px;
  }
  .page-faq__cta-button {
    font-size: 15px;
    padding: 10px 20px;
  }
  .page-faq__faq-question h3 {
    font-size: 15px;
  }
  .page-faq__faq-toggle {
    font-size: 22px;
  }
  .page-faq__brand-item h3 {
    font-size: 18px;
  }
  .page-faq__blog-item-title {
    font-size: 18px;
  }
  .page-faq__blog-item-excerpt {
    font-size: 14px;
  }
}