/* =========================================================
   CATALOGUE
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.catalogue-page {
  min-height: 100vh;
}


/* =========================================================
   HERO / INTRO
========================================================= */

.catalogue-hero {
  padding-top: 48px;
  padding-bottom: 42px;
}

.catalogue-hero-inner {
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(280px, 0.85fr);

  align-items: end;

  gap: clamp(48px, 8vw, 120px);
}

.catalogue-heading {
  max-width: 780px;
}

.catalogue-eyebrow {
  display: inline-block;

  margin-bottom: 14px;
}

.catalogue-title {
  margin: 0;

  font-family: var(--font-display);
  font-size: clamp(
    3.6rem,
    7vw,
    7.2rem
  );
  font-weight: 400;
  line-height: 0.92;

  letter-spacing: -0.045em;
}

.catalogue-description {
  max-width: 460px;

  margin: 0;

  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.8;

  color: var(--color-text-soft);
}


/* =========================================================
   TOOLBAR
========================================================= */

.catalogue-toolbar {
  position: sticky;
  top: var(--header-height);

  z-index: 50;

  width: 100%;

  background: rgba(
    255,
    253,
    252,
    0.96
  );

  border-top:
    1px solid
    var(--color-border);

  border-bottom:
    1px solid
    var(--color-border);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.catalogue-toolbar-inner {
  min-height: 68px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 32px;
}


/* =========================================================
   TOOLBAR LEFT
========================================================= */

.catalogue-toolbar-left {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 30px;
}

.catalogue-count {
  flex: 0 0 auto;

  min-width: max-content;

  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1;

  color: var(--color-text-muted);
}


/* =========================================================
   CATEGORY NAV
========================================================= */

.catalogue-category-nav {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 26px;

  overflow-x: auto;

  scrollbar-width: none;

  -webkit-overflow-scrolling: touch;
}

.catalogue-category-nav::-webkit-scrollbar {
  display: none;
}

.catalogue-category-link {
  position: relative;

  flex: 0 0 auto;

  margin: 0;
  padding: 25px 0 24px;

  border: 0;
  border-radius: 0;

  background: transparent;

  appearance: none;
  -webkit-appearance: none;

  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1;

  color: var(--color-text-soft);

  white-space: nowrap;

  cursor: pointer;

  transition:
    color var(--transition-fast);
}

.catalogue-category-link::after {
  content: '';

  position: absolute;

  left: 0;
  right: 0;
  bottom: -1px;

  height: 1px;

  background:
    var(--color-text);

  transform: scaleX(0);
  transform-origin: right;

  transition:
    transform
    var(--transition-base);
}

.catalogue-category-link:hover {
  color: var(--color-text);
}

.catalogue-category-link.is-active {
  color: var(--color-text);
}

.catalogue-category-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}


/* =========================================================
   TOOLBAR RIGHT
========================================================= */

.catalogue-toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 24px;

  min-width: max-content;
}


/* =========================================================
   TOOLBAR BUTTON
========================================================= */

