.custom-menu-trigger {
  position: relative;
}

/* Dropdown chính (danh sách menu cha) */
.custom-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 999;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  margin: 0;
  min-width: 220px;
}

/* Submenu con (dropdown con) */
.custom-dropdown .sub-menu {
  display: none;
  position: absolute;
  top: 100%; /* nằm ngay dưới menu cha */
  left: 0; /* căn theo chiều ngang của menu cha */
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  min-width: 220px;
  z-index: 1000;
  padding: 10px 0;
  border-radius: 10px;
}

.custom-dropdown li.menu-item-has-children > a {
  position: relative;
  display: inline-block;
  padding-bottom: 12px; /* để có khoảng cho mũi tên */
}
.custom-dropdown li.menu-item-has-children > a::after {
  content: "";
  position: absolute;
  bottom: 0; /* nằm dưới cùng của menu cha */
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 7px;
  background-image: url("https://3dbrute.com/wp-content/uploads/2024/10/arrow-down.png");
  background-repeat: no-repeat;
  background-size: contain;
  height: 4px;
}
.custom-dropdown .sub-menu li a {
  padding-left: 20px; /* Thụt vào trái 20px cho văn bản */
}
.custom-dropdown-root {
  display: flex; /* dàn hàng ngang */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Style chung */
.custom-dropdown-root,
.custom-dropdown-root li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.custom-dropdown-root li a {
  display: block;
  padding: 8px 0px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  text-transform: none;
}

.custom-dropdown-root li a:hover {
  background-color: #f0f0f0;
}

@media (min-width: 600px) {
  .mobile-menu-new-dropdown-menu {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding-right: 35px;
    padding-left: 15px;
    color: #000000;
    text-transform: uppercase;
  }
}
@media (max-width: 600px) {
  .mobile-menu-new-dropdown-menu {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding-right: 15px;
    color: #000000;
    text-transform: uppercase;
  }
}

@media (min-width: 600px) {
  .mobile-menu-new-dropdown-list {
    min-height: 700px;
    max-height: 90vh; /* Chiều cao tối đa gần sát màn hình */
  }
}
@media (max-width: 600px) {
  .mobile-menu-new-dropdown-list {
    max-height: 600px; /* Chiều cao tối đa gần sát màn hình */
  }
}
.mobile-menu-new-dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: -120%;
  width: 270px;
  overflow-y: auto; /* Bật cuộn dọc nếu quá dài */
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  padding: 10px 0;
  scrollbar-width: thin; /* Firefox */
  -webkit-overflow-scrolling: touch;
}

/* Cho Chrome - hiển thị thanh cuộn mảnh */
.mobile-menu-new-dropdown-list::-webkit-scrollbar {
  width: 6px;
}
.mobile-menu-new-dropdown-list::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}
.mobile-menu-new-dropdown-menu:hover .mobile-menu-new-dropdown-list {
  /*display: block;*/
}

.mobile-menu-new-dropdown-list li {
  list-style: none;
  padding: 10px 15px;
}

.mobile-menu-new-dropdown-list li a {
  text-decoration: none !important;
  width: 220px;
  line-height: 1 !important;
  color: #333;
  display: flex;
  text-transform: none !important; /* Giữ nguyên chữ thường */
}

.mobile-menu-new-dropdown-list li a:hover {
  background-color: #f0f0f0;
}

/* Phần a chứa icon + text */
.mobile-menu-new-dropdown-list li.menu-item-has-children > a {
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 25px; /* chừa khoảng cho mũi tên */
}

/* Mũi tên lệch sang phải */
.mobile-menu-new-dropdown-list li.menu-item-has-children > a::after {
  content: "▼";
  font-size: 12px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.mobile-menu-new-dropdown-list .sub-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out; /* Thời gian và hiệu ứng chuyển */
  /*padding-left: 20px;*/
}

.mobile-menu-new-dropdown-list li.menu-item-has-children:hover > .sub-menu {
  max-height: 500px; /* Chiều cao đủ lớn để chứa các mục con */
}

/* CSS cho dropdown của avatar và giỏ hàng */
.mobile-menu-new-avatar-block,
.mobile-menu-new-cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  padding-left: 20px;
}

@media (min-width: 730px) {
  .mobile-menu-new-avatar-block,
  .mobile-menu-new-cart-icon {
    padding-left: 40px !important;
  }
}
.mobile-menu-new-uploads-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 200px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
}

.mobile-menu-new-cart-icon:hover .mobile-menu-new-uploads-dropdown,
.mobile-menu-new-avatar-block:hover .mobile-menu-new-uploads-dropdown {
  /*display: block;*/
}

.mobile-menu-new-uploads-dropdown a {
  line-height: 1;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s;
      width: 150px;
}

.mobile-menu-new-uploads-dropdown a:hover {
  background-color: #f0f0f0;
}

/* Giỏ hàng luôn hiển thị */
.mobile-menu-new-cart-icon a {
  display: flex;
  align-items: center;
  color: #333;
  text-decoration: none;
}

.mobile-menu-new-cart-count {
  position: absolute;
  top: -15px;
  right: -18px;
  background-color: #4a7d91;
  color: white;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 14px;
}

