/*
  AVANTCHA — avantcha-collection-products.css
  PLP grid (OS 3.0) — migrated from OS 2.1 section-collection-product-list.css
  Custom AVANTCHA: .av-* class prefix.
  Native OS 3.0 classes kept: .grid, .color-*, .enable-filtering.
  Removed vs OS 2.1 (now native): loading spinner, infinite scroll.
  Kept / adapted: promo block, B2B layout, grid max-width 1545px.
*/

/* ============================================================
   ROOT AND ANIMATIONS
   ============================================================ */


:root {
  --grid-horizontal-spacing: 10px;
}

@keyframes av-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ============================================================
   CONTAINER & GRID
   ============================================================ */

.av-collection__products {
  padding-top: var(--size-48);
  background-color:var(--color-lightergrey);
}

.av-collection__list {
  margin-left: auto;
  margin-right: auto;
  list-style: none;
  padding: 0;
  gap: var(--size-32);
  --column-gap: var(--size-32);
  row-gap: var(--size-32);
  --row-gap: var(--size-32);
  overflow-x: visible;
}

.av-collection__no-products {
  text-align: center;
  padding: var(--size-68) var(--size-24);
}

.av-product-item {background-color:white;}

/* ============================================================
   INFINITE SCROLL
   ============================================================ */

.av-collection__load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: #FAFAFA;
  padding: var(--size-56);
  margin-top: var(--size-80);
}

.av-collection__load-more-button {font-size: var(--font-size-xxs);}


.av-collection__progress {
  width: 100%;
  max-width: 240px;
  height: 2px;
  background-color: var(--color-mediumgrey);
  overflow: hidden;
}

.av-collection__progress-bar {
  height: 100%;
  background-color: var(--color-body);
  transition: width 0.3s ease;
}

.av-collection__progress-text {
  margin: 0;font-size:var(--font-size-xs);text-transform:uppercase;color:var(--color-link);
}

.av-collection__loader {
  display: none;
  justify-content: center;
  padding: 24px 0;
}

.av-collection__loader--active {
  display: flex;
}

.av-collection__loader::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: av-spin 0.7s linear infinite;
}


/* ============================================================
       FILTER BAR
       Product count left; FILTER, SORT, VIEW pushed right
       ============================================================ */

.av-collection theme-facets-form.hidden-mobile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 40px;
  padding-top: var(--size-12);
  padding-bottom: var(--size-12);  
  border-bottom: 1px solid #e8e8e8;
  color:var(--color-link);
  font-size:var(--font-size-xs);
}

/* Flatten .facets-filtering — its children become direct flex items */
.av-collection .facets-filtering {
  display: contents;
}

/* Product count: row 1, far left, pushes FILTER+SORT+VIEW to the right */
.av-collection .av-facets-count, .av-collection .facets-count {
  order: 1;
  margin-right: auto;  
  text-transform: uppercase;
  white-space: nowrap;
}

/* FILTER button: row 1 */
.av-collection .facets-filtering__filters {
  display: flex;
  align-items: center;
  justify-content: flex-end !important;
  order: 2;
  text-transform: uppercase;  
}
.facets-mobile__modals .facets-filtering__summary .body-font-bold {text-transform:uppercase;}

.av-collection .facets-filtering__filters>* {
  /* PLP 2.0 AR: Filter right side (next to Sort), like Vercel */
  margin-left: auto !important;
  margin-right: 0 !important;
}
/* VIEW toggle: row 1, rightmost */
.av-collection .av-view-toggle {
  order: 4;
}

