/* The product catalogue: product tiles, the category pages and the breadcrumbs. */

@layer pages {
  /* A product tile: a 4:5 photo, the name, the stones and the price under it — the product card of the landing without
     its chip and cart button, as the whole tile is one link. */
  .kl__tile { display: flex; flex-direction: column; color: var(--ink); line-height: normal; }
  .kl__tile-img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; border-radius: var(--radius-media); background: var(--sky); transition: opacity var(--duration-base) var(--ease-standard); }
  .kl__tile .kl__tile-placeholder { aspect-ratio: 4 / 5; }
  .kl__tile:hover .kl__tile-img { opacity: .9; }
  .kl__tile-name { display: block; margin-top: 12px; font-family: var(--font-display); font-size: var(--heading-xs); transition: color var(--duration-fast) var(--ease-standard); }
  .kl__tile:hover .kl__tile-name { color: var(--tone); }
  .kl__tile-stones { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }
  /* A tile without a photo shows the bracelet's placeholder (ms-placeholder); hovered, its outline takes the tone. */
  .kl__tile:hover .kl__tile-placeholder::before { border-color: var(--tone); }
  /* The price line: an individual quote's words may wrap in a narrow tile. */
  .kl__tile-price { display: block; margin-top: 6px; font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); white-space: normal; }
  .kl__tile-lowest { display: block; font-size: var(--text-xs); color: var(--muted); }

  .kl__catalog { padding: 8px 0 76px; }
  .kl__catalog-head { max-width: 680px; margin-bottom: clamp(28px, 4vw, 44px); }
  .kl__catalog-title { margin: 0 0 14px; }
  .kl__catalog-lead { margin: 0; font-weight: var(--weight-light); font-size: var(--text-base); line-height: 1.75; color: var(--ink-soft); }
  .kl__catalog-lead + .kl__catalog-lead { margin-top: 10px; }
  /* An archived page (a collection that ended) or a draft the panel previews says so under its heading. */
  .kl__catalog-archived { margin: 18px 0 0; padding: 14px 18px; color: var(--ink-soft); }
  .kl__catalog-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(28px, 3.4vw, 48px); align-items: start; }
  /* A page whose column shows nothing — neither other pages nor filters, or filters whose script has not run (they
     stay hidden without it): the tiles take the whole width. */
  .kl__catalog-layout:not(:has(> .kl__catalog-side > :not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
  .kl__catalog-side:not(:has(> :not([hidden]))) { display: none; }
  .kl__catalog-main { min-width: 0; }

  /* The column beside the tiles: the section's pages, then the filters, each group under a hairline; it stays under the
     sticky navbar while the tiles scroll, and one taller than the window scrolls on its own, so its end is in reach. */
  .kl__catalog-side {
    position: sticky;
    top: calc(var(--nav-stuck) + 24px);
    max-height: calc(100vh - var(--nav-stuck) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
    gap: 28px;
    line-height: normal;
  }
  .kl__catalog-nav-title, .kl__catalog-filters-title {
    margin: 0 0 6px;
    font-family: var(--font-sans);
    font-weight: var(--weight-regular);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--link);
  }
  .kl__catalog-categories { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
  .kl__catalog-categories > li { border-bottom: 1px solid var(--line); }
  .kl__catalog-category { display: block; padding: 12px 0; font-size: var(--text-base); color: var(--ink-soft); transition: color var(--duration-fast) var(--ease-standard); }
  .kl__catalog-category:hover { color: var(--tone); }
  .kl__catalog-category[aria-current="page"] { color: var(--tone); font-weight: var(--weight-medium); }
  /* The pages one level down, under the page the visitor is in. */
  .kl__catalog-subcategories { list-style: none; margin: -4px 0 10px; padding: 0 0 0 14px; }
  .kl__catalog-category--sub { padding: 6px 0; font-size: var(--text-md); }

  /* The filters (catalog_filter_controller.js): hidden in the markup, shown by the script that runs them. Each group
     folds (<details>) under its caps title, a chevron at its end. */
  .kl__catalog-filters { display: flex; flex-direction: column; }
  .kl__catalog-filters[hidden] { display: none; }
  .kl__catalog-filters-title { margin-bottom: 14px; }
  .kl__catalog-filter { border-top: 1px solid var(--line); }
  .kl__catalog-filter:last-of-type { border-bottom: 1px solid var(--line); }
  .kl__catalog-filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    list-style: none;
    cursor: pointer;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--ink);
  }
  .kl__catalog-filter-title::-webkit-details-marker { display: none; }
  .kl__catalog-filter-title::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.4px solid var(--ink);
    border-bottom: 1.4px solid var(--ink);
    transform: rotate(45deg);
    transition: transform var(--duration-base) var(--ease-standard);
  }
  .kl__catalog-filter[open] > .kl__catalog-filter-title::after { margin-top: 3px; transform: rotate(-135deg); }
  .kl__catalog-filter-options { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0 0 16px; border: 0; min-width: 0; }
  .kl__catalog-filter-option { display: flex; gap: 10px; align-items: center; font-size: var(--text-md); color: var(--ink-soft); cursor: pointer; }
  .kl__catalog-filter-status { margin: 12px 0 0; font-size: var(--text-sm); color: var(--muted); }
  .kl__catalog-filter-status:empty { display: none; }
  /* Elements the filters hide: [hidden] alone loses to their own display. */
  :is(.kl__catalog-grid, .kl__catalog-filter-reset, .kl__catalog-sorting)[hidden] { display: none; }
  .kl__catalog-filter-reset { align-self: flex-start; margin-top: 12px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); cursor: pointer; }

  /* Over the tiles: their number on the left, the order on the right. */
  .kl__catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; margin-bottom: 20px; line-height: normal; }
  .kl__catalog-count { margin: 0; font-size: var(--text-md); color: var(--ink-soft); }
  .kl__catalog-sorting { display: flex; align-items: center; gap: 10px; }
  .kl__catalog-sort-label { font-size: var(--text-sm); color: var(--muted); }
  .kl__catalog-sort.ms-input { width: auto; min-width: 176px; padding-block: 9px; border-color: transparent; border-radius: var(--radius-pill); background-color: var(--blush); font-size: var(--text-md); box-shadow: none; }

  /* Pagination: plain links to every page of tiles (?page=2), round, the current one on the sky. */
  .kl__pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin-top: clamp(32px, 4vw, 48px); }
  .kl__pagination[hidden] { display: none; }
  .kl__pagination-pages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
  .kl__pagination-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-pill); font-size: var(--text-md); color: var(--ink); transition: background-color var(--duration-fast) var(--ease-standard); }
  .kl__pagination-link:hover { background: var(--blush); }
  .kl__pagination-link[aria-current="page"] { background: var(--sky-deep); color: var(--ink); }
  .kl__pagination-gap { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); }

  .kl__catalog-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 32px 6px; }
  .kl__catalog-empty { padding: clamp(32px, 5vw, 56px) 24px; text-align: center; }
  .kl__catalog-empty-text { margin: 0 0 18px; color: var(--muted); }

  /* The page's own text under the tiles (its body, in Liquid): under a hairline, quieter than the page. */
  .kl__catalog > .kl__section { margin-top: 24px; padding-top: 0; }
  .kl__catalog > .kl__section > .kl__wrap { padding-top: 36px; border-top: 1px solid var(--line); }
  .kl__catalog > .kl__section :is(h2, .kl__h2) { font-size: var(--heading-md); letter-spacing: normal; }
  .kl__catalog > .kl__section :is(h3, .kl__h3) { margin-top: 20px; font-family: var(--font-sans); font-weight: var(--weight-medium); font-size: var(--text-base); }
  .kl__catalog > .kl__section p { font-weight: var(--weight-light); font-size: var(--text-md); line-height: 1.7; color: var(--ink-soft); }

  .kl__crumbs { margin: 4px 0 22px; font-size: var(--text-sm); line-height: normal; color: var(--muted); }
  .kl__crumbs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .kl__crumbs-item { display: inline-flex; gap: 8px; min-width: 0; }
  /* The separator is drawn, not read: the empty alternative text keeps it out of the accessibility tree. */
  .kl__crumbs-item + .kl__crumbs-item::before { content: "/"; content: "/" / ""; color: var(--muted); }
  .kl__crumbs-link { color: var(--muted); transition: color var(--duration-fast) var(--ease-standard); }
  .kl__crumbs-link:hover { color: var(--tone); }
  /* The page itself, the last crumb, in ink. */
  .kl__crumbs-item:last-child { color: var(--ink); }
}
