/* ============================================
   YOU1S — Catalogue — TLS-inspired layout
   Sidebar filters left + clean product grid
   ============================================ */

/* ── Page wrapper ── */
.cat-page {
  padding-top: var(--header-h);
  min-height: 100vh;
  background: #fff;
}

/* ── Collection header ── */
.cat-header {
  padding: 48px 0 32px;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}

.cat-header__title {
  font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  margin: 0;
}

/* ── Layout: sidebar + main ── */
.cat-layout {
  display: flex;
  align-items: flex-start;
  min-height: 70vh;
}

/* ── Sidebar ── */
.cat-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #e8e8e8;
  padding: 24px 0;
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: none;
}
.cat-sidebar::-webkit-scrollbar { display: none; }

/* Stock toggle row */
.cat-filter__stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e8;
}
.cat-filter__stock-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0a0a0a;
  letter-spacing: -0.01em;
}

/* Toggle switch — matches screenshot: large dark pill */
.ts-switch { position: relative; width: 44px; height: 24px; display: inline-block; flex-shrink: 0; }
.ts-switch input { opacity: 0; width: 0; height: 0; }
.ts-track {
  position: absolute; inset: 0;
  background: #c8c8c8;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.22s ease;
}
.ts-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.22s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.ts-switch input:checked + .ts-track { background: #0a0a0a; }
.ts-switch input:checked + .ts-track::after { transform: translateX(20px); }

/* Filter accordion groups */
.cat-filter__group {
  border-bottom: 1px solid #e8e8e8;
}
.cat-filter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0a0a0a;
  letter-spacing: -0.01em;
  text-align: left;
  transition: color 0.15s;
}
.cat-filter__head:hover { color: #555; }
.cat-filter__chevron {
  width: 14px; height: 14px;
  transition: transform 0.22s ease;
  flex-shrink: 0;
  stroke-width: 1.8;
}
.cat-filter__group--open .cat-filter__chevron { transform: rotate(180deg); }

.cat-filter__body {
  display: none;
  padding: 4px 20px 16px;
  flex-direction: column;
  gap: 10px;
}
.cat-filter__group--open .cat-filter__body { display: flex; }

.cat-filter__option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #444;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.cat-filter__option input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: #0a0a0a;
  cursor: pointer;
  flex-shrink: 0;
}
.cat-filter__option:hover { color: #0a0a0a; }

/* ── Main content ── */
.cat-main {
  flex: 1;
  min-width: 0;
  padding: 0;
}

/* ── Toolbar ── */
.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid #e8e8e8;
}
.cat-toolbar__count {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #777;
  font-weight: 400;
}
.cat-toolbar__views {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cat-toolbar__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: #bbb;
  transition: color 0.15s;
  padding: 0;
}
.cat-toolbar__view-btn:hover,
.cat-toolbar__view-btn--active { color: #0a0a0a; }
.cat-toolbar__view-btn svg { width: 18px; height: 18px; }

/* ── Products grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

/* ── Product card ── */
.pcard {
  border-right: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
}
.pcard:nth-child(4n) { border-right: none; }

.pcard__link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0;
}

.pcard__media {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: #f4f4f4;
  position: relative;
}
.pcard__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  padding: 8% 6%;
  box-sizing: border-box;
}
.pcard__link:hover .pcard__img { transform: scale(1.03); }

.pcard__info {
  padding: 12px 14px 16px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
}
.pcard__name {
  font-family: 'Bebas Neue', 'Helvetica Neue', sans-serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0a0a0a;
  line-height: 1.3;
  margin-bottom: 4px;
}
.pcard__brand {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.pcard__price {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11px;
  color: #0a0a0a;
  font-weight: 500;
}
.pcard__price-old {
  font-size: 10px;
  color: #aaa;
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: 400;
}

/* 2-column list view */
.products-grid--list {
  grid-template-columns: repeat(2, 1fr);
}
.products-grid--list .pcard:nth-child(4n) { border-right: 1px solid #e8e8e8; }
.products-grid--list .pcard:nth-child(2n) { border-right: none; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}
.empty__text {
  font-size: 14px;
  color: #aaa;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  margin-bottom: 20px;
}

/* ── Mobile filter trigger bar (hidden on desktop) ── */
.cat-mobile-bar { display: none; border-bottom: 1px solid #e8e8e8; background: #fff; }
.cat-mobile-bar__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #0a0a0a;
  text-align: left;
  touch-action: manipulation;
}
.cat-mobile-bar__count { color: #888; font-weight: 400; margin-left: 2px; }

/* ── Filter sheet overlay ── */
.filter-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.filter-sheet-overlay--open { display: block; }

/* ── Mobile-only sheet elements (hidden on desktop) ── */
.cat-filter__mobile-header,
.cat-filter__mobile-footer { display: none; }

/* ── Scroll wrapper (transparent on desktop) ── */
.cat-filter__scroll { display: contents; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .pcard:nth-child(4n) { border-right: 1px solid #e8e8e8; }
  .pcard:nth-child(3n) { border-right: none; }
}

@media (max-width: 768px) {
  .cat-header { padding: 28px 0 20px; }
  .cat-layout { flex-direction: column; }
  .cat-toolbar { padding: 10px 16px; }

  /* Show mobile trigger bar */
  .cat-mobile-bar { display: block; }

  /* Sidebar → bottom sheet */
  .cat-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 90dvh;
    border-right: none;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.14);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 200;
    display: flex !important;
    flex-direction: column;
    padding: 0;
    top: auto;
    overflow: hidden;
    background: #fff;
  }
  .cat-sidebar--open { transform: translateY(0); }

  /* Sheet header */
  .cat-filter__mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
  }
  .cat-filter__mobile-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: -0.01em;
  }
  .cat-filter__mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    color: #0a0a0a;
    padding: 0;
    touch-action: manipulation;
  }

  /* Scrollable filter list */
  .cat-filter__scroll {
    display: block;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* Sheet footer */
  .cat-filter__mobile-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
    background: #fff;
  }
  .cat-filter__mobile-reset {
    flex: 1;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 100px;
    background: #fff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #0a0a0a;
    cursor: pointer;
    touch-action: manipulation;
  }
  .cat-filter__mobile-apply {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 100px;
    background: #0a0a0a;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
  }

  /* Grid mobile */
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .pcard:nth-child(3n) { border-right: 1px solid #e8e8e8; }
  .pcard:nth-child(2n) { border-right: none; }
}
