/* Categories Page */
.categories-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 32px;
  color: var(--text-color);
  margin-bottom: 10px;
}

.page-header p {
  font-size: 18px;
  color: #6b7280;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.category-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.category-link {
  display: block;
  padding: 32px 24px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.category-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.category-icon svg {
  width: 100%;
  height: 100%;
}

.category-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
}

.category-count {
  font-size: 14px;
  color: #6b7280;
}

/* Category Show Page */
.category-show {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.category-description {
  font-size: 16px;
  color: #6b7280;
  max-width: 600px;
  margin: 16px auto 0;
}

.no-ads {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.no-ads p {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 24px;
}

/* Subcategories Section */
.subcategories-section {
  margin-bottom: 48px;
}

.subcategories-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 24px;
}

.subcategories-section .categories-grid {
  margin-bottom: 0;
}

/* Ads Section in Category Page */
.category-show .ads-section {
  margin-top: 48px;
}

.category-show .ads-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .category-link {
    padding: 20px 16px;
  }
  
  .category-icon {
    width: 48px;
    height: 48px;
    padding: 12px;
  }
  
  .category-name {
    font-size: 16px;
  }
}

/* Categories index — client-side search box */
.categories-search {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 14px;
  margin: 0 0 24px;
  gap: 10px;
}

.categories-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.categories-search-icon {
  width: 18px;
  height: 18px;
  color: #6b7280;
  flex-shrink: 0;
}

.categories-search-input {
  border: 0;
  outline: 0;
  flex: 1;
  font-size: 15px;
  color: #111827;
  background: transparent;
}

.categories-search-clear {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
  padding: 0 4px;
}

.categories-search-clear:hover { color: #374151; }

.category-parent {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

.categories-empty {
  text-align: center;
  padding: 32px 0;
  color: #6b7280;
}

