/* === PAGE HEADER === */
.tm-page-header {
  padding: 40px var(--tm-content-px) 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.tm-breadcrumbs {
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.tm-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}
.tm-breadcrumbs a:hover { color: var(--wp--preset--color--accent); }
.tm-breadcrumb-sep {
  margin: 0 8px;
  color: var(--wp--preset--color--text-divider);
}
.tm-breadcrumb-current {
  color: var(--wp--preset--color--text);
}
.tm-page-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: end;
}
.tm-page-h1 {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.tm-page-lead {
  font-size: 16px;
  color: var(--wp--preset--color--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 460px;
}
.tm-page-header-hero-wrap {
  overflow: hidden;
  margin-top: 28px;
}

.tm-page-header-hero {
  width: 100%;
  aspect-ratio: 12 / 5;
  object-fit: cover;
  display: block;
}

.tm-page-header-stats {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
}
.tm-stat {
  text-align: right;
}
.tm-stat-n {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 32px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1;
}
.tm-stat-l {
  font-size: 11px;
  color: var(--wp--preset--color--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* === CATEGORY TABS === */
.tm-category-tabs {
  margin-top: 40px;
  padding: 0 var(--tm-content-px);
  border-bottom: 1px solid var(--wp--preset--color--border);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tm-category-tabs::-webkit-scrollbar { display: none; }
.tm-cat-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 0 16px;
  color: var(--wp--preset--color--text-muted);
  font-weight: 500;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tm-cat-tab:hover {
  color: var(--wp--preset--color--text);
}
.tm-cat-tab.is-active {
  color: var(--wp--preset--color--text);
  border-bottom-color: var(--wp--preset--color--accent);
}
.tm-cat-tab-count {
  font-size: 11px;
  color: var(--wp--preset--color--text-light);
}
.tm-cat-tab.is-active .tm-cat-tab-count {
  color: var(--wp--preset--color--text-muted);
}

/* === FILTER ROW === */
.tm-filter-row {
  position: sticky;
  top: 88px;
  background: var(--wp--preset--color--bg);
  z-index: 5;
  height: 64px;
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding: 0 max(80px, calc((100vw - 1200px) / 2 + 80px));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tm-filters-desktop {
  display: flex;
  gap: 12px;
}
.tm-filters-mobile-trigger {
  display: none;
}

.tm-filter-dd {
  position: relative;
}
.tm-filter-dd summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--wp--preset--color--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  background: var(--wp--preset--color--bg);
  user-select: none;
}
.tm-filter-dd summary::-webkit-details-marker { display: none; }
.tm-filter-dd[open] > summary {
  border-color: var(--wp--preset--color--text);
}
.tm-filter-arrow {
  font-size: 9px;
  color: var(--wp--preset--color--text-muted);
}
.tm-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--wp--preset--color--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.tm-filter-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  min-width: 260px;
  background: var(--wp--preset--color--bg);
  border: 1px solid var(--wp--preset--color--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  padding: 16px;
}
.tm-filter-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.tm-filter-options li { padding: 4px 0; }
.tm-filter-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}
.tm-filter-options input[type="checkbox"] {
  margin: 0;
  accent-color: var(--wp--preset--color--accent);
  flex-shrink: 0;
}
.tm-filter-opt-count {
  margin-left: auto;
  color: var(--wp--preset--color--text-light);
  font-size: 12px;
}

.tm-price-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.tm-price-inputs label {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--wp--preset--color--border);
  padding: 0 8px;
  flex: 1;
}
.tm-price-inputs label > span {
  color: var(--wp--preset--color--text-muted);
  margin-right: 4px;
  font-size: 13px;
}
.tm-price-inputs input {
  border: none;
  outline: none;
  width: 100%;
  height: 36px;
  font-size: 14px;
  background: transparent;
  font-family: inherit;
  color: var(--wp--preset--color--text);
}
.tm-price-sep {
  color: var(--wp--preset--color--text-muted);
}

.tm-filter-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--wp--preset--color--border);
}

.tm-btn-small {
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
}
.tm-btn-small.tm-btn-primary {
  background: var(--wp--preset--color--accent);
  color: #fff;
}
.tm-btn-small.tm-btn-primary:hover {
  background: var(--wp--preset--color--accent-dark);
}
.tm-btn-small.tm-btn-text {
  background: none;
  color: var(--wp--preset--color--text-muted);
}
.tm-btn-small.tm-btn-text:hover {
  color: var(--wp--preset--color--text);
}

/* Right side: count + sort */
.tm-filter-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.tm-filter-total {
  font-size: 13px;
  color: var(--wp--preset--color--text-muted);
}
.tm-filter-divider {
  width: 1px;
  height: 16px;
  background: var(--wp--preset--color--border);
}

.tm-sort-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tm-sort-label {
  font-size: 13px;
  color: var(--wp--preset--color--text-muted);
}
.tm-sort-select {
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  cursor: pointer;
  font-family: inherit;
}

/* === PRODUCT GRID === */
.tm-grid-archive {
  padding: 40px var(--tm-content-px) 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px 28px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* === PAGINATION === */
.tm-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 var(--tm-content-px) 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.tm-pagination .page-numbers {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.tm-pagination .page-numbers:hover {
  border-color: var(--wp--preset--color--text);
}
.tm-pagination .page-numbers.current {
  background: var(--wp--preset--color--text);
  color: #fff;
  border-color: var(--wp--preset--color--text);
}
.tm-pagination .page-numbers.dots {
  border: none;
  background: none;
}

/* === EMPTY STATE === */
.tm-empty-state {
  text-align: center;
  padding: 96px 40px;
  max-width: 480px;
  margin: 0 auto;
}
.tm-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  color: var(--wp--preset--color--text-light);
  display: block;
}
.tm-empty-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--wp--preset--color--text);
}
.tm-empty-lead {
  font-size: 14px;
  color: var(--wp--preset--color--text-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

/* === MOBILE FILTER SHEET === */
.tm-filter-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.tm-filters-open .tm-filter-sheet-overlay {
  opacity: 1;
  pointer-events: auto;
}

.tm-filter-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--wp--preset--color--bg);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.tm-filters-open .tm-filter-sheet {
  transform: translateX(0);
}

.tm-filter-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wp--preset--color--border);
}
.tm-filter-sheet-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}
.tm-filter-sheet-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp--preset--color--text);
}

