/* =============================================================
   KIANIRO · product-list.css
   Product list page (catalog/product_list.html). Loaded after css/style.css,
   which already holds the tokens, base styles, buttons, header, menus,
   search and footer; this file only adds what is unique to this page.

   TABLE OF CONTENTS
     01  Page hero (breadcrumb, title, stats, floating products)
     02  Toolbar: category tabs, search, sort, view toggle (sticky)
     03  Product cards: grid and list views
     04  Empty state, load more, progress
     05  Bulk order strip
     06  Responsive
     07  Reduced motion
   ============================================================= */


/* =============================================================
   01  PAGE HERO
   ============================================================= */
.pl-hero {
  position: relative; overflow: hidden;
  padding-top: calc(var(--header-h) + clamp(36px, 6vw, 88px));
  padding-bottom: clamp(40px, 5vw, 72px);
}
/* faint blueprint grid fading toward the copy */
.pl-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(60% 80% at 20% 45%, #000, transparent 75%);
          mask-image: radial-gradient(60% 80% at 20% 45%, #000, transparent 75%);
  opacity: .7;
}
.pl-hero__in {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: 40px;
}

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mist); }
.crumbs a { color: var(--slate); transition: color .4s var(--ease-out); }
.crumbs .ico { transform: rotate(90deg); color: var(--hair-2); }   /* the chevron points "forward" in RTL */
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
@media (hover: hover) { .crumbs a:hover { color: var(--ember); } }

.pl-hero__title {
  margin: 22px 0 20px;
  font-size: clamp(40px, 5.6vw, 82px); font-weight: 200; line-height: 1.22;
}
.pl-hero__title b { font-weight: 800; }
.pl-hero__title .swoosh { font-family: var(--f-mono); font-weight: 500; letter-spacing: .02em; }
.pl-hero__lead { max-width: 48ch; font-size: clamp(15.5px, 1.2vw, 17.5px); line-height: 2.05; }

.pl-stats { display: flex; flex-wrap: wrap; gap: 14px 0; margin-top: 34px; }
.pl-stats li { display: grid; gap: 2px; padding-inline: 0 28px; margin-inline-end: 28px; border-inline-end: 1px solid var(--hair-2); }
.pl-stats li:last-child { border: 0; margin: 0; padding: 0; }
.pl-stats b { font-size: clamp(24px, 2.4vw, 32px); font-weight: 300; line-height: 1.3; color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-stats span { font-size: 12.5px; color: var(--mist); }

/* floating products on white plinths */
.pl-hero__visual { position: relative; height: clamp(300px, 34vw, 480px); }
.plinth {
  position: absolute; display: grid; place-items: center; border-radius: 50%;
  background: var(--pearl);
  box-shadow: 0 40px 80px -50px rgba(10, 27, 46, .45), inset 0 0 0 1px var(--hair);
}
.plinth img { width: 78%; height: 78%; object-fit: contain; mix-blend-mode: multiply; }
.plinth--a { width: 54%; aspect-ratio: 1; left: 22%; top: 10%; z-index: 2; }
.plinth--b { width: 32%; aspect-ratio: 1; left: 0;   bottom: 4%; }
.plinth--c { width: 26%; aspect-ratio: 1; right: 2%; bottom: 14%; z-index: 3; }
/* a thin orbit with an ember spark circling the main product */
.pl-hero__ring {
  position: absolute; left: 12%; top: 0; width: 74%; aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed var(--hair-2);
  animation: plOrbit 26s linear infinite;
}
.pl-hero__ring::after {
  content: ""; position: absolute; top: 50%; left: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ember); box-shadow: 0 0 0 6px rgba(229, 101, 42, .14);
}
@keyframes plOrbit { to { transform: rotate(360deg); } }


/* =============================================================
   02  TOOLBAR (sticky under the header)
   ============================================================= */
.pl-bar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(245, 246, 248, .84);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
          backdrop-filter: saturate(160%) blur(16px);
  border-block: 1px solid var(--hair);
  transition: transform .8s var(--ease-out);
}
/* while stuck, slide below the header whenever the header is showing */
.pl-bar.is-under-header { transform: translateY(var(--header-h)); }