/* SORT: row 1, between FILTER and VIEW */
.av-collection .facets-sorting {
  order: 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* PLP 2.0 AR: Sort arrow thin black, same as Filter arrow (Vercel) */
.av-collection .facets-sorting__summary svg {
  color: var(--color-body, #000);
}

/* Filter bar: medium weight for count, FILTER, SORT + selected value, VIEW */
.av-collection .facets-desktop > .facets-count,
.av-collection .facets-desktop .facets-filtering__modal-summary,
.av-collection .facets-desktop .facets-sorting__summary,
.av-collection .facets-desktop .filter-bar-label,
.av-collection .facets-desktop .av-view-toggle__label {
  font-weight: var(--font-weight-medium);
}

/* Filter bar: chevrons optically centred on the uppercase text.
   line-height:1 tightens the line box; the uppercase caps sit above the
   box centre, so the icon is lifted slightly to match. `top` is used
   (not transform) so the sort chevron's open-state rotate still works. */
.av-collection .facets-desktop .facets-filtering__modal-summary,
.av-collection .facets-desktop .facets-sorting__summary {
  display: flex;
  align-items: center;
  line-height: 1;
}

.av-collection .facets-desktop .facets-filtering__modal-summary svg,
.av-collection .facets-desktop .facets-sorting__summary svg {
  display: block;
  flex-shrink: 0;
  position: relative;
  top: -0.1em;
}

/* PLP 2.0 AR: whole-card image hover swap now lives in public/base/avantcha-card.css */

/* PLP 2.0 AR: filter group icon = thin plus, becomes minus when open (Vercel) */
.av-collection .facets-filtering__details .facets-filtering__summary .icon__arrow,
.av-collection .facets-filtering__details .facets-filtering__summary .icon__minus {
  display: none;
}

.av-collection .facets-filtering__details .facets-filtering__summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.75rem;
  height: 0.75rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}

/* PLP 2.0 AR: minus only while open and not closing, so it flips to plus instantly on click */
.av-collection .facets-filtering__details[open]:not(.is-collapse-closing) .facets-filtering__summary::after {
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

/* PLP 2.0 AR: close cross right edge lines up with the +/- icons (desktop + mobile) */
.av-collection {
  --av-filter-edge: var(--size-20, 1.25rem);
}
.av-collection .facets-filtering__modal-close {
  inset-inline-end: calc(var(--av-filter-edge) - var(--size-12, 0.75rem));
}

/* PLP 2.0 AR: "(65 products)" sits on the same baseline as the FILTER title */
.av-collection .facets-filtering__modal-header {
  align-items: baseline;
}

/* Active tags: row 2, full width */
.av-collection .facets-filtering__active {
  order: 5;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.av-collection .facets-filtering__active-buttons {
  gap: 8px;
}

/* While filters are active, the hairline sits between the count row and the tags row
   (instead of under the whole bar) */
.av-collection theme-facets-form.hidden-mobile:has(.facets-filtering__active-button) {
  border-bottom: none;
}

.av-collection theme-facets-form.hidden-mobile .facets-filtering__active:has(.facets-filtering__active-button) {
  margin-top: var(--size-12);
  padding-top: var(--size-16);
  border-top: 1px solid #e8e8e8;
}

/* Active filter tag: white box, thin grey border, uppercase value, × on the right */
.av-collection .facets-filtering__active-button {
  background-color: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 2px;
  padding: 10px 14px;
  text-decoration: none;
  transition: border-color 0.2s ease-in-out;
}

.av-collection .facets-filtering__active-button:hover {
  border-color: var(--color-text);
}

.av-collection .facets-filtering__active-button-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-xxxs);
  font-weight: var(--font-weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
}

/* Value only, e.g. "IN STOCK" rather than "AVAILABILITY: IN STOCK" (search page keeps the prefix) */
.av-collection .av-facet-tag-label {
  display: none;
}

.av-collection .facets-filtering__active-button-inner svg {
  order: 2;
  width: 10px;
  height: 10px;
  color: inherit;
  flex-shrink: 0;
}

/* CLEAR ALL: grey underlined text link, no box */
.av-collection .facets-filtering__active-clear-all.button {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-xxxs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  text-decoration: none !important;
  color: var(--color-link);
  background-color: transparent;
  box-shadow: none;
  border: 0;
  border-bottom: 2px solid currentColor;
  border-radius: 0;
  padding: 0 0 4px;
  min-height: 0;
  transition: color 0.2s ease-in-out;
}

.av-collection .facets-filtering__active-clear-all.button::after {
  display: none;
}

.av-collection .facets-filtering__active-clear-all.button:hover {
  color: var(--color-text);
  background-color: transparent;
}

/* PLP 2.0 AR: filter drawer CLEAR button, instant black bg + white text on hover (Vercel) */
.av-collection .facets-filtering__modal-content .button--secondary {
  background-color: var(--color-background, #fff);
  color: var(--color-body, #000);
  border-color: var(--color-body, #000);
  transition: none;
}

.av-collection .facets-filtering__modal-content .button--secondary:hover,
.av-collection .facets-filtering__modal-content .button--secondary:focus-visible {
  background-color: var(--color-body, #000);
  color: #fff;
  -webkit-text-fill-color: #fff;
  opacity: 1;
  border-color: var(--color-body, #000);
}
/* PLP 2.0 AR: filter drawer lines, full width. Separate gap control for each line (Vercel) */
.av-collection {
  --av-gap-header: var(--size-12, 0.25rem); /* FILTER title to its line */
  --av-gap-group: var(--size-12, 0.75rem);  /* Availability values to its line, and gap above each group label */
  --av-gap-price: var(--size-4, 0.25rem);   /* Price inputs to its line */
}

.av-collection .facets-filtering__modal-header.facets-filtering__modal-header {
  border-bottom: 1px solid var(--color-border, #e5e5e5);
  padding-block-end: var(--av-gap-header);
  margin-block-end: 0;
}
.av-collection .facets-filtering__details {
  border-bottom: 1px solid var(--color-border, #e5e5e5);
  margin-block: 0;
  padding-block-end: 0;
  margin-inline: calc(-1 * var(--av-filter-edge, 1.25rem));
  padding-inline: var(--av-filter-edge, 1.25rem);
}

.av-collection .facets-filtering__details .facets-filtering__summary {
  padding-block: var(--av-gap-group);
}

.av-collection .facets-filtering__details .facets-filtering__list {
  padding-block-end: 0;
}

.av-collection .facets-filtering__details .facets-filtering__content {
  gap: 0;
  margin-block-end: 0;  
}

.av-collection .facets-filtering__details .facets-filtering__content.price-range {
  padding-block-end: var(--av-gap-price);
}

/* PLP 2.0 AR: keep the close cross on the FILTER title row on mobile too */
.av-collection .facets-filtering__modal-header {
  position: relative;
  padding-inline-end: var(--size-48, 3rem);
}

.av-collection .facets-filtering__modal-close {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* ============================================================
   COLUMN VIEW TOGGLE (4 / 3 / 2)
   Injected by view-toggle.js into the desktop facets bar.
   ============================================================ */

.av-view-toggle {
  display: flex;
  align-items: center;
  gap: var(--size-8);
  flex-shrink: 0;
}

.av-view-toggle__label {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Force Gotham (sans) for all text in the facets bar — body* classes default to serif */
.av-collection .facets-desktop .body1,
.av-collection .facets-desktop .body2,
.av-collection .facets-desktop .body3,
.av-collection .facets-desktop .body4 {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-light);
}

.av-view-btn {
  width: 42px;
  height: 32px;
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.av-view-btn svg rect {
  fill: none;
  stroke: var(--color-link);
  stroke-width: 1;
}

.av-view-btn--active {
  background: #f7f7f7;
}

.av-view-btn--active svg rect {
  stroke: var(--color-body);
}

/* Up to 1000px: max 3 columns, so only the 3 / 2 view options are offered.
   !important beats the inline --desktop-columns set by the section / view-toggle.js.
   Below 960px the grid switches to --mobile-columns as usual. */
@media (max-width: 1000px) {
  /* Extra specificity: base/avantcha-card.css (loaded later) sets .av-view-btn display */
  .av-view-toggle .av-view-btn--4 {
    display: none;
  }

  .av-collection__list[data-columns="4"],
  .av-collection__list[data-columns="5"] {
    --desktop-columns: 3 !important;
  }
}

.av-collection__list--switching .av-product-item {
  opacity: 0;
  transform: scale(0.97);
}


/* ============================================================
   PROMO BLOCK (.av-promo-block)
   Positioned via CSS order (order = grid_position * 2 - 1)
   Products use order = index * 2; promo inserts between them
   ============================================================ */

.av-promo-block {
  position: relative;
  overflow: hidden;
}

.av-promo-block__inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 200px;
  text-decoration: none;
  color: inherit;
}

.av-promo-block__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* image component output — target child <img> */
.av-promo-block__image img,
.av-promo-block__inner>.av-promo-block__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
}

.av-promo-block__content {
  position: relative;
  z-index: 2;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
  height: 100%;
}

.av-promo-block__label {
  display: inline-block;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.av-promo-block__title {
  margin: 0;
  color: #ffffff;
}

/* Light dark overlay (optional) */
.av-promo-block__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

/*COLLECTION FOOTER ICONS*/
.av-plp-footer__item img {height: 53px;width: auto;}


/* ============================================================
   MOBILE STYLING RULES
   Live CH: FILTER + SORT as two equal pill buttons side by side.
   OS 3.0 native theme-modal[data-placement="right"] already does
   the right-slide drawer — we only restyle the trigger bar here.
   Scoped to the top trigger summaries only (not inner filter groups).
   ============================================================ */


@media (max-width: 958px) {

  .av-collection theme-facets-form.hidden-mobile {
      margin-inline: -16px;
      padding-inline: 16px;
    }
  /* Mobile bar (matches design):
     row 1 = product count | VIEW 2/1 toggle
     row 2 = FILTER ⌄ | SORT <selected> ⌄, two halves split by a divider */
  .av-collection .facets-mobile {
    margin-inline: -16px;
    border-bottom: 1px solid #e8e8e8;
  }

  /* Bar typography only — not on .facets-mobile itself, or the FILTER / SORT
     drawers (rendered inside it) would inherit the uppercase + tracking */
  .av-collection .facets-mobile__topbar,
  .av-collection .facets-mobile .facets-filtering>theme-modal>details>summary,
  .av-collection .facets-mobile .facets-sorting__summary {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-link);
  }

  .av-collection .facets-mobile__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: var(--size-12) 16px;
    border-bottom: 1px solid #e8e8e8;
  }

  .av-collection .facets-mobile__topbar .facets-count {
    order: 0;
    margin-right: 0;
  }

  .av-collection .facets-mobile .av-view-toggle {
    gap: var(--size-12);
  }

  .av-collection .facets-mobile .av-view-toggle .filter-bar-label {
    margin-right: var(--size-4);
  }

  .av-collection .facets-mobile__modals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    padding: 0;
  }

  /* Filtering off: SORT takes the full row */
  .av-collection .facets-mobile__modals > :only-child {
    grid-column: 1 / -1;
  }

  .av-collection .facets-mobile .facets-filtering {
    display: flex;
    margin: 0;
    border-right: 1px solid #e8e8e8;
  }

  .av-collection .facets-mobile .facets-filtering > theme-modal,
  .av-collection .facets-mobile .facets-filtering > theme-modal > details,
  .av-collection .facets-mobile__modals > theme-modal,
  .av-collection .facets-mobile__modals > theme-modal > details {
    display: block;
    width: 100%;
  }

  /* FILTER trigger + SORT trigger */
  .av-collection .facets-mobile .facets-filtering>theme-modal>details>summary,
  .av-collection .facets-mobile .facets-sorting__summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--size-8);
    padding: var(--size-16) var(--size-12);
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    font-size:var(--font-size-xxs);
  }

  .av-collection .facets-mobile .facets-filtering>theme-modal>details>summary,
  .av-collection .facets-mobile .filter-bar-label {
    color: var(--color-body);
  }

  .av-collection .facets-mobile .facets-sorting__selected {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Chevrons: same optical centring as desktop */
  .av-collection .facets-mobile .facets-filtering>theme-modal>details>summary svg,
  .av-collection .facets-mobile .facets-sorting__summary svg {
    display: block;
    flex-shrink: 0;
    position: relative;
    top: -0.1em;
    margin-left: var(--size-4);
    color: var(--color-body);
  }

  .av-collection .facets-mobile summary::-webkit-details-marker,
  .av-collection .facets-mobile .facets-sorting__summary::-webkit-details-marker {
    display: none;
  }

  /* Active filter tags: hidden by default on mobile, revealed by tapping the count badge.
     They sit after </form> in the mobile <theme-facets-form>, not inside .facets-mobile. */
  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--size-20);
    padding: var(--size-24) 0 var(--size-24);
    border-bottom: 1px solid #e8e8e8;
  }

  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active.av-tags-open {
    display: flex;
  }

  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--size-12);
    width: 100%;
  }

  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active-button,
  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active-button * {
    font-size: 11px !important;
  }

  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active-clear-all,
  .av-collection theme-facets-form[data-type="mobile"] .facets-filtering__active-clear-all * {
    font-size: 11px !important;
  }

  /* Selected-filter count: floats over the bottom-right corner of the FILTER button
     (appended to the summary by view-toggle.js). Tap to show / hide the selected filters. */
  .av-collection .facets-mobile .av-mobile-filter-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    transform: translate(35%, 35%);
    z-index: 2;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 13px;
    background: #d0d0d0;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  /* Selected filters showing */
  .av-collection .facets-mobile .av-mobile-filter-badge.is-open {
    background: var(--color-body);
    color: #fff;
  }
}

@media (max-width:769px) {
  .av-collection__products {padding-top:var(--size-20);}
}

/* Filter drawer / sheet CLEAR button: label + × (desktop and mobile) */
.av-collection .facets-filtering__clear {
  gap: var(--size-12, 12px);
}

/* Above the button's hover sweep (button::before), like the label span */
.av-collection .facets-filtering__clear svg {
  position: relative;
  z-index: 2;
  flex: none;
  width: 10px;
  height: 10px;
}

/* Mobile FILTER sheet: group headings in caps, smaller CLEAR ALL × / SHOW [n] PRODUCTS buttons */
@media (max-width: 959px) {
  .av-collection .facets-mobile .facets-filtering__details .facets-filtering__summary {
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .av-collection .facets-mobile .facets-filtering__submenu-button-group .button {
    padding: var(--size-12) var(--size-12);
    font-size: var(--font-size-xs);
    letter-spacing: 0.1em;
  }
}