/* products.css - the Products page: categories + product grid (also used by Search) */

.prods { padding: 6px 9px 0; }
.prods__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 3px 10px; }
.prods__title { margin: 0; font-size: 20px; font-weight: 700; color: #111; overflow-wrap: anywhere; }
.prods__count { margin: 0; flex: none; font-size: 13px; color: var(--grey); }

/* category picker: a row you swipe sideways on a phone */
.cats {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -9px 8px; padding: 4px 12px 10px;
  scroll-snap-type: x proximity; scroll-padding-inline: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cats::-webkit-scrollbar { display: none; }

.cat {
  flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px;
  border: 1.5px solid #f0e9dc; border-radius: 999px; background: #fff;
  color: #333; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; scroll-snap-align: start;
}
.cat svg { width: 22px; height: 22px; flex: none; color: var(--orange); }
.cat__name { overflow: hidden; text-overflow: ellipsis; }
.cat__n { font-size: 12px; font-weight: 400; color: var(--grey); }
.cat.is-on { background: var(--orange); border-color: var(--orange); color: #fff; }
.cat.is-on svg, .cat.is-on .cat__n { color: #fff; }
.cat:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.prods__empty { grid-column: 1 / -1; padding: 36px 12px; text-align: center; color: var(--grey); font-size: 15px; line-height: 1.6; }
.prods__empty a { display: inline-block; margin-top: 12px; padding: 11px 22px; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 600; text-decoration: none; }

/* skeleton cards while the list loads */
.card--skeleton { min-height: 220px; background: linear-gradient(90deg, #fff 0%, #f6f0e6 50%, #fff 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

html[data-theme="dark"] .cat { background: #262422; border-color: #3a3836; color: #f5f5f5; }
html[data-theme="dark"] .cat.is-on { background: var(--orange); border-color: var(--orange); color: #fff; }
html[data-theme="dark"] .prods__title { color: #f5f5f5; }
html[data-theme="dark"] .card--skeleton { background: linear-gradient(90deg, #262422 0%, #2e2a26 50%, #262422 100%); background-size: 200% 100%; }

@media (prefers-reduced-motion: reduce) { .card--skeleton { animation: none; } }

/* desktop: categories become a list on the left */
@media (min-width: 900px) {
  .prods { padding: 0; }
  .prods__head { margin: 0 0 18px; }
  .prods__title { font-size: 28px; }
  .prods__layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
  .cats {
    flex-direction: column; gap: 4px; overflow: visible; margin: 0; padding: 0;
    position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto;
    scroll-snap-type: none; scrollbar-width: thin;
  }
  .cat { height: 46px; width: 100%; border-radius: 12px; border-color: transparent; background: transparent; padding: 0 12px; white-space: normal; }
  .cat__n { margin-left: auto; }
  .cat:hover { background: #fff; border-color: #f0e9dc; }
  .cat.is-on:hover { background: var(--orange); border-color: var(--orange); }
  html[data-theme="dark"] .cat { background: transparent; border-color: transparent; }
  html[data-theme="dark"] .cat:hover { background: #262422; border-color: #3a3836; }
  html[data-theme="dark"] .cat.is-on, html[data-theme="dark"] .cat.is-on:hover { background: var(--orange); border-color: var(--orange); }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .prods__results .products__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .prods__results .products__grid { grid-template-columns: repeat(4, 1fr); }
}