.pl-bar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding-block: 12px; }

.pl-tabs {
  position: relative; display: flex; gap: 4px; min-width: 0;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 4px; margin: -4px;
}
.pl-tabs::-webkit-scrollbar { display: none; }
.pl-tabs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 100px;
  background: var(--ink); pointer-events: none;
}
.pl-tab {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding-inline: 18px; border-radius: 100px;
  font-size: 14px; font-weight: 500; color: var(--slate); white-space: nowrap;
  transition: color .5s var(--ease-out);
}
.pl-tab[aria-selected="true"] { color: var(--pearl); }
.pl-tab__n { font-family: var(--f-mono); font-size: 10.5px; color: var(--mist); transition: color .5s var(--ease-out); }
.pl-tab[aria-selected="true"] .pl-tab__n { color: rgba(255, 255, 255, .55); }
@media (hover: hover) { .pl-tab:not([aria-selected="true"]):hover { color: var(--ink); } }
/* fallback before the script positions the pill */
html:not(.pl-ready) .pl-tab[aria-selected="true"] { background: var(--ink); }

.pl-tools { flex: none; display: flex; align-items: center; gap: 10px; }

.pl-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 46px; width: 250px; padding-inline: 16px 8px; border-radius: 100px;
  background: var(--pearl); border: 1px solid var(--hair);
  color: var(--mist);
  transition: border-color .5s var(--ease-out), box-shadow .5s var(--ease-out), width .7s var(--ease-out);
}
.pl-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(10, 27, 46, .06); width: 290px; }
.pl-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0;
  font: inherit; font-size: 14px; color: var(--ink); caret-color: var(--ember);
}
.pl-search input::placeholder { color: var(--mist); }
.pl-search input::-webkit-search-cancel-button { display: none; }
.pl-search__clear { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--slate); }
@media (hover: hover) { .pl-search__clear:hover { background: var(--porcelain); color: var(--ink); } }

.pl-sort { position: relative; display: block; }
.pl-sort select {
  appearance: none; -webkit-appearance: none;
  height: 46px; padding-inline: 18px 40px; border-radius: 100px;
  background: var(--pearl); border: 1px solid var(--hair);
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
  transition: border-color .5s var(--ease-out);
}
.pl-sort .ico { position: absolute; left: 16px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--mist); }
.pl-sort select:focus-visible { outline: 1.5px solid var(--ember); outline-offset: 3px; }
@media (hover: hover) { .pl-sort select:hover { border-color: var(--hair-2); } }

.pl-view { display: flex; padding: 3px; border-radius: 100px; background: var(--pearl); border: 1px solid var(--hair); }
.pl-view__btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--mist);
  transition: background-color .5s var(--ease-out), color .5s var(--ease-out);
}
.pl-view__btn[aria-pressed="true"] { background: var(--porcelain); color: var(--ink); }


/* =============================================================
   03  PRODUCT CARDS
   ============================================================= */
.pl-body { padding-block: clamp(28px, 3.4vw, 44px) clamp(70px, 9vw, 120px); }
.pl-count { margin-bottom: 20px; font-size: 14px; color: var(--mist); }
.pl-count b { color: var(--ink); font-weight: 600; }

.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: 18px; }
/* The server renders every card (crawlable, works without JavaScript). With scripts on, the grid
   waits until product-list.js has applied the filter, sort and first page, so the full list never flashes. */
.pl-js:not(.pl-ready) .pl-grid { visibility: hidden; }

.pc { position: relative; min-width: 0; }
.pc__card {
  position: relative; isolation: isolate; height: 100%;
  display: grid; grid-template-rows: auto 1fr;
  background: var(--pearl);
  border: 1px solid var(--hair); border-radius: 22px; overflow: hidden;
  transition: border-color .7s var(--ease-out), box-shadow .9s var(--ease-out), transform .9s var(--ease-out);
}
/* rim of light that follows the pointer (same as the home page category cards) */
.pc__card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(229, 101, 42, .7), rgba(29, 79, 130, .35) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .7s var(--ease-out);
}

