.custom-category-list-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background-color: #fcfbf8;
}

.category-item {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease-in-out;
}

.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.category-item.has-accordion .category-header {
  cursor: pointer;
}

.category-title-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
  text-align: left;
}

.category-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.category-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.accordion-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  padding-left: 15px;
  user-select: none;
  transition: transform 0.4s ease;
}

.category-item.active .accordion-toggle {
  transform: rotate(45deg);
}

.category-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
  width: 100%;
}

.category-item.active .category-collapsible-content {
  max-height: 600px;
  margin-top: 15px;
  transition: max-height 0.5s ease-in, margin-top 0.5s ease-in;
}

.category-description {
  font-size: 14px;
  color: #777;
  line-height: 1.4;
  text-align: left;
  border-top: 1px solid #eee;
  padding-top: 15px;
  margin-bottom: 15px;
  max-height: 300px; 
  overflow-y: auto;
  padding-right: 15px;
  scrollbar-width: thin;
  scrollbar-color: #aaa #f1f1f1;
}

.category-description::-webkit-scrollbar {
  width: 8px;
}
.category-description::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.category-description::-webkit-scrollbar-thumb {
  background-color: #aaa;
  border-radius: 10px;
  border: 2px solid #f1f1f1;
}
.category-description::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

.subcategory-list {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  max-height: 200px; 
  overflow-y: auto;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: #aaa #f1f1f1;
}


.subcategory-list::-webkit-scrollbar {
  width: 8px;
}
.subcategory-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.subcategory-list::-webkit-scrollbar-thumb {
  background-color: #aaa;
  border-radius: 10px;
  border: 2px solid #f1f1f1;
}
.subcategory-list::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}


.subcategory-item {
  background-color: #f7f7f7;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.subcategory-item:hover {
  background-color: #e9e9e9;
}

@media (max-width: 992px) {
  .custom-category-list-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .custom-category-list-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .category-icon {
    width: 32px;
    height: 32px;
  }
}

.popular-categories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.popular-category-item {
  display: inline-flex;
  align-items: center;
  background-color: #f8f8f8;
  color: #333333;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  border: 1px solid #eeeeee;
}
.popular-category-item:hover {
  background-color: #b8c8b8;
  color: #ffffff !important;
  border-color: #a8b8a8;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(184, 200, 184, 0.3);
}
.popular-category-title {
  margin-right: 10px;
}
.popular-category-count {
  background-color: #b8c8b8;
  color: #ffffff;
  border-radius: 12px;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}
.popular-category-item:hover .popular-category-count {
  background-color: #ffffff;
  color: #b8c8b8;
  transform: scale(1.1);
}

/* Sub Category List Styles */
.ric-sub-category-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.ric-sub-category-item {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
}

.ric-sub-category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.ric-sub-category-item a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  text-decoration: none;
  color: #333;
  height: 100%;
  box-sizing: border-box;
}

.ric-subcategory-icon {
  width: 48px;
  height: 48px;
  margin-right: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.ric-subcategory-title {
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

@media (max-width: 768px) {
  .ric-sub-category-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .ric-subcategory-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
  }
}
