/* ============================================================
   catalogue.css — catalogue.php (Product Catalogue page, all categories)
   Three sections: hero banner w/ CTA buttons, category filter pills,
   paginated product grid + pagination bar. Palette matches the rest
   of the storefront (pine/brass/cream, see index.php's :root vars).
   ============================================================ */

/* ---------------- Section 2: banner ---------------- */
.cat-banner {
  position: relative;
  overflow: hidden;
  padding: 72px 0;
  background: linear-gradient(120deg, var(--pine) 0%, var(--pine-dark, #0f2e21) 100%);
  color: #fff;
  text-align: center;
}
.cat-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.08) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(185,138,47,.18) 0, transparent 45%);
  pointer-events: none;
}
/* Admin-uploaded per-item hero photo (catalogue_banner_get() in
   products.php) — sits between the base gradient and the ::before
   highlight/text layers, dimmed so heading/paragraph stay readable
   over any photo. Absent when no image has been set (plain gradient). */
.cat-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .4;
}
.cat-banner-icon {
  font-size: 2.4rem;
  color: var(--brass);
  margin-bottom: 14px;
  position: relative;
}
.cat-banner h1 {
  position: relative;
  font-family: 'Sora', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 12px;
}
.cat-banner h1 em { color: var(--brass); font-style: normal; }
.cat-banner p {
  position: relative;
  max-width: 560px;
  margin: 0 auto 28px;
  color: rgba(255,255,255,.82);
  font-size: 1.02rem;
}
.cat-banner-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .96rem;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.cat-btn:hover { transform: translateY(-2px); }
.cat-btn-primary { background: var(--brass); color: #23200f; }
.cat-btn-primary:hover { box-shadow: 0 10px 24px rgba(185,138,47,.35); color: #23200f; }
.cat-btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); }
.cat-btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------------- Section 3: catalogue ---------------- */
.cat-section { padding: 56px 0 72px; background: var(--bg); }
.cat-heading { max-width: 640px; margin: 0 0 26px; }
.cat-heading h2 { font-family: 'Sora', system-ui, sans-serif; font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--ink); }
.cat-heading h2 em { color: var(--brass); font-style: normal; }
.cat-heading p { color: var(--muted); margin-top: 8px; }

/* ---------------- left filter sidebar + product column ---------------- */
.cat-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.cat-sidebar { width: 240px; flex-shrink: 0; }
.cat-sidebar-card {
  position: sticky;
  top: 100px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
}
.cat-sidebar-title {
  font-family: 'Sora', system-ui, sans-serif;
  font-weight: 800;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
  margin: 0 0 14px;
}
/* Top-level: one entry per navbar item. Categories nest underneath
   whichever item is currently selected (.is-open), accordion-style. */
.cat-sidebar-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-sidebar-item-link {
  display: block;
  padding: 9px 12px;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.cat-sidebar-item-link:hover { background: var(--pine-soft); color: var(--pine); }
.cat-sidebar-item-link.is-active { background: var(--pine); color: #fff; }

.cat-sidebar-sublist { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--line); }
.cat-sidebar-sublist a {
  display: block;
  padding: 7px 12px;
  color: var(--muted);
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.cat-sidebar-sublist a:hover { background: var(--pine-soft); color: var(--pine); }
.cat-sidebar-sublist a.is-active { background: var(--pine); color: #fff; }

.cat-sidebar-empty { color: var(--muted); font-size: .88rem; margin: 0; }

.cat-main { flex: 1; min-width: 0; }

@media (max-width: 767.98px) {
  .cat-layout { flex-direction: column; }
  .cat-sidebar { width: 100%; }
  .cat-sidebar-card { position: static; padding: 16px; }
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (min-width: 576px)  { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; } }

.cat-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(34,39,31,.1);
  border-color: var(--pine-soft);
  color: inherit;
}
.cat-card-img {
  aspect-ratio: 1 / 1;
  background: var(--pine-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.cat-card:hover .cat-card-img img { transform: scale(1.06); }
.cat-card-img .cat-placeholder {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.cat-card-body { padding: 14px 14px 16px; }
.cat-card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brass); font-weight: 700; margin-bottom: 4px; }
.cat-card-name { font-weight: 700; color: var(--ink); font-size: .96rem; line-height: 1.35; }

.cat-empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 1rem;
}

/* ---------------- bottom tag: "Showing X-Y of Z" + pagination ---------------- */
.cat-pagebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.cat-pagebar-info { color: var(--muted); font-size: .9rem; }
.cat-pagebar-info strong { color: var(--ink); }
.cat-pagenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-pagenav a, .cat-pagenav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cat-pagenav a:hover { border-color: var(--pine); color: var(--pine); }
.cat-pagenav a.is-active { background: var(--pine); border-color: var(--pine); color: #fff; }
.cat-pagenav span.is-disabled { color: var(--line); cursor: default; }
.cat-pagenav span.is-ellipsis { border: 0; background: transparent; color: var(--muted); }