/* photo stage: pure white so product shots never show a box */
.pc__media {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / .82;
  background: var(--pearl); overflow: hidden;
}
.pc__media::before {   /* soft contact shadow */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 9%; height: 10%;
  background: radial-gradient(closest-side, rgba(10, 27, 46, .14), transparent);
  transition: transform 1.1s var(--ease-out), opacity 1.1s var(--ease-out);
}
.pc__img {
  position: absolute; inset: 10% 16% 14%; width: 68%; height: 76%;
  object-fit: contain; mix-blend-mode: multiply;
  transition: transform 1.1s var(--ease-out);
}
.pc__view {
  position: absolute; left: 50%; bottom: 12px; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 100px;
  background: var(--ink); color: var(--pearl); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease-out), transform .7s var(--ease-out);
}
.pc__flag {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  padding: 3px 11px; border-radius: 100px;
  background: color-mix(in srgb, var(--flag, var(--ember)) 10%, transparent); color: var(--flag, var(--ember));   /* --flag: ProductBadge.color */
  font-size: 11.5px; font-weight: 600;
}

.pc__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 4px 20px 18px; min-width: 0; }
.pc__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--mist); min-width: 0; }
.pc__code {
  min-width: 0; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pc__name {
  font-size: 15px; font-weight: 700; line-height: 1.75; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc__name a { color: inherit; }
.pc__tags { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.pc__tags li {
  padding: 1px 9px; border-radius: 100px; border: 1px solid var(--hair);
  font-size: 11.5px; color: var(--slate); white-space: nowrap;
}
.pc__tags .pc__dots { display: flex; align-items: center; padding: 0 2px; border: 0; }
.pc__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--hair); }
.pc__price { white-space: nowrap; }
.pc__price strong { font-size: 16.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pc__price span { margin-inline-start: 4px; font-size: 11.5px; color: var(--mist); }
.pc__soldout { flex: none; padding: 5px 11px; border-radius: 100px; background: var(--hair); color: var(--mist); font-size: 11.5px; font-weight: 600; }

/* colour options as tiny swatches */
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(10, 27, 46, .14); }   /* --c: Color.hex */

@media (hover: hover) {
  .pc__card:hover { border-color: var(--hair-2); box-shadow: 0 40px 80px -56px rgba(10, 27, 46, .5); transform: translateY(-4px); }
  .pc__card:hover::after { opacity: 1; }
  .pc__card:hover .pc__img { transform: translateY(-8px) scale(1.06); }
  .pc__card:hover .pc__media::before { transform: scaleX(.82); opacity: .6; }
  .pc__card:hover .pc__view { opacity: 1; transform: none; }
}
.pc__media:focus-visible { outline-offset: -4px; }
.pc__media:focus-visible .pc__view { opacity: 1; transform: none; }

/* list view: one product per row */
.pl-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pl-grid.is-list .pc__card { grid-template-rows: none; grid-template-columns: 170px minmax(0, 1fr); }
.pl-grid.is-list .pc__media { aspect-ratio: auto; height: 100%; min-height: 150px; }
.pl-grid.is-list .pc__view, .pl-grid.is-list .pc__flag { display: none; }
.pl-grid.is-list .pc__body {
  grid-template-rows: none; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meta foot" "name foot" "tags foot";
  align-items: center; gap: 4px 28px; padding: 18px 24px;
}
.pl-grid.is-list .pc__meta { grid-area: meta; justify-content: flex-start; }
.pl-grid.is-list .pc__name { grid-area: name; font-size: 16px; -webkit-line-clamp: 1; }
.pl-grid.is-list .pc__tags { grid-area: tags; }
.pl-grid.is-list .pc__foot { grid-area: foot; flex-direction: column; align-items: flex-end; gap: 10px; padding: 0; border: 0; }


/* =============================================================
   04  EMPTY STATE · LOAD MORE · PROGRESS
   ============================================================= */
.pl-empty { display: grid; justify-items: center; gap: 10px; padding: 70px 16px 40px; text-align: center; }
.pl-empty > .ico { width: 44px; height: 44px; color: var(--hair-2); margin-bottom: 6px; }
.pl-empty h2 { font-size: 22px; font-weight: 700; }
.pl-empty p { max-width: 40ch; font-size: 14.5px; color: var(--mist); margin-bottom: 12px; }

.pl-more-wrap { display: grid; justify-items: center; gap: 22px; margin-top: clamp(40px, 5vw, 64px); }
.pl-more-wrap[hidden] { display: none; }
.pl-progress { display: grid; justify-items: center; gap: 10px; font-size: 13px; color: var(--mist); }
.pl-progress__bar { position: relative; width: 180px; height: 2px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.pl-progress__bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: right; transform: scaleX(var(--p, 0)); transition: transform .9s var(--ease-out); }
.pl-more[hidden] { display: none; }


/* =============================================================
   05  BULK ORDER STRIP
   ============================================================= */
.pl-cta { padding-bottom: clamp(80px, 10vw, 130px); }
.pl-cta__in {
  --t1: #F2F5F9; --t2: #A8B7C7;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px 36px;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 32px; background: #07121F; color: var(--t2);
}
.pl-cta__in::before {   /* ember glow */
  content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; left: -160px; top: -300px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(229, 101, 42, .3), transparent);
}
.pl-cta__seal {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14); color: var(--ember);
}
.pl-cta__seal .ico { width: 34px; height: 34px; }
.pl-cta__title { font-size: clamp(21px, 2.2vw, 30px); font-weight: 700; line-height: 1.5; color: var(--t1); }
.pl-cta__copy p { margin-top: 6px; font-size: 15px; line-height: 2; max-width: 60ch; }


