/* One centered vector-icon system for category navigation and category cards. */
#category-tabs.category-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  overflow: visible;
  padding-block: 0.75rem;
}

.category-tab {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 4.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  white-space: normal;
}

.category-icon-disc {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  place-items: center;
  border-radius: 1rem;
  background: var(--espresso-soft);
  background: color-mix(in srgb, var(--olive) 12%, var(--card));
  color: var(--olive);
}

.category-icon { width: 1.85rem; height: 1.85rem; fill: none; stroke: currentColor; }
.category-icon.category-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.category-tab-name { flex: 1 1 auto; min-width: 0; text-align: center; white-space: normal; line-height: 1.5; }
.category-tab.active { border-color: var(--olive); background: var(--olive); color: var(--espresso-on-accent); }
.category-tab.active .category-icon-disc {
  background: var(--espresso-raised);
  background: color-mix(in srgb, var(--espresso-on-accent) 12%, var(--olive));
  color: inherit;
}

.category-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.category-choice {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--card);
  text-align: center;
}
.category-choice .category-icon-disc { width: 3.2rem; height: 3.2rem; flex-basis: 3.2rem; }
.category-choice .category-icon { width: 2rem; height: 2rem; }
.category-choice-name { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.category-choice-name b { font-weight: 650; }
.category-choice-name small { color: var(--muted); font-size: 0.68rem; }
.category-choice.active { border-color: var(--olive); background: var(--olive); color: var(--espresso-on-accent); }
.category-choice.active .category-icon-disc {
  background: var(--espresso-raised);
  background: color-mix(in srgb, var(--espresso-on-accent) 12%, var(--olive));
  color: inherit;
}
.category-choice.active .category-choice-name small { color: inherit; }
.category-choice:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 0.4rem); }

.category-tab:active, .category-choice:active, .mobile-category-tile:active { transform: scale(0.97); }

@media (max-width: 767px), (max-width: 950px) and (max-height: 500px) {
  body { background: var(--paper); }

  .site-header, .menu-navigation {
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
  }

  .mobile-tabbar {
    background: var(--card);
    background: color-mix(in srgb, var(--card) 93%, transparent);
    border-color: var(--line);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
  }

  .all-categories { display: none !important; }

  #category-tabs.category-tabs {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-block: 0.55rem;
    scroll-snap-type: x proximity;
  }

  .category-tab {
    width: 7.5rem;
    min-width: 7.5rem;
    min-height: 5.1rem;
    flex: 0 0 7.5rem;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.45rem 0.35rem;
    border-radius: 1.1rem;
    scroll-snap-align: center;
  }

  .category-tab .category-icon-disc { width: 2.8rem; height: 2.8rem; flex-basis: 2.8rem; border-radius: 0.9rem; }
  .category-tab .category-icon { width: 1.75rem; height: 1.75rem; }
  .category-tab-name { flex: 0 1 auto; font-size: 0.78rem; line-height: 1.35; }

  .mobile-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
  .mobile-category-tile {
    display: flex;
    min-height: 10.25rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    background: var(--mobile-surface);
    box-shadow: 0 5px 18px rgb(63 35 19 / 6%);
    text-align: center;
  }

  .mobile-category-tile > .category-icon-disc { width: 4.4rem; height: 4.4rem; flex: 0 0 4.4rem; border-radius: 1.4rem; }
  .mobile-category-tile .category-icon { width: 2.8rem; height: 2.8rem; }
  .mobile-category-tile > .mobile-category-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0;
    text-align: center;
  }
  .mobile-category-copy b { font-size: 0.98rem; font-weight: 700; line-height: 1.55; }
  .mobile-category-copy small { color: var(--muted); font-size: 0.77rem; }

  .mobile-category-tile.selected {
    border-color: var(--olive);
    background: var(--mobile-surface);
    background: color-mix(in srgb, var(--olive) 8%, var(--mobile-surface));
  }
  .mobile-category-tile.selected::after {
    inset-inline-start: 0.65rem;
    inset-inline-end: auto;
    inset-block-start: 0.65rem;
    transform: none;
    box-shadow: none;
  }
  .mobile-category-tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.45rem);
  }
}

@media (max-width: 350px) {
  .mobile-category-grid { gap: 0.65rem; }
  .mobile-category-tile { min-height: 9.5rem; }
  .mobile-category-tile > .category-icon-disc { width: 4rem; height: 4rem; flex-basis: 4rem; }
  .mobile-category-tile .category-icon { width: 2.55rem; height: 2.55rem; }
}

@media (prefers-reduced-transparency: reduce) and (max-width: 767px),
  (prefers-reduced-transparency: reduce) and (max-width: 950px) and (max-height: 500px) {
  .site-header, .menu-navigation { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mobile-tabbar { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (hover: hover) and (pointer: fine) {
  .category-tab:not(.active):hover, .category-choice:not(.active):hover, .mobile-category-tile:hover { border-color: var(--olive); }
}

@media (prefers-reduced-motion: reduce) {
  .category-tab, .category-choice, .mobile-category-tile { transition: none !important; }
}
