
/* Menu xổ xuống chỉ dùng trên trang trong */
.inner-category-menu {  display:none;}
.nav:has(.inner-category-menu) {
  position:relative;
}

.nav .inner-category-menu {
  display:none;
  position:absolute;
  top:100%;
  left:0;
  z-index:50;
  width:270px;
  max-width:100%;
  color:var(--ink);
  text-align:left;
  box-shadow:0 12px 30px #35201426;
  max-height:70vh;
  overflow-y:auto;
}

.nav .inner-category-menu.open {
  display:block;
}


@media(max-width:640px) {
  .nav .inner-category-menu {
    width:100%;
  }
}


/* Danh sách menu */
.category-tree,
.category-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tree {
  color: #3d291b;
  background: #fffdf8;
  font-size: 16px;
  line-height: 1.5;
}

/* Menu cấp 1 */
.category-tree > li > a,
.category-tree > li > details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: inherit;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.category-tree > li + li {
  border-top: 1px solid #eee8dd;
}

.category-tree > li > a img,
.category-tree > li > details > summary img {
  display: block;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  margin: 0;
  object-fit: contain;
}

/* Bỏ mũi tên mặc định của summary */
.category-tree summary {
  list-style: none;
}

.category-tree summary::-webkit-details-marker {
  display: none;
}

/* Mũi tên riêng cho mục có menu con */
.category-tree > li > details > summary::after {
  content: "›";
  margin-left: auto;
  color: #228b22;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}

.category-tree > li > details[open] > summary::after {
  transform: rotate(90deg);
}

/* Menu cha đang mở */
.category-tree > li > details[open] > summary {
  background: #edf5e9;
  color: #215a25;
}

/* Khung menu cấp 2 */
.category-tree > li > details > ul {
  margin: 0 1px 1px 1px;
  padding: 4px 0;
  border-left: 2px solid #cbdcc2;
  background: #f7f8f3;
}

/* Liên kết cấp 2 */
.category-tree > li > details > ul > li > a {
  display: block;
  padding: 10px 12px 10px 18px;
  color: #655344;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* Hover và mục đang chọn */
.category-tree a:hover {
  background: #fff0bf;
  color: #215a25;
}

.category-tree a[aria-current="page"] {
  background: #e7f1e1;
  color: #215a25;
  font-weight: 700;
}

.category-tree a:focus-visible,
.category-tree summary:focus-visible {
  outline: 2px solid #228b22;
  outline-offset: -3px;
}
