@layer tokens, components;

@layer tokens {
  :root {
    --content-max: 980px;
    --bg: #FFF8E7;
    --fg: #0f172a;
    --muted: #475569;
    --card: #ffffff;
    --border: #6B7280;
    --accent: #007BFF;
    --brand: #4f46e5;
    --category-name: #3232C0;
    --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  }
}

@layer components {
  body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial;
    overflow-y: scroll;
  }

  .wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    background: var(--bg);
    box-sizing: border-box;
  }

  .site-header a { text-decoration: none; }

  .site-header {
    background: var(--bg);
    margin-bottom: 8px;
  }
  footer { background: var(--bg); }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 14px 0 22px;
  }

.searchbar { width: 100%; max-width: 720px; }
.searchbar input[type="search"] {
  width: 100%;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  font-size: 18px;
  outline: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.searchbar input[type="search"]:focus {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(14, 165, 233, 0.3);
  border-color: var(--accent);
}

  .chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
  }
  .chip {
    background: #f3f4f6;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  }

.chip.active {
  background: #E3E8EF;
  color: #000000;
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.chip.active:hover {
  background: #D6E6FE;
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

  .crumbs .sep { color: #64748b; }
  .grid-parents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
  }

  .parent-card, .category-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    cursor: pointer;
    color: var(--fg);
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  }

  .parent-card:hover, .category-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
  }

  .parent-card .title { font-weight: 600; }
  .category-card .title { 
    font-weight: 600;
    color: var(--category-name);
  }

  .parent-card p { /* Tagline */
    font-style: italic;
    font-size: 14px;
    margin: 6px 0 0;
    color: var(--muted);
  }

  .parent-card .business-city { /* City name */
    font-style: normal;
    font-size: 12px;
    margin: 4px 0 0;
    color: #8E8338;
  }

.mode-chips { display: flex; gap: 8px; margin-bottom: 16px; }
.mode-chip {
  text-decoration: none;
  color: #000000;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f3f4f6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.mode-chip.active {
  background: #E3E8EF;
  color: #000000;
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}
.mode-chip.active:hover {
  background: #D6E6FE;
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

  .az-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--fg);
    font-size: 14px;
    background: #f3f4f6;
    display: inline-block;
    margin: 8px 4px;
  }
  .az-btn:hover {
    background: #D6E6FE;
    border-color: var(--accent);
  }
  .az-err {
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    margin: 16px 0;
  }
  .pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
  }
  .badge-star {
    position: absolute;
    top: 2px;
    right: 2px;
    line-height: 1;
  }
  .enhanced {
    border: 2px solid #28A745;
  }
}