/* --- GLOBAL STyles & VARIABLES --- */
:root {
  --primary-color: #111111;
  --secondary-color: #ffffff;
  --accent-color: #ff4500; /* OrangeRed */
  --text-color: #333;
  --light-gray-color: #f7f7f7;
  --border-color: #e5e5e5;
  --font-family: "Be Vietnam Pro", sans-serif;
  --container-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--secondary-color);
  -webkit-font-smoothing: antialiased; /* Làm mịn font trên Safari/Chrome */
  -moz-osx-font-smoothing: grayscale; /* Làm mịn font trên Firefox */
  overflow-x: hidden;
}

body.nav-open {
  /* This class is still useful if you want to add an overlay later */
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 900;
}
h2 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  text-align: center;
  margin-bottom: 50px;
  font-weight: 900;
}
p {
  margin-bottom: 1rem;
}
a {
  color: var(--accent-color);
  text-decoration: none;
}
section {
  padding: clamp(60px, 8vw, 80px) 0;
  overflow-x: hidden;
}

/* --- HIỆU ỨNG CUỘN TRANG --- */
.reveal {
  position: relative;
  transform: translateY(100px);
  opacity: 0;
  transition: all 1s ease-in-out;
}

.reveal.visible {
  transform: translateY(0);
  opacity: 1;
}

/* --- HEADER --- */
.header {
  padding: 15px 0;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: background-color 0.4s ease, box-shadow 0.4s ease,
    padding 0.4s ease;
}
.header.scrolled {
  background-color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--accent-color), #ff8c00, #ff4500);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 15px;
}

.main-nav a {
  color: var(--primary-color);
  font-weight: 500;
  transition: color 0.3s ease, background-color 0.3s ease;
  position: relative;
  padding: 8px 16px;
  border-radius: 50px;
}

.main-nav a:hover {
  color: var(--accent-color);
  background-color: #f5f5f5;
}

.hotline {
  background-color: var(--accent-color);
  color: var(--secondary-color);
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.3s ease;
}
.hotline:hover {
  background-color: #e03e00;
  transform: scale(1.05);
}
.hotline i {
  margin-right: 8px;
}

/* --- MOBILE NAV TOGGLE --- */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 10px;
  position: relative;
}

.hamburger {
  display: block;
  position: relative;
  width: 28px;
  height: 2px;
  background-color: var(--primary-color);
  transition: all 0.3s ease-in-out;
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 28px;
  height: 2px;
  background-color: var(--primary-color);
  transition: all 0.3s ease-in-out;
}
.hamburger::before {
  top: -8px;
}
.hamburger::after {
  bottom: -8px;
}

/* --- HERO SECTION --- */
.hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("https://images.unsplash.com/photo-1542291026-7eec264c27ff?q=80&w=2070&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--secondary-color);
  text-align: center;
  padding: clamp(100px, 15vh, 150px) 0;
}
.hero h1 {
  margin-bottom: 20px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 40px;
}
.cta-button {
  background-color: var(--accent-color);
  color: var(--secondary-color);
  padding: 15px 35px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 69, 0, 0.4);
}
.cta-button:hover {
  background-color: var(--secondary-color);
  color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 69, 0, 0.5);
}

/* --- COMMITMENTS SECTION --- */
.commitments {
  background: var(--light-gray-color);
}
.commitments .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  text-align: center;
}
.commitment-item i {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}
.commitment-item h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

/* --- PRODUCTS SECTION --- */
.products-section .tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.tab-link {
  padding: 10px 25px;
  font-size: 1rem;
  border: 1px solid transparent;
  background-color: #f0f0f0;
  font-weight: 500;
  color: var(--text-color);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.tab-link:not(.active):hover {
  transform: scale(1.05);
  background-color: #e5e5e5;
}

.tab-link.active {
  background: linear-gradient(45deg, var(--accent-color), #ff8c00);
  color: var(--secondary-color);
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255, 69, 0, 0.3);
  transform: scale(1.05);
}

.product-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px; /* Giảm khoảng cách một chút */
}
.product-card {
  border: 1px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  background: var(--secondary-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: none;
}
.product-card.show {
  display: block;
}
.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.product-image {
  position: relative;
  width: 100%;
}
.product-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}
.product-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--accent-color);
  color: white;
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 50px;
  font-weight: 700;
}
.product-tag.sale-tag {
  background: #28a745;
}
.product-info {
  padding: 20px;
}
.product-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  height: 44px;
  overflow: hidden;
}
.product-rating {
  color: #f39c12;
  margin-bottom: 10px;
}

.product-sold-count {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.product-sold-count .fa-fire {
  color: var(--accent-color);
}

.product-price {
  margin-bottom: 15px;
}

.new-price {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent-color);
}
.old-price {
  text-decoration: line-through;
  color: #999;
  margin-left: 10px;
}
.buy-button {
  display: block;
  background: #28a745;
  color: var(--secondary-color);
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  transition: background-color 0.3s;
}
.buy-button:hover {
  background: var(--accent-color);
}
#load-more-btn {
  display: block;
  margin: 40px auto 0;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent-color);
  color: var(--secondary-color);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#load-more-btn:hover {
  background-color: var(--primary-color);
  transform: scale(1.05);
}

