/* ── Page Header ─────────────────────────────────────────────────────────────── */
.page-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
}

.page-header p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sort-bar label { font-size: 13px; color: var(--muted); }

.sort-bar select {
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color var(--t);
}

.sort-bar select:hover { border-color: var(--ink); }

/* ── Sidebar Toggle Button (mobile only) ─────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 16px 16px 0;
  padding: 10px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--t);
}

.sidebar-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
}

.sidebar-overlay.active { display: block; }

/* ── Shop Layout ─────────────────────────────────────────────────────────────── */
.shop-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: calc(var(--nav-main-h) + var(--nav-dept-h) + 16px);
}

.sidebar-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.cat-link {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink-lt);
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}

.cat-link:hover { color: var(--ink); background: var(--surface-2); }
.cat-link.active { color: var(--primary); background: var(--primary-bg); font-weight: 600; }

.sub-links { padding-left: 12px; }
.sub-links .cat-link { font-size: 13px; }

/* ── Empty State ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--ink);
}

.sidebar-close { display: none; }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 48px 0 24px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-lt);
  background: var(--surface);
  transition: all var(--t);
  box-shadow: var(--shadow-sm);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(27,94,32,.35);
  transform: translateY(-1px);
}
.page-btn:first-child,
.page-btn:last-child {
  padding: 0 20px;
  font-weight: 600;
  letter-spacing: .01em;
}


@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px 16px;
    gap: 12px;
  }
  .page-header h1 { font-size: 24px; }
  .sort-bar { width: 100%; }
  .sort-bar select { flex: 1; }

  .shop-layout {
    grid-template-columns: 1fr;
    padding: 16px 16px 60px;
    gap: 20px;
  }

  /* Sidebar drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 285px;
    height: 100vh;
    background: var(--surface);
    z-index: 300;
    overflow-y: auto;
    transition: left .3s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  .sidebar.open { left: 0; }

  /* Sidebar header */
  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary);
    flex-shrink: 0;
  }
  .sidebar-close span {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .12em;
  }
  .sidebar-close button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    border: none;
    transition: background var(--t);
  }
  .sidebar-close button:hover { background: rgba(255,255,255,.3); }

  /* Hide the sticky title since header shows it */
  .sidebar-title { display: none; }

  /* Category links inside drawer */
  .cat-link {
    padding: 14px 20px;
    font-size: 14px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    display: block;
    color: var(--ink);
  }
  .cat-link:first-of-type {
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-bg);
  }
  .cat-link.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 600;
    border-left: 4px solid var(--primary);
    padding-left: 16px;
  }
  .cat-link:hover:not(.active) {
    background: var(--surface-2);
    color: var(--ink);
  }

  /* Subcategory links */
  .sub-links {
    display: block;          /* always show them on mobile */
    padding-left: 0;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
  }
  .sub-links .cat-link {
    padding: 11px 20px 11px 36px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,.05);
    color: var(--ink-lt);
    position: relative;
  }
  .sub-links .cat-link::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: .5;
  }
  .sub-links .cat-link.active::before { opacity: 1; }
  .sub-links .cat-link:last-child { border-bottom: none; }
}