/*!
 * catalog.css - /catalog/ only, layered on the redesign tokens.
 *
 * The filter behaviour lives in js/catalog.js and is driven entirely by the
 * data-* attributes in page-catalog.php; the class names here are presentation
 * only, except `.filter-pill.is-active` and `.catalog-card.is-visible`, which
 * that script toggles.
 */

/* ================= LAYOUT ================= */
.cat-layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 22px; align-items: start }
@media(max-width:960px) { .cat-layout { grid-template-columns: 1fr } }

/* ================= FILTER RAIL ================= */
.cat-filters {
  border: 1px solid var(--line); border-radius: 18px; background: var(--cream-2);
  padding: 24px 22px; position: sticky; top: 96px
}
@media(max-width:960px) { .cat-filters { position: static } }

.cat-filters-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line)
}
.cat-count { font-family: 'JetBrains Mono', monospace; font-size: 14px; margin-top: 6px; color: var(--ink) }
.cat-reset {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-ink); transition: color .2s
}
.cat-reset:hover { color: var(--gold-dark) }

.cat-group { margin-top: 22px }
.cat-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--bronze-ink); margin-bottom: 12px
}

.cat-brands { display: grid; gap: 7px }
.cat-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; transition: border-color .2s, background .2s
}
.cat-check:hover { border-color: var(--gold) }
.cat-check input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; flex-shrink: 0; margin: 0;
  border: 1px solid var(--line); border-radius: 5px; background: var(--paper);
  cursor: pointer; position: relative; transition: background .2s, border-color .2s
}
.cat-check input:checked { background: var(--espresso); border-color: var(--espresso) }
.cat-check input:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg)
}
.cat-check:has(input:checked) { border-color: var(--gold); background: var(--paper) }

.cat-price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.cat-price label { display: grid; gap: 6px }
.cat-price span { font-size: 12px; color: var(--ink-soft) }
.cat-price input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  padding: 10px 12px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .2s
}
.cat-price input:focus { border-color: var(--gold) }

.cat-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px }
.filter-pill {
  border: 1px solid var(--line); border-radius: 100px; background: var(--paper);
  padding: 10px 6px; font: inherit; font-size: 12.5px; line-height: 1; color: var(--ink-soft);
  cursor: pointer; transition: border-color .2s, background .2s, color .2s
}
.filter-pill:hover { border-color: var(--gold) }
.filter-pill.is-active { background: var(--espresso); border-color: var(--espresso); color: var(--cream) }

.cat-note { margin-top: 24px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft) }
.cat-ask { display: block; width: 100%; margin-top: 14px; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px; text-align: center }

/* ================= CARD GRID ================= */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px }
@media(max-width:1180px) { .cat-grid { grid-template-columns: repeat(2, 1fr) } }
@media(max-width:520px) { .cat-grid { grid-template-columns: 1fr } }

.catalog-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--paper);
  /* js/catalog.js reveals each card by adding .is-visible */
  opacity: 0; transform: translateY(14px);
  transition: opacity .45s var(--ease), transform .45s var(--ease), border-color .3s, box-shadow .3s
}
.catalog-card.is-visible { opacity: 1; transform: none }
.catalog-card:hover { border-color: var(--gold); box-shadow: 0 24px 48px rgba(var(--ink-rgb), .09) }

.cc-img { position: relative; height: 220px; background: white; padding: 18px; overflow: hidden }
.cc-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease) }
.catalog-card:hover .cc-img img { transform: scale(1.05) }
.cc-type {
  position: absolute; left: 14px; top: 14px; font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line); border-radius: 100px; padding: 5px 11px
}

.cc-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1 }
.cc-brand {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--bronze-ink); transition: color .2s
}
.cc-brand:hover { color: var(--gold) }
.cc-body h3 { font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 21px; line-height: 1.15; margin: 8px 0 0 }
.cc-price {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--gold-ink);
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line)
}
.cc-cta {
  margin-top: 16px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink); text-align: left;
  display: inline-flex; align-items: center; gap: 8px
}
.cc-cta i { font-style: normal; color: var(--gold-ink); transition: transform .3s var(--ease) }
.cc-cta:hover i { transform: translateX(5px) }

/* ================= CONTACT MODAL ================= */
.cat-modal {
  position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center;
  padding: 20px
}
/* js/catalog.js swaps the Tailwind-era `hidden`/`flex` classes */
.cat-modal.flex { display: flex }
.cat-modal.hidden { display: none }
.cat-modal-overlay { position: absolute; inset: 0; background: rgba(var(--espresso-rgb), .55); backdrop-filter: blur(3px) }
.cat-modal-box {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper);
  padding: 30px 30px 26px; box-shadow: 0 40px 90px rgba(var(--ink-rgb), .28)
}
.cat-modal-box h2 { font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 27px; line-height: 1.1; margin: 10px 0 12px }
.cat-modal-box p { color: var(--ink-soft); font-size: 14px; line-height: 1.6 }
.cat-modal-btns { display: grid; gap: 9px; margin-top: 22px }
.cat-modal-btns > * { text-align: center }
.cat-modal-close {
  position: absolute; right: 18px; top: 18px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--ink-soft); transition: .2s
}
.cat-modal-close:hover { border-color: var(--gold); color: var(--gold) }

/* js/catalog.js locks the page behind the modal with this Tailwind-era class;
   the theme no longer loads Tailwind, so the rule has to live here. */
body.overflow-hidden { overflow: hidden }

@media(max-width:900px) {
  .cat-filters { padding: 22px 20px }
  .cat-reset { padding: 12px 0 }
  .cat-check { padding: 12px 14px }
  .cat-price input { padding: 12px 14px }
  .filter-pill { padding: 13px 6px }
  .cat-brands { grid-template-columns: 1fr 1fr; gap: 8px }
  .cc-img { height: 200px }
  /* the card's primary action - it was an 18px tall text button */
  .cc-cta { padding: 12px 0; margin-top: 12px }
  .cc-brand { display: inline-block; padding: 4px 0 }
  .cat-modal-box { padding: 26px 22px 22px }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card { transition: none !important; opacity: 1; transform: none }
  .cc-img img, .cc-cta i { transition: none !important }
}