/* --- TESTIMONIALS --- */
.testimonials-section {
  background-color: var(--light-gray-color);
}
.testimonial-slider-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.testimonial-slider {
  overflow: hidden;
}
.testimonial-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.testimonial-card {
  flex-shrink: 0;
  width: 100%;
  background: var(--secondary-color);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}
.testimonial-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px auto;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  display: block;
}
.testimonial-card h4 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.testimonial-rating {
  color: #f39c12;
  margin-bottom: 15px;
}
.testimonial-card p {
  font-style: italic;
  color: #555;
  font-size: 0.95rem;
  min-height: 100px;
  position: relative;
}

.testimonial-card p::before,
.testimonial-card p::after {
  content: none;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-color);
  z-index: 10;
  transition: all 0.3s ease;
}
.slider-btn:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}
.prev-btn {
  left: 0;
}
.next-btn {
  right: 0;
}
.slider-dots {
  text-align: center;
  margin-top: 30px;
}
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
  border: none;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.dot.active {
  background-color: var(--accent-color);
}

/* --- CONTACT / MAP SECTION --- */
.contact-section {
  text-align: center;
}
.address {
  font-size: 1.2rem;
  margin-bottom: 30px;
}
.map-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

/* --- FOOTER --- */
.footer {
  background: var(--primary-color);
  color: #a0a0a0;
  padding: 60px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h3 {
  color: var(--secondary-color);
  margin-bottom: 20px;
}
.footer-col p {
  margin-bottom: 10px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul a {
  color: #a0a0a0;
  transition: color 0.3s;
}
.footer-col ul a:hover {
  color: var(--accent-color);
}
.social-icons a {
  display: inline-flex;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: #333;
  color: white;
  margin-right: 10px;
  transition: background-color 0.3s, transform 0.3s;
}
.social-icons a:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
}
.footer-bottom {
  text-align: center;
  border-top: 1px solid #333;
  padding-top: 20px;
}

/* --- UTILITY CLASSES (Zalo, Scroll to Top) --- */
.zalo-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  z-index: 999;
  transition: transform 0.3s ease;
}
.zalo-chat-button:hover {
  transform: scale(1.1);
}
.zalo-chat-button img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--accent-color);
  color: white;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s, transform 0.3s;
}
#scrollToTopBtn:hover {
  background-color: #e03e00;
  transform: scale(1.1);
}

/* --- RESPONSIVE DESIGN --- */

/* Tablet & nhỏ hơn (dưới 992px) */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .social-icons {
    justify-content: center;
  }
}

/* Điện thoại & Tablet đứng (dưới 768px) */
@media (max-width: 767px) {
  /* Cho header làm gốc định vị cho menu */
  .header.scrolled {
    position: sticky;
  }

  .mobile-nav-toggle {
    display: block;
  }

  /* === NEW: MENU XỔ XUỐNG ĐƠN GIẢN === */
  .nav-wrapper {
    position: absolute;
    top: 100%; /* Nằm ngay dưới header */
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 10px 15px -5px rgba(0, 0, 0, 0.1);

    /* Giao diện bên trong */
    flex-direction: column;
    align-items: center; /* Căn giữa các mục */
    gap: 0; /* Xóa bỏ gap cũ */
    padding: 10px 0;

    /* Hiệu ứng xổ xuống */
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s ease-out, visibility 0.4s ease,
      padding 0.4s ease;
  }

  .nav-wrapper.is-open {
    max-height: 500px; /* Chiều cao tối đa khi mở */
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    text-align: center;
    gap: 0;
    width: 100%;
  }

  .main-nav a {
    display: block; /* Cho link chiếm toàn bộ chiều rộng */
    padding: 15px; /* Tăng vùng nhấn */
    font-size: 1.1rem; /* Cỡ chữ vừa phải */
    border-radius: 0; /* Bỏ bo tròn */
  }

  .hotline {
    margin-top: 10px;
  }
  /* === END NEW === */

  .mobile-nav-toggle.is-open .hamburger {
    background-color: transparent;
  }
  .mobile-nav-toggle.is-open .hamburger::before {
    transform: rotate(45deg) translate(5px, -6px);
  }
  .mobile-nav-toggle.is-open .hamburger::after {
    transform: rotate(-45deg) translate(5px, 6px);
  }

  .hero {
    background-attachment: scroll;
  }

  .prev-btn {
    left: 10px;
  }
  .next-btn {
    right: 10px;
  }
}

/* IPhone và các điện thoại màn hình nhỏ (dưới 576px) */
@media (max-width: 576px) {
  .commitments .container {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Cải thiện cho Desktop với slider testimonials */
@media (min-width: 768px) {
  .testimonial-card {
    width: calc(50% - 20px);
    margin: 0 10px;
  }
}