.tm-filter-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}
.tm-filter-group {
  border: none;
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--wp--preset--color--border);
}
.tm-filter-group legend {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--text-muted);
  margin-bottom: 12px;
  padding: 0;
}
.tm-sort-select-mobile {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--bg);
  font-size: 14px;
  font-family: inherit;
  color: var(--wp--preset--color--text);
}

.tm-filter-sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--bg);
}
.tm-filter-sheet-apply {
  flex: 1;
  height: 48px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: var(--wp--preset--color--accent);
  color: #fff;
}
.tm-filter-sheet-apply:hover {
  background: var(--wp--preset--color--accent-dark);
}

/* === MOBILE === */
@media (max-width: 768px) {
  .tm-page-header { padding: 24px 14px 0; }
  .tm-page-header-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .tm-page-header-stats {
    justify-content: flex-start;
    gap: 24px;
  }
  .tm-stat { text-align: left; }
  .tm-stat-n { font-size: 24px; }

  .tm-category-tabs {
    margin-top: 24px;
    padding: 0 14px;
    gap: 18px;
  }

  .tm-filter-row {
    top: 64px;
    padding: 0 14px;
    height: 56px;
  }
  .tm-filters-desktop { display: none; }
  .tm-filters-mobile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--wp--preset--color--border);
    background: var(--wp--preset--color--bg);
    font-size: 13px;
    font-weight: 500;
    color: var(--wp--preset--color--text);
    cursor: pointer;
  }
  .tm-filter-right { gap: 12px; }
  .tm-filter-total { font-size: 12px; }
  .tm-sort-label { display: none; }

  .tm-grid-archive {
    padding: 24px 14px 64px;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
  }

  .tm-pagination { padding: 0 14px 64px; }
}