/* =============================================================
   06  RESPONSIVE
   ============================================================= */
/* tabs + tools fit on one line only on wide screens; below that the tools get their own row */
@media (max-width: 1440px) {
  .pl-bar__in { flex-wrap: wrap; }
  .pl-tabs { flex-basis: 100%; }
  .pl-tools { flex: 1; }
  .pl-search, .pl-search:focus-within { flex: 0 1 380px; width: auto; }
  .pl-sort { margin-inline-start: auto; }
}

@media (max-width: 900px) {
  .pl-hero__in { grid-template-columns: minmax(0, 1fr); }
  .pl-hero__visual { order: -1; height: clamp(220px, 58vw, 340px); width: min(100%, 460px); margin-inline: auto; }
  .pl-cta__in { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .pl-cta__seal { width: 60px; height: 60px; }
}

@media (max-width: 640px) {
  .pl-hero { padding-top: calc(var(--header-h) + 12px); }
  .pl-hero__title { margin-block: 16px 14px; }
  .pl-stats { margin-top: 24px; }
  .pl-stats li { padding-inline-end: 18px; margin-inline-end: 18px; }

  .pl-bar__in { gap: 10px; padding-block: 10px; }
  .pl-tab { height: 38px; padding-inline: 14px; font-size: 13.5px; }
  .pl-search, .pl-search:focus-within { flex: 1; height: 42px; }
  .pl-sort select { height: 42px; padding-inline: 14px 34px; font-size: 13px; }
  .pl-sort .ico { left: 12px; }
  .pl-view { display: none; }   /* phones always use the two-column grid */

  .pl-grid, .pl-grid.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pl-grid.is-list .pc__card { grid-template-columns: none; grid-template-rows: auto 1fr; }
  .pl-grid.is-list .pc__body { display: grid; grid-template-areas: none; grid-template-columns: none; }
  .pc__card { border-radius: 18px; }
  .pc__body { padding: 2px 12px 12px; gap: 6px; }
  .pc__flag { top: 10px; right: 10px; padding: 2px 9px; font-size: 10.5px; }
  .pc__meta { font-size: 11px; }
  .pc__meta .pc__cat { display: none; }
  .pc__name { font-size: 13.5px; line-height: 1.7; }
  .pc__tags { display: none; }
  .pc__foot { padding-top: 10px; gap: 6px; }
  .pc__price strong { font-size: 14px; }
  .pc__price span { font-size: 10.5px; }
  .pc__foot .bs__add { width: 36px; height: 36px; }

}


/* =============================================================
   07  REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .pl-hero__ring { animation: none; }
}