/* Avatar mặc định: 30px cho màn hình trên 600px */
.mobile-menu-new-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ccc;
  transition: transform 0.3s;
}

/* Avatar cho thiết bị nhỏ hơn 600px: 20px */
@media screen and (max-width: 600px) {
  .mobile-menu-new-user-avatar {
    width: 20px;
    height: 20px;
  }
}

.mobile-menu-new-avatar-block:hover .mobile-menu-new-user-avatar {
  transform: scale(1.1);
}

.mobile-menu-new-avatar-dropdown-toggle {
  font-size: 16px;
  color: #333;
}

/* CSS cho các danh mục con */
.mobile-menu-new-uploads-dropdown ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mobile-menu-new-uploads-dropdown li {
  position: relative;
}

.mobile-menu-new-uploads-dropdown li a {
  padding-left: 20px; /* Thụt vào cho danh mục con */
}

.mobile-menu-new-uploads-dropdown li.menu-item-has-children > a::after {
  content: "▼";
  font-size: 12px;
  margin-left: 10px;
}

.mobile-menu-new-uploads-dropdown .sub-menu {
  display: none;
  padding-left: 20px; /* Thụt thêm cho các cấp con */
}

.mobile-menu-new-uploads-dropdown .sub-menu a {
  text-decoration: none !important;
}
.mobile-menu-new-uploads-dropdown li.menu-item-has-children:hover > .sub-menu {
  display: block;
}

/* ✅ Nút trong menu head */
.categories-button.menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #000;
  font-size: 14px;
  text-transform: uppercase;
  background: transparent;
  border: none;
  margin-right: 20px;
}

@media (min-width: 700px) {
  .categories-button.menu-btn {
    margin-right: 40px;
  }
}
/* Hover menu head */
.categories-button.menu-btn:hover {
  /*color: #007c9d;*/
}

/* ✅ Nút trong upload */
.categories-button.upload-btn {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.categories-button.upload-btn:hover {
  background-color: #eee;
}
/* ✅ Dành cho upload – popup trung tâm */
/* ✅ Popup upload – trung tâm, mượt hơn, responsive */
.categories-dropdown.upload-style {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 90vw;
  height: 750px;
  background: #fff;
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
  font-family: Helvetica, Arial, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  box-shadow: 0 2px 64px rgba(0, 0, 0, 0.2);
  border: 1px solid rgb(210 210 210);
  border-radius: 20px;
  z-index: 1000;
}
.category-selector.show-popup .categories-dropdown.upload-style {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 699px) {
  .categories-dropdown.menu-style {
    left: 0;
    top: 100%;
    width: 100% !important;
  }
}

/* ✅ Dành cho menu head – dropdown */
.categories-dropdown.menu-style {
  position: absolute;
  width: 420px;
  max-height: 750px;
  background: #fff;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
  font-family: Helvetica, Arial, sans-serif;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* ✅ Khi hiển thị (hover) */
.category-selector.show-popup .categories-dropdown.menu-style {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.category-selector.show-popup .categories-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.categories-search {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 0;
}
@media (max-width: 699px) {
  .categories-search {
    width: 92%;
  }
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.category-search-input {
  width: 100%;
  padding: 8px 32px 8px 10px; /* chừa chỗ cho ✖ */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  box-sizing: border-box;
}

.category-clear-icon {
  position: absolute;
  right: 8px;
  top: 55%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #999;
  cursor: pointer;
  display: none;
  z-index: 1;
}

.category-clear-icon:hover {
  color: #000;
}

.category-search-icon {
  background: #4a7d91;
  color: white;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  height: 100%;
}
input.category-search-input {
  margin: 0;
  border-radius: 10px 0 0 10px;
  padding: 8px;
}

/* 2 cột */
.categories-columns {
  display: flex;
  height: calc(100% - 60px);
}

/* Cột trái */
.categories-list {
  width: 40%;
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  overflow-y: auto;
  color: black;
}

.categories-list li {
  padding: 5px !important;
  cursor: pointer;
  font-size: 14px;
  /*border-bottom: 1px solid #eee;*/
}

.categories-list li.active {
  background: #f0f0f0;
  font-weight: bold;
}

/* Cột phải */
.subcategories-panel {
  width: 60%;
  padding: 0px 10px;
  overflow-y: auto;
  border-left: 1px solid #eee;
}

.subcategory-group {
  margin-bottom: 20px;
}

.subcategory-group h4 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  padding: 0;
}

.subcategory-group ul {
  list-style: none;
  padding: 0;
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  /* gap: 10px 16px; */
  flex-direction: column;
}

.subcategory-group ul li {
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  padding: 5px;
}

.subcategory-group ul li:hover {
  background: #f5f5f5;
}

.uploads-dropdown img {
  filter: grayscale(100%);
  opacity: 0.8;
  transition:
    filter 0.2s ease,
    opacity 0.2s ease;
}
.uploads-dropdown a:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

.mobile-dropdown-logo {
  display: none;
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-dropdown-logo img {
  max-width: 140px;
  height: auto;
}

.mobile-dropdown-close {
  display: none;
  position: absolute;
  top: 22px;
  right: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  z-index: 999;
}

@media (max-width: 699px) {
  .mobile-dropdown-logo {
    display: block;
  }
  .mobile-dropdown-close {
    display: block;
  }
}
