/* ==========================================================================
   Cotton Trend: shop archive, product categories and product search.
   Builds on pages.css (page head, pills, sidebar, toolbar, cat hero).
   ========================================================================== */

/* Page head count */
.ct-head-count { margin: 0; }

/* Category pills are links here */
.cat-chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-chip[aria-current="page"] small { color: rgba(255,255,255,.7); }

/* Filter form */
.ct-filters { display: block; }
.ct-cat-list__sub { margin: 10px 0 0 30px; }
.ct-cat-list__sub .check { font-size: 14px; }
.size-btn { padding: 0 4px; }
.color-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }

/* "Show results" is needed on desktop too, where filters sit beside the grid */
@media (min-width: 1100px) {
  .shop-layout:not(.layout--drawer) .shop-sidebar__foot { display: flex; }
}
.shop-sidebar__foot .btn { white-space: nowrap; }

.filters-toggle { gap: 8px; }
.ct-filter-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; }
.filters-toggle:hover .ct-filter-count { background: #fff; color: var(--ink); }

/* Toolbar */
.shop-toolbar .woocommerce-ordering { margin-left: auto; }
.shop-toolbar .seg { flex: 0 1 auto; }
.seg__btn { display: inline-flex; align-items: center; }
.shop-toolbar + ul.products { margin-top: 28px; }
.woocommerce-ordering noscript .btn { min-height: 40px; padding: 0 16px; }

/* Active filters as links */
a.active-chip { color: var(--ink); }

/* Sub-categories */
.subcat[aria-current="page"] .subcat__img { border-color: var(--ink); }
.subcat[aria-current="page"] b { font-weight: 600; }

/* Category hero description may contain paragraphs */
.cat-hero__desc { display: grid; gap: 10px; }
.cat-hero__desc p { margin: 0; }

/* Load more */
.load-more [data-load-more-btn].is-loading { opacity: .55; pointer-events: none; }
.js-load-more .layout--drawer .woocommerce-pagination { display: none; }
ul.products li.product.ct-appear { animation: ct-appear .45s ease both; }
@keyframes ct-appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { ul.products li.product.ct-appear { animation: none; } }

/* Size guide teaser */
.ct-size-guide__title { margin-top: 10px; }
.ct-size-guide__link { margin-top: 24px; }

/* Empty state */
.ct-empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: clamp(48px, 7vw, 96px) 16px; margin-top: 12px; background: var(--stone); border-radius: 10px; }
.ct-empty__icon { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.ct-empty__icon .icon { width: 26px; height: 26px; }
.ct-empty h2 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.02em; }
.ct-empty p { color: var(--muted); max-width: 40ch; }
.ct-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* Small screens */
@media (max-width: 760px) {
  .shop-toolbar { gap: 10px; }
  .shop-toolbar .woocommerce-ordering { min-width: 0; }
  .shop-toolbar .select select { max-width: 52vw; text-overflow: ellipsis; }
  .ct-empty__actions .btn { width: 100%; }
}
