/* 
 * Header Styles - Áp dụng cho tất cả các trang
 * Mục đích: Tạo giao diện header đẹp và nhất quán trên mọi trang
 * Tác giả: AI Assistant
 * Ngày tạo: 2024
 */

/* CSS tùy chỉnh cho header-widget - xóa viền và background */
.header-widget {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.header-widget i {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

.header-widget:hover {
  background: transparent !important;
  transform: scale(1.1);
}

.header-widget:hover i {
  background: transparent !important;
  color: var(--primary) !important;
}

/* Đảm bảo các button không có viền */
.header-widget-group .header-widget {
  background: transparent !important;
  border: none !important;
  outline: none !important;
}

.header-widget-group .header-widget:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Giảm khoảng cách giữa các button header-widget */
.header-widget-group .header-widget {
  margin: 0 5px !important;
  padding: 0.3rem !important;
}

.header-widget-group .header-widget:first-child {
  margin-left: 0 !important;
}

.header-widget-group .header-widget:last-child {
  margin-right: 0 !important;
}

/* Giảm khoảng cách giữa các icon */
.header-widget i {
  margin: 0 !important;
  padding: 0 !important;
}

/* Bọc 4 icons đầu tiên vào khung hình chữ nhật bo tròn */
.header-widget-group .header-widget:nth-child(-n+4) {
  margin: 0 2px !important;
  padding: 0.4rem 0.6rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 25px !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Tạo khung chứa 4 icons */
.header-widget-group {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

/* Tách riêng 4 icons đầu và button login */
.header-widget-group .header-widget:nth-child(-n+4) {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 25px !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  margin: 0 1px !important;
  padding: 0.4rem 0.6rem !important;
}

/* Button login giữ nguyên style cũ */
.header-widget-group .header-widget:nth-child(5) {
  margin-left: 15px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
}

/* Tạo khung chung bọc 4 icons đầu tiên */
.header-widget-group::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% - 120px); /* Điều chỉnh width để bọc 4 icons */
  height: 45px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: -1;
}

/* Đặt position relative cho container */
.header-widget-group {
  position: relative !important;
}

/* Xóa background và border của từng icon */
.header-widget-group .header-widget:nth-child(-n+4) {
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  margin: 0 8px !important;
  padding: 0.4rem 0.6rem !important;
}

/* Button login tách biệt */
.header-widget-group .header-widget:nth-child(5) {
  margin-left: 20px !important;
}

/* Button login khi chưa đăng nhập - dịch sang bên phải */
.header-widget-group .header-widget[title="Login"] {
  margin-left: 40px !important;
}

/* Button profile khi đã đăng nhập - giữ nguyên vị trí */
.header-widget-group .header-widget[title="Profile"] {
  margin-left: 20px !important;
}

/* Thu nhỏ chiều dài của header-content */
.header-content {
  max-width: 90% !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

/* Hoặc có thể dùng width cố định */
.header-content {
  width: 1200px !important;
  max-width: 90% !important;
  margin: 0 auto !important;
}

/* Ẩn avatar khi chưa login */
.header-widget-group .header-widget[title="Login"] img {
  display: none !important;
}

/* Tăng margin cho button login để dịch sang phải nhiều hơn */
.header-widget-group .header-widget[title="Login"] {
  margin-left: 60px !important;
}

/* Đảm bảo text Login hiển thị đúng */
.header-widget-group .header-widget[title="Login"] span {
  margin-left: 0 !important;
  font-weight: 700 !important;
  color: #000000 !important;
  font-size: 14px !important;
  text-shadow: none !important;
}

/* Header layout cho màn hình 992px-1199px (giống layout desktop 768px-991px) */
@media (min-width: 992px) and (max-width: 1199px) {
  /* Ẩn header media group (mobile layout) */
  .header-media-group {
    display: none !important;
  }
  
  /* Hiện header logo chính */
  .header-logo {
    display: block !important;
  }
  
  /* Hiện header nav menu với chiều ngang thu nhỏ */
  .header-nav__menu {
    display: flex !important;
    max-width: 400px !important; /* Giới hạn chiều ngang nav menu */
    width: auto !important;
    flex-shrink: 1 !important; /* Cho phép nav menu co lại */
    overflow: hidden !important;
  }
  
  /* Thu nhỏ các nav items */
  .header-nav__menu li {
    margin-right: 15px !important; /* Giảm khoảng cách giữa menu items */
  }
  
  .header-nav__menu li a {
    padding: 5px 8px !important; /* Giảm padding của menu links */
    font-size: 14px !important; /* Giảm font size */
    white-space: nowrap !important; /* Không xuống dòng */
  }
  
  /* Hiện header widget group với desktop layout */
  .header-widget-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important; /* Giảm gap để tiết kiệm không gian */
    flex-shrink: 0 !important; /* Không cho phép widget group co lại */
    margin-left: -30px !important; /* Dịch toàn bộ widget group sang trái */
    transform: translateX(-20px) !important; /* Dịch thêm sang trái */
    position: relative !important;
  }
  
  /* Khung glass cho 4 icons đầu tiên */
  .header-widget-group::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 350px !important; /* Tăng width lên 350px để chắc chắn bọc hết cả 4 icons */
    height: 50px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 25px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    z-index: -1 !important;
  }
  
  /* Thu nhỏ widget để vừa màn hình */
  .header-widget {
    padding: 0.4rem 0.5rem !important;
    margin: 0 2px !important; /* Giảm margin */
    font-size: 14px !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* 4 icons đầu tiên trong khung */
  .header-widget:nth-child(-n+4) {
    background: transparent !important;
    border: none !important;
  }
  
  /* Ẩn text trong widget chỉ giữ icon */
  .header-widget span {
    display: none !important;
  }
  
  /* Style cho button login - chỉ text đơn giản */
  .header-widget[title="Login"] {
    display: flex !important; /* Đảm bảo hiển thị */
    visibility: visible !important; /* Đảm bảo visible */
    opacity: 1 !important; /* Đảm bảo opacity */
    margin-left: 20px !important; /* Tăng margin để tách khỏi khung */
    background: transparent !important; /* Bỏ background glass */
    backdrop-filter: none !important; /* Bỏ blur effect */
    -webkit-backdrop-filter: none !important; /* Bỏ blur effect */
    border: none !important; /* Bỏ viền */
    border-radius: 0 !important; /* Bỏ bo tròn */
    box-shadow: none !important; /* Bỏ đổ bóng */
    position: relative !important;
    z-index: 10 !important;
    padding: 0.4rem 0.5rem !important; /* Giữ padding cơ bản */
  }
  
  /* Style cho profile button - chỉ text đơn giản */
  .header-widget[title="Profile"] {
    display: flex !important; /* Đảm bảo hiển thị */
    visibility: visible !important; /* Đảm bảo visible */
    opacity: 1 !important; /* Đảm bảo opacity */
    margin-left: 20px !important; /* Tăng margin để tách khỏi khung */
    background: transparent !important; /* Bỏ background glass */
    backdrop-filter: none !important; /* Bỏ blur effect */
    -webkit-backdrop-filter: none !important; /* Bỏ blur effect */
    border: none !important; /* Bỏ viền */
    border-radius: 0 !important; /* Bỏ bo tròn */
    box-shadow: none !important; /* Bỏ đổ bóng */
    position: relative !important;
    z-index: 10 !important;
    padding: 0.4rem 0.5rem !important; /* Giữ padding cơ bản */
  }
  
  /* Đảm bảo không có CSS nào ẩn login button */
  .header-widget[title="Login"] span,
  .header-widget[title="Profile"] span {
    display: inline !important; /* Hiện text trong login button */
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }
}

/* Tách button profile ra khỏi nhóm 4 icon và di chuyển sang phải */
.header-widget-group .header-widget[title="Profile"] {
  margin-left: 40px !important; /* Tăng margin để tách xa khỏi nhóm 4 icon */
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Tạo khoảng cách rõ ràng giữa nhóm 4 icon và button profile */
.header-widget-group .header-widget:nth-child(4) {
  margin-right: 20px !important; /* Tạo khoảng cách với button profile */
}

/* Đảm bảo button profile không bị ảnh hưởng bởi khung glass */
.header-widget-group .header-widget[title="Profile"]::before {
  display: none !important;
}

/* Tạo khoảng cách rõ ràng hơn giữa nhóm 4 icon và button profile */
.header-widget-group .header-widget:nth-child(-n+4) {
  margin-right: 15px !important; /* Giảm margin bên phải của icon cuối cùng trong nhóm */
}

/* Tăng khoảng cách cho button profile */
.header-widget-group .header-widget[title="Profile"] {
  margin-left: 50px !important; /* Tăng margin để tách xa hơn */
  padding-left: 10px !important; /* Thêm padding bên trái */
  border-left: 2px solid rgba(255, 255, 255, 0.3) !important; /* Tạo đường kẻ phân cách */
}

/* Đảm bảo button profile có style riêng biệt */
.header-widget-group .header-widget[title="Profile"] img {
  margin-right: 8px !important; /* Khoảng cách giữa avatar và text */
}

.header-widget-group .header-widget[title="Profile"] span {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

.header-widget-group .header-widget[title="Profile"] span p {
  margin: 0 !important;
  line-height: 1.2 !important;
}

/* Responsive cho màn hình nhỏ - tăng khoảng cách */
@media (max-width: 1199px) {
  .header-widget-group .header-widget[title="Profile"] {
    margin-left: 40px !important; /* Giảm margin trên màn hình nhỏ */
  }
}

@media (max-width: 991px) {
  .header-widget-group .header-widget[title="Profile"] {
    margin-left: 30px !important; /* Giảm margin trên màn hình tablet */
  }
  
  .header-widget-group .header-widget:nth-child(-n+4) {
    margin-right: 10px !important; /* Giảm margin trên màn hình tablet */
  }
}

@media (max-width: 767px) {
  .header-widget-group .header-widget[title="Profile"] {
    margin-left: 25px !important; /* Giảm margin trên màn hình mobile */
    padding-left: 8px !important; /* Giảm padding trên mobile */
  }
  
  .header-widget-group .header-widget:nth-child(-n+4) {
    margin-right: 8px !important; /* Giảm margin trên mobile */
  }
  
  /* Ẩn đường kẻ phân cách trên mobile để tiết kiệm không gian */
  .header-widget-group .header-widget[title="Profile"] {
    border-left: none !important;
  }
}

/* Đảm bảo button profile hoàn toàn độc lập */
.header-widget-group .header-widget[title="Profile"] {
  /* Reset tất cả các style có thể ảnh hưởng */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  
  /* Style riêng cho button profile */
  margin-left: 50px !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  
  /* Đảm bảo hiển thị đúng */
  display: flex !important;
  align-items: center !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Hover effect cho button profile */
.header-widget-group .header-widget[title="Profile"]:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Style cho avatar trong button profile */
.header-widget-group .header-widget[title="Profile"] img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  margin-right: 10px !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

/* Style cho text trong button profile */
.header-widget-group .header-widget[title="Profile"] span {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  min-width: 0 !important; /* Cho phép text co lại */
}

.header-widget-group .header-widget[title="Profile"] span p {
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important; /* Không xuống dòng */
  overflow: hidden !important; /* Ẩn text dài */
  text-overflow: ellipsis !important; /* Hiển thị dấu ... */
  max-width: 120px !important; /* Giới hạn chiều rộng text */
}

/* Tạo khung rõ ràng cho nhóm 4 icon */
.header-widget-group {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

/* Khung bọc 4 icon đầu tiên */
.header-widget-group::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 320px !important; /* Tăng width để bọc cả 4 icons bao gồm button Nạp tiền */
  height: 45px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 25px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
  z-index: -1 !important;
}

/* Style cho 4 icon trong khung (bao gồm cả button Nạp tiền) */
.header-widget-group .header-widget:nth-child(-n+4) {
  background: transparent !important;
  border: none !important;
  margin: 0 8px !important;
  padding: 0.4rem 0.6rem !important;
  position: relative !important;
  z-index: 1 !important;
  transition: all 0.3s ease !important;
}

/* Hover effect cho 4 icon */
.header-widget-group .header-widget:nth-child(-n+4):hover {
  transform: scale(1.1) !important;
  color: var(--primary) !important;
}

/* Đảm bảo button profile không bị ảnh hưởng bởi khung */
.header-widget-group .header-widget[title="Profile"] {
  position: relative !important;
  z-index: 10 !important;
  margin-left: 50px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Responsive cho khung 4 icon */
@media (max-width: 1199px) {
  .header-widget-group::before {
    width: 300px !important; /* Giảm width trên màn hình nhỏ */
  }
}

@media (max-width: 991px) {
  .header-widget-group::before {
    width: 280px !important; /* Giảm width trên tablet */
  }
  
  .header-widget-group .header-widget:nth-child(-n+4) {
    margin: 0 6px !important; /* Giảm margin trên tablet */
    padding: 0.3rem 0.5rem !important;
  }
}

@media (max-width: 767px) {
  .header-widget-group::before {
    width: 260px !important; /* Giảm width trên mobile */
    height: 40px !important;
  }
  
  .header-widget-group .header-widget:nth-child(-n+4) {
    margin: 0 4px !important; /* Giảm margin trên mobile */
    padding: 0.25rem 0.4rem !important;
  }
}

/* Sidebar full màn hình khi mở - chỉ dưới header */
.nav-sidebar.active {
  position: fixed !important;
  top: 0 !important; /* Nằm ngay dưới header */
  left: 0 !important;
  width: 100vw !important; /* Full chiều rộng màn hình */
  height: 100vh !important; /* Full chiều cao màn hình */
  z-index: 1001 !important; /* Cao hơn banner nhưng thấp hơn header */
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1) !important;
  transform: translateX(0) !important;
  transition: transform 0.3s ease !important;
  overflow-y: auto !important; /* Cho phép scroll nếu content dài */
}

/* Đảm bảo sidebar không che header */
.header-part {
  z-index: 1002 !important; /* Header luôn trên cùng */
}

/* Đảm bảo khi sidebar đóng, không có backdrop làm mờ */
.nav-sidebar:not(.active) {
  transform: translateX(-100%) !important; /* Đẩy sidebar ra ngoài màn hình */
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Xóa mọi backdrop/overlay khi sidebar đóng */
body:not(:has(.nav-sidebar.active)) {
  overflow: auto !important; /* Cho phép scroll */
}

/* Ngăn chặn backdrop làm mờ web */
.nav-sidebar:not(.active)::before,
.nav-sidebar:not(.active)::after {
  display: none !important;
}

/* Đảm bảo không có overlay nào khác */
.backdrop,
.modal-backdrop,
.overlay {
  display: none !important;
}

/* Ẩn button close trong sidebar */
.nav-close {
  display: none !important;
}

/* Khóa scroll khi sidebar mở */
body.sidebar-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* Style cho button trong sidebar - hình chữ nhật màu đen chữ trắng */
.nav-sidebar .nav-btn .btn,
.nav-sidebar .nav-btn .btn-inline,
.nav-sidebar .nav-btn a,
.nav-sidebar .nav-btn a.btn,
.nav-sidebar .nav-btn a.btn-inline,
.nav-sidebar .nav-content .nav-btn .btn,
.nav-sidebar .nav-content .nav-btn .btn-inline,
.nav-sidebar .nav-content .nav-btn a {
  background-color: #000000 !important; /* Nền đen */
  color: #ffffff !important; /* Chữ trắng */
  border: none !important;
  border-radius: 8px !important; /* Bo góc nhẹ cho hình chữ nhật */
  padding: 12px 20px !important; /* Padding đẹp */
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  background-image: none !important;
  display: inline-block !important;
  font-weight: 500 !important;
  text-align: center !important;
  margin: 5px 0 !important; /* Khoảng cách giữa các button */
  width: 100% !important; /* Full width */
  transition: all 0.3s ease !important;
}

/* Hover effect cho button */
.nav-sidebar .nav-btn .btn:hover,
.nav-sidebar .nav-btn .btn-inline:hover,
.nav-sidebar .nav-btn a:hover,
.nav-sidebar .nav-btn a.btn:hover,
.nav-sidebar .nav-btn a.btn-inline:hover {
  background-color: #333333 !important; /* Đen nhạt hơn khi hover */
  color: #ffffff !important;
}

/* Icon trong button */
.nav-sidebar .nav-btn .btn i,
.nav-sidebar .nav-btn .btn-inline i,
.nav-sidebar .nav-btn a i {
  color: #ffffff !important;
  margin-right: 8px !important;
}

/* Bỏ mọi pseudo-element có thể tạo đường kẻ */
.nav-sidebar .nav-btn .btn::before,
.nav-sidebar .nav-btn .btn::after,
.nav-sidebar .nav-btn .btn-inline::before,
.nav-sidebar .nav-btn .btn-inline::after,
.nav-sidebar .nav-btn a::before,
.nav-sidebar .nav-btn a::after {
  display: none !important;
  border: none !important;
}

/* Đổi màu số dư trong sidebar về đen - override CSS chính */
.nav-sidebar .text-wallet,
.nav-sidebar .nav-select-group .text-wallet,
.nav-sidebar .nav-select-group strong.text-wallet,
.nav-sidebar strong.text-wallet,
.nav-sidebar p .text-wallet,
.nav-sidebar p strong.text-wallet {
  color: #000000 !important; /* Màu đen */
  background: none !important; /* Bỏ background image gây màu đỏ */
  background-color: transparent !important; /* Bỏ background color */
  background-image: none !important; /* Bỏ background image */
  font-weight: normal !important; /* Bỏ bold */
  font-size: inherit !important; /* Bỏ font size riêng */
}

/* Ẩn phần số dư khi chưa đăng nhập (khi có button đăng nhập) */
.nav-sidebar:has(.nav-btn a[href*="login"]) .nav-select-group {
  display: none !important;
}

/* Search Modal Styles */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-modal__content {
  background: #ffffff;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-modal.active .search-modal__content {
  transform: translateY(0);
}

.search-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #f0f0f0;
}

.search-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.search-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.search-modal__close:hover {
  background: #f0f0f0;
  color: #333;
}

.search-modal__body {
  padding: 25px;
}

.search-input__wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-input__icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 16px;
}

.search-input {
  width: 100%;
  padding: 15px 45px 15px 45px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 86, 217, 0.1);
}

.search-input__clear {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.search-input__clear.visible {
  opacity: 1;
  visibility: visible;
}

.search-input__clear:hover {
  background: #f0f0f0;
  color: #333;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-result-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(127, 86, 217, 0.1);
  transform: translateY(-2px);
}

.search-result-item__image {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.search-result-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-item__content {
  flex: 1;
  min-width: 0;
}

.search-result-item__content h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.search-result-item__content .price {
  margin: 0 0 3px 0;
  font-size: 14px;
  color: #666;
}

.search-result-item__content .category {
  margin: 0 0 3px 0;
  font-size: 12px;
  color: #999;
}

.search-result-item__content .desc {
  margin: 0;
  font-size: 13px;
  color: #888;
  line-height: 1.4;
}

/* Mobile Search Modal */
.mobile-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-search-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.mobile-search-content {
  background: #ffffff;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  padding: 25px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.mobile-search-modal.active .mobile-search-content {
  transform: translateY(0);
}

.mobile-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mobile-search-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.mobile-search-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--primary);
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-search-close:hover {
  background: rgba(127, 86, 217, 0.1);
  color: var(--primary);
  transform: scale(1.1);
}

.mobile-search-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.mobile-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 86, 217, 0.1);
}

.mobile-search-button {
  width: 100%;
  padding: 15px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-search-button:hover {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-modal__content {
    width: 95%;
    margin: 20px;
  }
  
  .search-modal__header,
  .search-modal__body {
    padding: 15px 20px;
  }
  
  .search-input {
    padding: 12px 40px 12px 40px;
    font-size: 14px;
  }
  
  .search-result-item {
    padding: 12px;
  }
  
  .search-result-item__image {
    width: 50px;
    height: 50px;
    margin-right: 12px;
  }
  
  .search-result-item__content h4 {
    font-size: 14px;
  }
  
  .search-result-item__content .price,
  .search-result-item__content .category {
    font-size: 12px;
  }
}

/* ===== CẢI THIỆN GIAO DIỆN DANH SÁCH SẢN PHẨM ===== */

/* Hiệu ứng cho feature-card */
.feature-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 16px !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
}

.feature-card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
  transition: left 0.6s ease !important;
}

.feature-card:hover::before {
  left: 100% !important;
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
  border-color: var(--primary) !important;
}

/* Hiệu ứng cho tên sản phẩm */
.feature-name a {
  color: #333 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  line-height: 1.4 !important;
  transition: all 0.3s ease !important;
  display: block !important;
  margin-bottom: 0.5rem !important;
}

.feature-name a:hover {
  color: var(--primary) !important;
  transform: translateX(5px) !important;
}

/* Hiệu ứng cho rating */
.feature-rating {
  margin-bottom: 0.75rem !important;
}

.feature-rating i {
  color: #ffc107 !important;
  font-size: 0.9rem !important;
  margin-right: 2px !important;
  transition: all 0.3s ease !important;
}

.feature-rating i:hover {
  transform: scale(1.2) rotate(5deg) !important;
  color: #ff9800 !important;
}

.feature-rating a {
  color: #666 !important;
  text-decoration: none !important;
  font-size: 0.85rem !important;
  margin-left: 0.5rem !important;
  transition: color 0.3s ease !important;
}

.feature-rating a:hover {
  color: var(--primary) !important;
}

/* Hiệu ứng cho label thông tin */
.label-text {
  display: inline-block !important;
  padding: 0.25rem 0.5rem !important;
  margin: 0.25rem 0.5rem 0.25rem 0 !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.label-text.feat {
  background: rgba(76, 175, 80, 0.1) !important;
  color: #4caf50 !important;
  border: 1px solid rgba(76, 175, 80, 0.2) !important;
}

.label-text.order {
  background: rgba(255, 193, 7, 0.1) !important;
  color: #ff9800 !important;
  border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

.label-text.off {
  background: rgba(244, 67, 54, 0.1) !important;
  color: #f44336 !important;
  border: 1px solid rgba(244, 67, 54, 0.2) !important;
  animation: pulse 2s infinite !important;
}

.label-text:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Hiệu ứng cho giá */
.feature-price {
  margin: 1rem 0 !important;
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
}

.feature-price del {
  color: #999 !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  margin-right: 0.5rem !important;
  text-decoration: line-through !important;
}

.feature-price span {
  background: linear-gradient(45deg, var(--primary), #ff6b6b) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: priceGlow 3s ease-in-out infinite alternate !important;
}

/* Hiệu ứng cho mô tả */
.feature-desc {
  color: #666 !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  margin-bottom: 1rem !important;
  transition: all 0.3s ease !important;
}

.feature-desc i {
  color: var(--primary) !important;
  margin-right: 0.5rem !important;
  transition: transform 0.3s ease !important;
}

.feature-desc:hover i {
  transform: translateX(3px) !important;
}

/* Hiệu ứng cho buttons */
.btn-more, .btn-buy {
  padding: 0.75rem 1.5rem !important;
  border: none !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
}

.btn-more {
  background: linear-gradient(45deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  border: 2px solid #dee2e6 !important;
}

.btn-more:hover {
  background: linear-gradient(45deg, #e9ecef, #dee2e6) !important;
  color: #212529 !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.btn-buy {
  background: #000000 !important;
  color: white !important;
  border: 2px solid #000000 !important;
}

.btn-buy:hover {
  background: #333333 !important;
  border: 2px solid #333333 !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

/* Hiệu ứng cho product-disable */
.feature-card.product-disable {
  opacity: 0.6 !important;
  filter: grayscale(30%) !important;
}

.feature-card.product-disable:hover {
  transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Hiệu ứng cho card-price-product-list (LIST view) */
.card-price-product-list {
  text-align: center !important;
  padding: 1rem !important;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  border-radius: 12px !important;
  margin-bottom: 1rem !important;
  transition: all 0.3s ease !important;
}

.card-price-product-list:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Hiệu ứng cho categories đơn giản */
.categories-container {
  padding: 2rem 0 !important; /* Giảm padding từ 3rem xuống 2rem */
  text-align: center !important;
  margin-top: -1rem !important; /* Dịch lên trên */
}

.categories-title {
  font-size: 2.8rem !important;
  font-weight: 800 !important;
  color: #333 !important;
  margin-bottom: 2rem !important; /* Giảm margin từ 3rem xuống 2rem */
  text-align: center !important;
  position: relative !important;
}

.categories-title::after {
  content: '' !important;
  position: absolute !important;
  bottom: -10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 80px !important;
  height: 4px !important;
  background: linear-gradient(45deg, var(--primary), #ff6b6b) !important;
  border-radius: 2px !important;
}

.categories-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; /* Tăng minmax để đảm bảo kích thước đủ */
  gap: 2rem !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

.category-link {
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.category-link:hover {
  transform: translateY(-10px) scale(1.05) !important;
}

.category-item {
  background: #ffffff !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 20px !important;
  padding: 2rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 1.5rem !important;
  transition: all 0.4s ease !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  position: relative !important;
  overflow: hidden !important;
  width: 100% !important; /* Đảm bảo full width */
  height: 120px !important; /* Chiều cao cố định cho tất cả */
  min-height: 120px !important; /* Chiều cao tối thiểu */
  max-height: 120px !important; /* Chiều cao tối đa */
}

.category-item::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent) !important;
  transition: left 0.6s ease !important;
}

.category-link:hover .category-item::before {
  left: 100% !important;
}

.category-link:hover .category-item {
  border-color: var(--primary) !important;
  box-shadow: 0 15px 40px rgba(0, 123, 255, 0.2) !important;
  transform: translateY(-5px) !important;
}

.category-icon {
  width: 60px !important;
  height: 60px !important;
  object-fit: cover !important; /* Cover để ảnh fill đầy đủ khung */
  border-radius: 12px !important;
  transition: all 0.4s ease !important;
  flex-shrink: 0 !important;
  background: #f8f9fa !important; /* Nền nhẹ để ảnh nổi bật */
  padding: 0 !important; /* Bỏ padding để ảnh fill đầy đủ */
  border: 1px solid #e9ecef !important; /* Viền nhẹ */
}

.category-link:hover .category-icon {
  transform: scale(1.2) rotate(5deg) !important;
  background: #ffffff !important; /* Nền trắng khi hover */
  border-color: var(--primary) !important; /* Viền màu primary khi hover */
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15) !important; /* Shadow khi hover */
}

.category-name {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #333 !important;
  text-align: left !important;
  flex: 1 !important;
  transition: color 0.3s ease !important;
}

.category-link:hover .category-name {
  color: var(--primary) !important;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes priceGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.2); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hiệu ứng loading cho sản phẩm */
.feature-card {
  animation: slideInUp 0.6s ease-out !important;
}

.feature-card:nth-child(1) { animation-delay: 0.1s !important; }
.feature-card:nth-child(2) { animation-delay: 0.2s !important; }
.feature-card:nth-child(3) { animation-delay: 0.3s !important; }
.feature-card:nth-child(4) { animation-delay: 0.4s !important; }
.feature-card:nth-child(5) { animation-delay: 0.5s !important; }
.feature-card:nth-child(6) { animation-delay: 0.6s !important; }

/* Responsive */
@media (max-width: 768px) {
  .feature-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 1rem !important;
    padding: 0 0.5rem !important;
  }
  
  .category-item {
    padding: 1.5rem !important;
  }
  
  .category-icon {
    width: 50px !important;
    height: 50px !important;
    padding: 6px !important; /* Giảm padding trên mobile */
  }
  
  .categories-title {
    font-size: 2.2rem !important;
  }
}

@media (max-width: 480px) {
  .feature-card {
    padding: 0.8rem !important;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0.8rem !important;
  }
  
  .category-item {
    padding: 1rem !important;
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .category-icon {
    width: 45px !important;
    height: 45px !important;
    padding: 5px !important; /* Giảm padding trên mobile nhỏ */
  }
  
  .category-name {
    text-align: center !important;
  }
  
  .categories-title {
    font-size: 1.8rem !important;
  }
}

/* ===== NÚT QUAY LẠI TRANG CHỦ ===== */

.back-to-home-container {
  text-align: left !important;
  margin-bottom: 1rem !important; /* Giảm từ 2rem xuống 1rem */
  padding: 0 0.5rem !important;
  margin-top: -0.5rem !important; /* Thêm margin-top âm để kéo lên trên */
}

.btn-back-home {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.75rem 1.5rem !important;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  text-decoration: none !important;
  border: 2px solid #dee2e6 !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-back-home::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent) !important;
  transition: left 0.6s ease !important;
}

.btn-back-home:hover::before {
  left: 100% !important;
}

.btn-back-home:hover {
  background: linear-gradient(45deg, #e9ecef, #dee2e6) !important;
  color: #212529 !important;
  transform: translateY(-3px) translateX(-5px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  border-color: var(--primary) !important;
}

.btn-back-home i {
  font-size: 1rem !important;
  transition: transform 0.3s ease !important;
}

.btn-back-home:hover i {
  transform: translateX(-3px) !important;
}

.btn-back-home span {
  font-weight: 600 !important;
  transition: color 0.3s ease !important;
}

.btn-back-home:hover span {
  color: var(--primary) !important;
}

/* Responsive cho nút quay lại */
@media (max-width: 768px) {
  .back-to-home-container {
    text-align: center !important;
    margin-bottom: 1.5rem !important;
  }
  
  .btn-back-home {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .btn-back-home {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Responsive cho mobile */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 1rem !important;
    padding: 0 0.5rem !important;
  }
  
  .category-item {
    padding: 0 !important; /* Bỏ padding để ảnh full khung */
    flex-direction: column !important;
    text-align: center !important;
    overflow: hidden !important; /* Ẩn phần thừa */
    height: 120px !important; /* Chiều cao cố định cho mobile */
    min-height: 120px !important;
    max-height: 120px !important;
  }
  
  .category-icon {
    width: 100% !important; /* Full width của khung */
    height: 100% !important; /* Full height của khung */
    object-fit: cover !important; /* Cover để ảnh full khung */
    padding: 0 !important; /* Bỏ padding */
    border: none !important; /* Bỏ viền */
    background: none !important; /* Bỏ background */
    border-radius: 16px !important; /* Đồng bộ với desktop */
    margin: 0 !important; /* Bỏ margin */
    display: block !important; /* Đảm bảo hiển thị block */
  }
  
  .category-name {
    display: none !important; /* Ẩn title trên mobile */
  }
  
  .categories-title {
    font-size: 2.2rem !important;
  }
}

/* Responsive cho mobile nhỏ */
@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 cột ở mobile nhỏ */
    gap: 0.8rem !important;
  }
  
  .category-item {
    padding: 0 !important; /* Bỏ padding để ảnh full khung */
    flex-direction: column !important;
    text-align: center !important;
    overflow: hidden !important; /* Ẩn phần thừa */
    height: 120px !important; /* Chiều cao cố định cho mobile nhỏ */
    min-height: 120px !important;
    max-height: 120px !important;
  }
  
  .category-icon {
    width: 100% !important; /* Full width của khung */
    height: 100% !important; /* Full height của khung */
    object-fit: cover !important; /* Cover để ảnh full khung */
    padding: 0 !important; /* Bỏ padding */
    border: none !important; /* Bỏ viền */
    background: none !important; /* Bỏ background */
    border-radius: 16px !important; /* Đồng bộ với desktop */
    margin: 0 !important; /* Bỏ margin */
    display: block !important; /* Đảm bảo hiển thị block */
  }
  
  .category-name {
    display: none !important; /* Ẩn title trên mobile nhỏ */
  }
  
  .categories-title {
    font-size: 1.8rem !important;
  }
}

/* Responsive cho màn hình rất nhỏ (dưới 400px) */
@media (max-width: 400px) {
  .category-item {
    height: 80px !important; /* Giảm chiều cao từ 120px xuống 80px */
    min-height: 80px !important;
    max-height: 80px !important;
    padding: 0 !important; /* Bỏ padding để ảnh full khung */
  }
  
  .categories-grid {
    gap: 0.6rem !important; /* Giảm khoảng cách giữa các item */
  }
}
