
/* -------------------- Container -------------------- */
.index-submenu-container {
  background: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

/* -------------------- Main Menu -------------------- */
.index-submenu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.index-submenu > li {
  position: relative;
}

.index-submenu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: 0.3s;
}

.index-submenu a:hover {
  background: #f4a261;
  color: #fff;
}

/* -------------------- Dropdown -------------------- */
.index-submenu-dropdown,
.index-sub-submenu-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  list-style: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  display: none;
  min-width: 220px;
  z-index: 10;
  padding: 8px 0;
}

.index-submenu-dropdown li,
.index-sub-submenu-dropdown li {
  position: relative;
}

.index-submenu-dropdown a,
.index-sub-submenu-dropdown a {
  display: block;
  padding: 10px 15px;
  color: #333;
}

.index-submenu-dropdown a:hover,
.index-sub-submenu-dropdown a:hover {
  background: #f4a261;
  color: #fff;
}

/* Dropdown ซ้อนขวา */
.index-sub-submenu-dropdown {
  top: 0;
  left: 100%;
}

/* Hover แสดง dropdown บน PC */
@media (min-width: 769px) {
  .index-submenu li:hover > .index-submenu-dropdown {
    display: block;
  }
  .index-submenu-dropdown li:hover > .index-sub-submenu-dropdown {
    display: block;
  }
}

/* -------------------- ลูกศร -------------------- */
.arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.right {
  transform: rotate(0deg);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 768px) {
  .index-submenu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .index-submenu a {
    justify-content: space-between;
    background: #f7f7f7;
    padding: 12px;
    border-radius: 8px;
  }

  .index-submenu-dropdown,
  .index-sub-submenu-dropdown {
    position: static;
    box-shadow: none;
    border-radius: 6px;
    width: 100%;
    padding-left: 15px;
    margin-top: 4px;
  }

  /* แสดง dropdown เมื่อ active */
  .index-submenu li.active > .index-submenu-dropdown {
    display: block;
  }
  .index-submenu-dropdown li.show-sub > .index-sub-submenu-dropdown {
    display: block;
  }

  /* ลูกศรหมุน */
  .index-submenu li.active > a .arrow {
    transform: rotate(180deg);
  }
  .index-submenu-dropdown li.show-sub > a .right {
    transform: rotate(90deg);
  }
}
