.wcfmsc-multilevel-container {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  font-size: 14px;
}

#wcfm_membership_registration_form .wcfmsc-multilevel-container {
  left: -5px;
  margin-bottom: 15px;
}

.wcfmsc-multilevel-selected {
  border: 1px solid #ddd;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 2px;
  min-height: 35px;
  box-sizing: border-box;
  color: #555;
  min-width: 150px;
}

.wcfmsc-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.wcfmsc-selected-item {
  background: #f1f1f1;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.wcfmsc-multilevel-dropdown,
.wcfmsc-dropdown-submenu {
  display: none;
  min-width: 200px;
  background: #fff;
  border: 1px solid #ddd;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.wcfmsc-multilevel-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 9999;
}

#wcfm_profile_form_store_categories_expander .wcfmsc-multilevel-dropdown {
  width: max-content;
}

.wcfmsc-multilevel-dropdown li {
  position: relative;
  border-bottom: 1px solid #f5f5f5;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.wcfmsc-multilevel-dropdown li:last-child {
  border-bottom: none;
}

.wcfmsc-cat-link {
  display: flex !important;
  align-items: center;
  padding: 8px 15px;
  text-decoration: none !important;
  color: #555 !important;
  transition: all 0.2s;
  line-height: 1.4;
  white-space: nowrap;
  flex-grow: 1;
}

.wcfmsc-cat-link:hover,
.wcfmsc-cat-link.active {
  background: #f0f0f0;
  color: #111 !important;
}

.wcfmsc-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-right: 10px;
  display: inline-block;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

.wcfmsc-cat-link.active .wcfmsc-checkbox {
  background: #007cba;
  border-color: #007cba;
}

.wcfmsc-cat-link.active .wcfmsc-checkbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.wcfmsc-item-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wcfmsc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #888;
  position: relative;
  z-index: 10;
}

.wcfmsc-toggle:hover {
  background: #f5f5f5;
  color: #333;
}

.wcfmsc-dropdown-submenu {
  position: absolute;
  left: 100%;
  top: -1px;
  z-index: 10000;
}

@media (min-width: 769px) {
  .wcfmsc-multilevel-dropdown li:hover>.wcfmsc-dropdown-submenu {
    display: block;
  }
}

@media (max-width: 768px) {
  .wcfmsc-multilevel-dropdown {
    max-width: 90vw;
  }

  .wcfmsc-dropdown-submenu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid #eee;
    margin-left: 10px !important;
  }

  .wcfmsc-item-wrap {
    border-bottom: 1px solid #f9f9f9;
  }

  .wcfmsc-multilevel-dropdown li:hover>.wcfmsc-dropdown-submenu {
    display: none;
  }

  .wcfmsc-dropdown-submenu.open {
    display: block !important;
  }

  .wcfmsc-toggle {
    display: flex !important;
    background: #fdfdfd;
    border-left: 1px solid #eee;
    height: 100%;
    min-height: 40px;
  }

  .wcfmsc-has-children>.wcfmsc-cat-link {
    padding-right: 15px;
  }
}

@media screen and (max-width: 640px) {
  .wcfmsc-multilevel-container {
    width: 95% !important;
    margin-right: 0 !important;
    margin-bottom: 10px;
    text-align: left;
  }

  #wcfm_membership_registration_form .wcfmsc-multilevel-container {
    left: 0;
    width: 100% !important;
  }

  #wcfm_profile_form_store_categories_expander .wcfmsc-multilevel-dropdown {
    width: 100% !important;
    max-height: 150px;
    overflow-y: auto;
  }
}

.wcfmsc-widget-checkboxes ul.wcfmsc_store_categories_list,
.wcfmsc-widget-checkboxes ul.wcfmsc_store_categories_list ul {
  list-style: none;
  margin: 0;
}

.wcfmsc-widget-checkboxes ul.wcfmsc_store_categories_list {
  padding-left: 0;
}

.wcfmsc-widget-checkboxes ul.wcfmsc_store_categories_list ul {
  padding-left: 20px;
}

.wcfmsc-widget-checkboxes ul.wcfmsc_store_categories_list li {
  margin-bottom: 5px;
}

.wcfmsc-hidden-field-wrap {
  display: none !important;
}