/* ==========================================================================
   Category Directory / All Categories Page Styles
   ========================================================================== */

.category-page-wrap {
  background-color: #f8f9fa;
  min-height: 85vh;
  padding: 15px 15px 15px 15px !important;
}

@media (min-width: 768px) {
  .category-page-wrap {
    padding: 40px 25px 40px 25px !important;
  }
}

/* ==========================================================================
   TOP SECTION: Parent Categories Row / Grid (Screenshot 2)
   ========================================================================== */
.parent-categories-showcase {
  margin-bottom: 2.5rem;
}

.parent-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.parent-category-top-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.parent-category-top-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: rgba(219, 46, 109, 0.35);
}

.parent-category-circle-img {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  object-fit: cover;
  background-color: #f3f4f6;
  border: 2px solid #f3f4f6;
  margin-bottom: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.parent-category-top-card:hover .parent-category-circle-img {
  transform: scale(1.06);
  border-color: var(--primary, #db2e6d);
}

.parent-category-top-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem;
  line-height: 1.25;
  transition: color 0.2s ease;
}

.parent-category-top-card:hover .parent-category-top-name {
  color: var(--primary, #db2e6d);
}

.parent-category-top-count {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

/* ==========================================================================
   BOTTOM SECTION: Parent & Child Categories Cards (Screenshot 3)
   ========================================================================== */
.parent-child-directory-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

/* Header */
.parent-child-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.parent-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.parent-header-thumb {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.parent-header-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.25rem;
}

.parent-header-title-wrap h3 a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s ease;
}

.parent-header-title-wrap h3 a:hover {
  color: var(--primary, #db2e6d);
}

.parent-badge-count {
  display: inline-block;
  background-color: rgba(219, 46, 109, 0.08);
  color: var(--primary, #db2e6d);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.btn-view-all-category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary, #db2e6d);
  text-decoration: none !important;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background-color: rgba(219, 46, 109, 0.06);
  transition: all 0.2s ease;
}

.btn-view-all-category:hover {
  background-color: var(--primary, #db2e6d);
  color: #ffffff;
}

/* 4-Columns Subcategories Grid */
.child-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.child-category-box {
  background-color: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 0.625rem;
  padding: 1.125rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.child-category-box:hover {
  background-color: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.child-box-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.65rem;
}

.child-box-title a {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.15s ease;
}

.child-box-title a:hover {
  color: var(--primary, #db2e6d);
}

/* Nested Children (2nd Level) */
.nested-children-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nested-child-item {
  margin-bottom: 0.4rem;
}

.nested-child-item:last-child {
  margin-bottom: 0;
}

.nested-child-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.nested-child-link::before {
  content: "•";
  color: #9ca3af;
  font-size: 0.75rem;
}

.nested-child-link:hover {
  color: var(--primary, #db2e6d);
  transform: translateX(2px);
}

.btn-show-more-nested {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary, #db2e6d);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  outline: none;
}

.btn-show-more-nested:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1023.98px) {
  .child-categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .parent-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .category-main-title {
    font-size: 1.25rem;
  }

  .parent-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .parent-category-top-card {
    padding: 0.875rem 0.5rem;
  }

  .parent-category-circle-img {
    width: 3.25rem;
    height: 3.25rem;
  }

  .parent-category-top-name {
    font-size: 0.75rem;
  }

  .parent-child-directory-card {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .child-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .child-category-box {
    padding: 0.75rem;
  }

  .child-box-title {
    font-size: 0.8125rem;
    margin-bottom: 0.4rem;
  }
}

@media (max-width: 480px) {
  .child-categories-grid {
    grid-template-columns: 1fr;
  }
}
