/* Reset định dạng cơ bản */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
/*Thanh menu*/
/* Thanh Navbar chính */
.navbar {
  display: flex;
  justify-content: space-between; /* Đẩy 3 phần về 3 phía */
  align-items: center;
  background-color: #008848; /* Màu xanh đặc trưng bách hóa */
  padding: 10px 5%;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo a {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.logo span {
  color: #ffc107; /* Tạo điểm nhấn cho chữ Xanh */
}

/* Danh mục ở giữa */
.links {
  display: flex;
  list-style: none;
}

.links li {
  margin: 0 15px;
  position: relative;
}

.links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.links a:hover {
  color: #ffc107;
}

/* Thiết kế khung của menu con */
.dropdown-menu {
  position: absolute;
  top: 100%; /* Hiển thị ngay sát mép dưới menu cha */
  left: 0;
  background-color: #ffffff;
  list-style: none;
  min-width: 180px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: none; /* Mặc định ẩn đi */
  z-index: 999;
  border-radius: 0 0 4px 4px;
  padding: 10px 0;
}

/* Các mục bên trong menu con */
.dropdown-menu li {
  margin: 0; /* Xóa margin cũ của li cha */
  width: 100%;
}

.dropdown-menu a {
  color: #333 !important; /* Đổi màu chữ sang tối để dễ đọc trên nền trắng */
  padding: 10px 20px;
  display: block;
  font-weight: normal;
  font-size: 14px;
}

/* Hiệu ứng khi di chuột vào từng mục con */
.dropdown-menu a:hover {
  background-color: #f5f5f5;
  color: #008848 !important; /* Màu xanh đặc trưng */
}

/* QUAN TRỌNG: Khi di chuột vào <li> cha, hiển thị .dropdown-menu con */
.links li:hover .dropdown-menu {
  display: block;
}

/* Bộ công cụ tìm kiếm bên phải */
.search {
  display: flex;
}

.search input {
  padding: 8px 12px;
  border: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  width: 200px;
}

.search button {
  padding: 8px 15px;
  border: none;
  background-color: #ffc107;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
  transition: background 0.3s;
}

.search button:hover {
  background-color: #e0a800;
}
/* Banner quảng cáo */
.banner-container {
  width: 100%;
  overflow: hidden; /* Ẩn phần banner thừa ra ngoài màn hình */
  background: white;
  padding: 20px 0;
  position: relative;
}

.slide-track {
  display: flex;
  width: calc(
    650px * 10
  ); /* Chiều rộng = (chiều rộng 1 banner) * (tổng số lượng banner bao gồm bản sao) */
  animation: scroll 20s linear infinite; /* Chạy liên tục trong 20 giây */
}

.slide {
  width: 650px; /* Bạn có thể điều chỉnh kích thước banner tại đây */
  height: 150px;
  padding: 0 10px;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Giúp ảnh không bị méo */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Hiệu ứng chạy từ trái sang phải */
@keyframes scroll {
  0% {
    transform: translateX(-50%); /* Bắt đầu từ một nửa danh sách */
  }
  100% {
    transform: translateX(0); /* Chạy về vị trí gốc */
  }
}

/* Tạm dừng khi di chuột vào (tùy chọn) */
.banner-container:hover .slide-track {
  animation-play-state: paused;
}

/* Container chính cho khu vực sản phẩm */
.special-products {
  padding: 40px 5%;
  background-color: #f4f4f4;
}

.section-title {
  text-align: center;
  color: #008848;
  margin-bottom: 30px;
  text-transform: uppercase;
}

/* Thiết lập Grid 4 cột */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 cột đều nhau */
  gap: 20px; /* Khoảng cách giữa các ô */
}

/* Định dạng từng thẻ sản phẩm */
.product-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  position: relative;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  border: 1px solid #eee;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Nhãn giảm giá */
.badge-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #ff4d4d;
  color: white;
  padding: 2px 8px;
  font-weight: bold;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1;
}

/* Ảnh sản phẩm */
.product-img img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 15px;
}

/* Thông tin văn bản */
.product-name {
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
  height: 40px; /* Giữ độ cao cố định cho tên */
  overflow: hidden;
}

.old-price {
  text-decoration: line-through;
  color: #888;
  font-size: 14px;
}

.current-price {
  color: #d0021b;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}

/* Nút mua hàng */
.add-to-cart {
  width: 100%;
  padding: 10px;
  border: 1px solid #008848;
  background: transparent;
  color: #008848;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
}

.add-to-cart:hover {
  background: #008848;
  color: white;
}
/* Footer */
.main-footer {
  background-color: #222; /* Màu nền tối để phân biệt với thân trang */
  color: #ccc;
  padding: 50px 5% 20px;
  font-size: 14px;
  line-height: 1.6;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap; /* Tự động xuống dòng trên thiết bị nhỏ */
  gap: 30px;
}

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-col h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 16px;
  position: relative;
  padding-bottom: 10px;
}

/* Gạch chân nhỏ dưới tiêu đề cột */
.footer-col h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: #008848;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: #008848; /* Màu xanh khi di chuột vào */
}

/* Phần bản quyền ở dưới cùng */
.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #444;
  font-size: 12px;
}

.cart-icon {
  position: relative;
  font-size: 20px;
  cursor: pointer;
  margin-left: 20px;
}

#cart-count {
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  position: absolute;
  top: -8px;
  right: -10px;
}