.catalogue-toolbar-button {
  min-height: auto;

  margin: 0;
  padding: 8px 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  border: 0;
  border-radius: 0;

  background: transparent;

  appearance: none;
  -webkit-appearance: none;

  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;

  color: var(--color-text);

  cursor: pointer;

  transition:
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.catalogue-toolbar-button:hover {
  color:
    var(--color-primary-hover);
}

.catalogue-toolbar-button .icon {
  width: 15px;
  height: 15px;
}


/* =========================================================
   FILTER TRIGGER
========================================================= */

.catalogue-filter-trigger {
  position: relative;
}

.catalogue-filter-trigger.has-active-filters {
  color:
    var(--color-primary-hover);
}

.catalogue-filter-trigger.has-active-filters::after {
  content: '';

  position: absolute;

  right: -7px;
  top: 2px;

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background:
    var(--color-primary);
}


/* =========================================================
   SORT
========================================================= */

.catalogue-sort {
  position: relative;
}

.catalogue-sort-toggle {
  min-width: max-content;
}

.catalogue-sort-prefix {
  color:
    var(--color-text-muted);
}

.catalogue-sort-menu {
  position: absolute;

  top: calc(100% + 18px);
  right: 0;

  z-index: 80;

  min-width: 210px;

  padding: 8px;

  background:
    var(--color-bg);

  border:
    1px solid
    var(--color-border);

  box-shadow:
    0 18px 48px
    rgba(48, 41, 44, 0.08);

  opacity: 0;
  visibility: hidden;

  transform:
    translateY(-6px);

  transition:
    opacity var(--transition-base),
    visibility var(--transition-base),
    transform var(--transition-base);
}

.catalogue-sort.is-open
.catalogue-sort-menu {
  opacity: 1;
  visibility: visible;

  transform:
    translateY(0);
}

.catalogue-sort-option {
  width: 100%;

  margin: 0;
  padding: 12px 11px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border: 0;
  border-radius: 0;

  background: transparent;

  appearance: none;
  -webkit-appearance: none;

  text-align: left;

  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 400;

  color:
    var(--color-text-soft);

  cursor: pointer;

  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.catalogue-sort-option:hover {
  background:
    var(--color-surface-soft);

  color:
    var(--color-text);
}

.catalogue-sort-option.is-active {
  color:
    var(--color-text);

  font-weight: 500;
}


/* =========================================================
   SEARCH INFO
========================================================= */

.catalogue-search-info {
  display: none;

  padding:
    18px 0;

  background:
    var(--color-surface-soft);

  border-bottom:
    1px solid
    var(--color-border);
}

.catalogue-search-info.is-visible {
  display: block;
}

.catalogue-search-info-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.catalogue-search-query {
  margin: 0;

  font-family: var(--font-ui);
  font-size: 0.78rem;

  color:
    var(--color-text-soft);
}

.catalogue-search-query strong {
  font-weight: 500;

  color:
    var(--color-text);
}


/* =========================================================
   PRODUCTS
========================================================= */

.catalogue-products {
  padding-top: 38px;
  padding-bottom:
    var(--space-5xl);
}

.catalogue-products-grid {
  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap:
    58px
    20px;
}


/* =========================================================
   PRODUCT CARD OVERRIDE
========================================================= */

.catalogue-products
.product-card {
  min-width: 0;
}

.catalogue-products
.product-card > a {
  display: block;
}

.catalogue-products
.product-card-media {
  background: #f8f6f6;
}

.catalogue-products
.product-card-title {
  font-size: 0.84rem;
}

.catalogue-products
.product-card-category {
  margin-top: 4px;
}

.catalogue-products
.product-card-price {
  margin-top: 7px;
}

.catalogue-products
.badge {
  background:
    rgba(
      255,
      255,
      255,
      0.92
    );

  backdrop-filter:
    blur(8px);

  -webkit-backdrop-filter:
    blur(8px);
}


/* =========================================================
   EMPTY STATE
========================================================= */

.catalogue-empty {
  min-height: 440px;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 80px 20px;

  text-align: center;
}

.catalogue-empty.is-visible {
  display: flex;
}

.catalogue-empty-inner {
  max-width: 420px;
}

.catalogue-empty-title {
  margin-top: 10px;

  font-family:
    var(--font-display);

  font-size:
    clamp(
      2.6rem,
      6vw,
      4.2rem
    );

  font-weight: 400;
  line-height: 1;

  letter-spacing:
    -0.025em;
}

.catalogue-empty-description {
  margin-top: 16px;

  font-size: 0.8rem;
  line-height: 1.7;

  color:
    var(--color-text-muted);
}

.catalogue-empty .button {
  margin-top: 26px;
}


/* =========================================================
   FILTER DRAWER
========================================================= */

.catalogue-filter {
  position: fixed;

  inset: 0;

  z-index: 500;

  pointer-events: none;
}

.catalogue-filter-overlay {
  position: absolute;

  inset: 0;

  background:
    rgba(
      23,
      19,
      21,
      0.3
    );

  opacity: 0;

  transition:
    opacity var(--transition-base);
}

.catalogue-filter-panel {
  position: absolute;

  top: 0;
  right: 0;

  width:
    min(
      92vw,
      430px
    );

  height: 100%;

  display: flex;
  flex-direction: column;

  background:
    var(--color-bg);

  transform:
    translateX(100%);

  box-shadow:
    -20px 0 60px
    rgba(48, 41, 44, 0.06);

  transition:
    transform var(--transition-base);
}

.catalogue-filter.is-open {
  pointer-events: auto;
}

.catalogue-filter.is-open
.catalogue-filter-overlay {
  opacity: 1;
}

.catalogue-filter.is-open
.catalogue-filter-panel {
  transform:
    translateX(0);
}


/* =========================================================
   FILTER HEADER
========================================================= */

.catalogue-filter-header {
  min-height: 88px;

  padding:
    18px 26px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom:
    1px solid
    var(--color-border);
}

.catalogue-filter-header
.text-eyebrow {
  display: block;

  margin-bottom: 5px;
}

.catalogue-filter-title {
  margin: 0;

  font-family:
    var(--font-display);

  font-size: 2rem;
  font-weight: 400;
  line-height: 1;

  letter-spacing:
    -0.02em;

  text-transform: none;
}

.catalogue-filter-close {
  width: 38px;
  height: 38px;

  margin: 0;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;

  background: transparent;

  appearance: none;
  -webkit-appearance: none;

  color:
    var(--color-text);

  cursor: pointer;

  transition:
    background var(--transition-fast);
}

.catalogue-filter-close:hover {
  background:
    var(--color-surface-soft);
}


/* =========================================================
   FILTER BODY
========================================================= */

.catalogue-filter-body {
  flex: 1;

  padding:
    0
    26px
    34px;

  overflow-y: auto;

  overscroll-behavior:
    contain;
}

.catalogue-filter-group {
  padding:
    26px 0;

  border-bottom:
    1px solid
    var(--color-border);
}

.catalogue-filter-group:last-child {
  border-bottom: 0;
}


/* Desktop:
   category already exists
   in horizontal toolbar.
*/

.catalogue-filter-group-category {
  display: none;
}

.catalogue-filter-group-title {
  margin: 0 0 14px;

  font-family:
    var(--font-ui);

  font-size: 0.66rem;
  font-weight: 600;

  letter-spacing: 0.11em;
  text-transform: uppercase;

  color:
    var(--color-text-muted);
}

.catalogue-filter-options {
  display: flex;
  flex-direction: column;

  gap: 1px;
}


/* =========================================================
   FILTER OPTION
========================================================= */

.catalogue-filter-option {
  position: relative;

  width: 100%;

  margin: 0;
  padding: 11px 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  border: 0;
  border-radius: 0;

  background: transparent;

  appearance: none;
  -webkit-appearance: none;

  text-align: left;

  font-family:
    var(--font-ui);

  font-size: 0.8rem;
  font-weight: 400;

  color:
    var(--color-text-soft);

  cursor: pointer;

  transition:
    color var(--transition-fast),
    padding-left var(--transition-fast);
}

.catalogue-filter-option::before {
  content: '';

  position: absolute;

  left: 0;
  top: 50%;

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background:
    var(--color-text);

  opacity: 0;

  transform:
    translateY(-50%)
    scale(0.6);

  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.catalogue-filter-option:hover {
  color:
    var(--color-text);
}

.catalogue-filter-option.is-active {
  padding-left: 14px;

  color:
    var(--color-text);

  font-weight: 500;
}

.catalogue-filter-option.is-active::before {
  opacity: 1;

  transform:
    translateY(-50%)
    scale(1);
}

.catalogue-filter-option-count {
  flex: 0 0 auto;

  font-size: 0.68rem;
  font-weight: 400;

  color:
    var(--color-text-muted);
}


/* =========================================================
   FILTER FOOTER
========================================================= */

.catalogue-filter-footer {
  padding:
    18px
    26px
    22px;

  display: grid;

  grid-template-columns:
    0.8fr
    1.2fr;

  gap: 10px;

  border-top:
    1px solid
    var(--color-border);

  background:
    var(--color-bg);
}

.catalogue-filter-footer
.button {
  min-height: 48px;
}


/* =========================================================
   LOADING
========================================================= */

.catalogue-loading {
  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap:
    58px
    20px;
}

.catalogue-loading-card {
  min-width: 0;
}

.catalogue-loading-media {
  aspect-ratio:
    var(--ratio-product);
}

.catalogue-loading-line {
  height: 12px;

  margin-top: 12px;

  border-radius:
    var(--radius-pill);
}

.catalogue-loading-line.is-name {
  width: 58%;
}

.catalogue-loading-line.is-price {
  width: 35%;
}


/* =========================================================
   LARGE TABLET / SMALL LAPTOP
========================================================= */

@media (max-width: 1199px) {
  .catalogue-hero-inner {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(240px, 0.72fr);

    gap: 54px;
  }

  .catalogue-toolbar-left {
    gap: 24px;
  }

  .catalogue-category-nav {
    gap: 20px;
  }

  .catalogue-products-grid,
  .catalogue-loading {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );

    gap:
      46px
      16px;
  }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1023px) {
  .catalogue-hero {
    padding-top: 38px;
    padding-bottom: 34px;
  }

  .catalogue-toolbar-inner {
    min-height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
  }

  .catalogue-toolbar-left {
    flex: 1;

    gap: 0;
  }

  .catalogue-category-nav {
    display: none;
  }

  .catalogue-toolbar-right {
    margin-left: auto;

    gap: 20px;
  }

  .catalogue-filter-group-category {
    display: block;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
  .catalogue-hero {
    padding-top: 30px;
    padding-bottom: 28px;
  }

  .catalogue-hero-inner {
    grid-template-columns: 1fr;

    gap: 18px;
  }

  .catalogue-title {
    font-size:
      clamp(
        3.4rem,
        17vw,
        5rem
      );
  }

  .catalogue-description {
    max-width: 340px;

    font-size: 0.79rem;
    line-height: 1.7;
  }

  .catalogue-toolbar {
    top:
      var(--header-height);
  }

  .catalogue-toolbar-inner {
    min-height: 58px;

    gap: 12px;
  }

  .catalogue-count {
    font-size: 0.66rem;
  }

  .catalogue-toolbar-right {
    gap: 16px;
  }

  .catalogue-toolbar-button {
    font-size: 0.69rem;

    gap: 6px;
  }

  .catalogue-toolbar-button
  .icon {
    width: 14px;
    height: 14px;
  }

  .catalogue-sort-prefix {
    display: none;
  }

  .catalogue-sort-menu {
    min-width: 190px;

    top:
      calc(
        100% + 16px
      );
  }

  .catalogue-search-info {
    padding:
      15px 0;
  }

  .catalogue-search-info-inner {
    align-items:
      flex-start;

    flex-direction:
      column;

    gap: 10px;
  }

  .catalogue-products {
    padding-top: 26px;
    padding-bottom: 96px;
  }

  .catalogue-products-grid,
  .catalogue-loading {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap:
      34px
      10px;
  }

  .catalogue-products
  .product-card-title {
    font-size: 0.78rem;
  }

  .catalogue-products
  .product-card-category {
    font-size: 0.66rem;
  }

  .catalogue-products
  .product-card-price {
    font-size: 0.72rem;
  }

  .catalogue-filter-panel {
    width:
      min(
        94vw,
        400px
      );
  }

  .catalogue-filter-header {
    min-height: 82px;

    padding:
      16px
      22px;
  }

  .catalogue-filter-title {
    font-size: 1.8rem;
  }

  .catalogue-filter-body {
    padding:
      0
      22px
      30px;
  }

  .catalogue-filter-footer {
    padding:
      16px
      22px
      20px;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .catalogue-toolbar-inner {
    gap: 8px;
  }

  .catalogue-toolbar-right {
    gap: 12px;
  }

  .catalogue-count {
    font-size: 0.63rem;
  }

  .catalogue-toolbar-button {
    font-size: 0.66rem;
  }

  .catalogue-filter-trigger
  .icon {
    display: none;
  }

  .catalogue-sort-toggle
  .icon {
    width: 13px;
    height: 13px;
  }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
  .catalogue-toolbar-right {
    gap: 10px;
  }

  .catalogue-products-grid,
  .catalogue-loading {
    gap:
      30px
      8px;
  }

  .catalogue-filter-footer {
    grid-template-columns:
      1fr
      1.25fr;
  }
}


/* =========================================================
   HOVER CAPABLE
========================================================= */

@media (hover: hover) and (pointer: fine) {
  .catalogue-category-link:hover::after {
    transform:
      scaleX(1);

    transform-origin:
      left;
  }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .catalogue-filter-panel,
  .catalogue-filter-overlay,
  .catalogue-sort-menu,
  .catalogue-category-link::after,
  .catalogue-filter-option,
  .catalogue-filter-option::before {
    transition: none !important;
  }
}