/* ======================================================================
   ZANTI PHARMACY — PRODUCTS PAGE STYLES (assets/css/pages/products.css)
   ----------------------------------------------------------------------
   Page-specific additions only — every core component (cards, chips,
   badges, buttons, skeletons, empty states) comes from the shared
   design system in assets/css/style.css.
   ====================================================================== */

/* --- Hero catalogue search ------------------------------------------- */

.catalogue-search {
  position: relative;
  margin-top: var(--sp-6);
  max-width: 560px;
}

.catalogue-search > .icon {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--brand);
  pointer-events: none;
}

.catalogue-search-input {
  width: 100%;
  padding: 17px 24px 17px 54px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 1.0625rem;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--speed-fast) ease, box-shadow var(--speed-fast) ease;
}

.catalogue-search-input::placeholder { color: var(--slate-soft); }

.catalogue-search-input:focus-visible {
  outline: none;
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.35), var(--shadow-lg);
}

.catalogue-count {
  margin-top: var(--sp-4);
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* --- Toolbar: category chips + Rx toggle + sort ----------------------- */

.catalogue-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.catalogue-toolbar .filter-bar { margin-bottom: 0; }

.catalogue-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.chip-rx .icon {
  width: 15px;
  height: 15px;
}

.catalogue-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
}

.catalogue-sort-label {
  font-family: var(--font-head);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--slate);
  white-space: nowrap;
}

.catalogue-sort .select {
  width: auto;
  min-width: 180px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: var(--fs-sm);
}

/* Category chips become a horizontal scroller on small screens. */
@media (max-width: 767px) {
  .catalogue-category-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--sp-2);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .catalogue-category-bar .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* --- Product tag pills ------------------------------------------------ */

.product-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-3);
}

.product-tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--canvas);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--slate-soft);
}

/* --- Grid update transition ------------------------------------------- */
/* Subtle exit fade while results are re-filtered; entries animate back
   in through the shared data-reveal engine (ZantiUI.refresh). */

[data-products-grid] {
  transition: opacity var(--speed-fast) ease, transform var(--speed-fast) var(--ease-out);
}

[data-products-grid].is-updating {
  opacity: 0.25;
  transform: translateY(6px);
}

/* When zero products match, let the empty state span the whole grid. */
[data-products-grid] .empty-state { grid-column: 1 / -1; }

/* --- Load more -------------------------------------------------------- */

.catalogue-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-7);
  text-align: center;
}

.catalogue-more-note {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--slate-soft);
}

.catalogue-more-note:focus-visible { outline: none; }

/* --- Reduced motion: swap instantly, no fade -------------------------- */

@media (prefers-reduced-motion: reduce) {
  [data-products-grid],
  [data-products-grid].is-updating {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
