/**
 * Shop route slugs — single source of truth for pet categories and top categories.
 * Use these for links, 404 validation, and nav strips.
 */

export const PET_CATEGORY_SLUGS = [
  "dogs",
  "cats",
  "birds",
  "small-pets",
] as const;

export const TOP_CATEGORY_SLUGS = [
  "food",
  "treats",
  "toys",
  "bowl",
  "carrier",
  "litter",
] as const;

export type PetCategorySlug = (typeof PET_CATEGORY_SLUGS)[number];
export type TopCategorySlug = (typeof TOP_CATEGORY_SLUGS)[number];

export function isPetCategorySlug(slug: string): slug is PetCategorySlug {
  return (PET_CATEGORY_SLUGS as readonly string[]).includes(slug);
}

export function isTopCategorySlug(slug: string): slug is TopCategorySlug {
  return (TOP_CATEGORY_SLUGS as readonly string[]).includes(slug);
}

export type ShopSegmentType = "pet" | "top" | null;

export function getShopSegmentType(slug: string): ShopSegmentType {
  if (isPetCategorySlug(slug)) return "pet";
  if (isTopCategorySlug(slug)) return "top";
  return null;
}
