/* ============================================================
   Catalog page — catalog.css
   Author: Temlines — templines.com
   ============================================================ */

/* ============================================================
   Hero
   ============================================================ */
.cat-hero {
  position: relative;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(ellipse 60% 80% at 85% 50%, rgba(201, 236, 102, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(80, 110, 255, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,255,255,0.04) 0%, transparent 55%),
    linear-gradient(180deg, #0c1020 0%, var(--gx-darker) 70%);
  overflow: hidden;
  isolation: isolate;
}

/* Grid + dot pattern overlay with soft mask */
.cat-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(201, 236, 102, 0.06) 1px, transparent 1.5px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 24px 24px, 60px 60px, 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
  z-index: -1;
  animation: catGridDrift 24s linear infinite;
}

/* Drifting lime orb top-right */
.cat-hero::after {
  content: '';
  position: absolute;
  width: 34rem;
  height: 34rem;
  right: -8rem;
  top: -8rem;
  background: radial-gradient(circle, rgba(201, 236, 102, 0.20) 0%, transparent 65%);
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
  animation: catGlowDrift 14s ease-in-out infinite alternate;
}

@keyframes catGridDrift {
  0%   { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 24px 24px, 60px 60px, 60px 60px; }
}
@keyframes catGlowDrift {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate(-3rem, 2rem) scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-hero::before,
  .cat-hero::after { animation: none; }
}

.cat-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4rem;
}

.cat-hero__text { flex: 1; }

.cat-hero__text .gx-label {
  color: var(--gx-lime);
  margin-bottom: 1.25rem;
}

.cat-hero__title {
  font-family: var(--gx-font-heading);
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 600;
  color: var(--gx-white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cat-hero__desc {
  max-width: 34rem;
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  line-height: 1.75;
}

.cat-hero__search {
  flex-shrink: 0;
  position: relative;
  width: 26rem;
  align-self: flex-end;
}

.cat-hero__search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(255,255,255,0.3);
}

.cat-hero__search-input {
  width: 100%;
  height: 3.25rem;
  padding: 0 1.25rem 0 3.25rem;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  font-family: var(--gx-font-body);
  font-size: 0.9375rem;
  color: var(--gx-white);
  outline: none;
  transition: border-color 0.25s, background 0.25s;
}

.cat-hero__search-input::placeholder { color: rgba(255,255,255,0.28); }

.cat-hero__search-input:focus {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.09);
}

/* ============================================================
   Layout: results + sidebar
   ============================================================ */
.cat-body {
  padding: 3.5rem 0 5rem;
}

.cat-layout {
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: 3rem;
  align-items: start;
}

/* ============================================================
   Toolbar (sort + count + active tags)
   ============================================================ */
.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.cat-toolbar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cat-count {
  font-family: var(--gx-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gx-g100);
  white-space: nowrap;
}

/* Active filter tags */
.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  background: var(--gx-off-white);
  border: 1px solid rgba(31,31,30,0.1);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gx-g500);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.cat-tag:hover { background: #e8e8e5; }

.cat-tag__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  color: var(--gx-g100);
  transition: color 0.2s;
}

.cat-tag:hover .cat-tag__remove { color: var(--gx-g500); }

/* Sort */
.cat-toolbar__right { display: flex; align-items: center; }

.cat-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.cat-sort-wrap__label {
  font-size: 0.875rem;
  color: var(--gx-g100);
  white-space: nowrap;
}

.cat-sort.gx-select {
  min-width: 13rem;
  height: 2.75rem;
}

/* ============================================================
   Car grid
   ============================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ============================================================
   Car card
   ============================================================ */
.cat-card {
  background: var(--gx-white);
  border: 1px solid rgba(31,31,30,0.08);
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}

.cat-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}

.cat-card--hidden {
  display: none;
}

/* Image wrap */
.cat-card__img-wrap {
  position: relative;
  background: var(--gx-off-white);
  overflow: hidden;
}

.cat-card__img {
  display: block;
  width: 100%;
  height: 14rem;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}

.cat-card:hover .cat-card__img { transform: scale(1.04); }

/* Badge */
.cat-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3125rem 0.75rem;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  font-family: var(--gx-font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gx-g500);
}

.cat-card__badge--accent {
  background: var(--gx-lime);
  color: var(--gx-dark);
}

/* Save / wishlist */
.cat-card__save {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--gx-g100);
  transition: color 0.2s, background 0.2s;
}

.cat-card__save:hover { color: #DC2626; background: var(--gx-white); }
.cat-card__save--saved { color: #DC2626; }
.cat-card__save--saved svg { fill: #DC2626; }

/* Body */
.cat-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.cat-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.cat-card__name {
  font-family: var(--gx-font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gx-g500);
  letter-spacing: -0.01em;
}

.cat-card__price {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 5rem;
}

.cat-card__price-from {
  font-family: var(--gx-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gx-g100);
}

.cat-card__price-val {
  font-family: var(--gx-font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gx-g500);
}

/* Specs list */
.cat-card__specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cat-card__specs li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--gx-g100);
  white-space: nowrap;
}

.cat-card__specs li svg { flex-shrink: 0; color: var(--gx-g200); }

/* Actions */
.cat-card__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    justify-content: space-between;
}

.cat-card__btn {
    flex: 1;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0 0.75rem;
    height: 2.75rem;
}

.cat-card__btn--light {
    color: var(--gx-g500);
    border-color: rgba(31, 31, 30, 0.15);
    background: transparent;
    min-width: 50%;
}

.cat-card__btn--light:hover {
  background: var(--gx-g500);
  border-color: var(--gx-g500);
  color: var(--gx-white);
}

/* ============================================================
   Empty state
   ============================================================ */
.cat-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 5rem 2rem;
  text-align: center;
}

.cat-empty svg { color: rgba(31,31,30,0.15); }

.cat-empty__title {
  font-family: var(--gx-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gx-g200);
}

/* ============================================================
   Filter sidebar
   ============================================================ */
.cat-sidebar {
  background: var(--gx-white);
  border: 1px solid rgba(31,31,30,0.08);
  border-radius: 1.5rem;
  overflow: hidden;
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.cat-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.375rem 1.5rem;
  border-bottom: 1px solid rgba(31,31,30,0.08);
}

.cat-sidebar__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--gx-font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gx-g500);
}

.cat-sidebar__reset {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gx-g100);
  transition: color 0.2s;
}

.cat-sidebar__reset:hover { color: var(--gx-g500); }

/* ============================================================
   Filter group (accordion)
   ============================================================ */
.cat-filter-group {
  border-bottom: 1px solid rgba(31,31,30,0.08);
}

.cat-filter-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gx-g500);
  text-align: left;
  transition: color 0.2s;
}

.cat-filter-group__toggle svg {
  flex-shrink: 0;
  transition: transform 0.25s;
  color: var(--gx-g100);
}

.cat-filter-group__toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }

.cat-filter-group__body {
  padding: 0 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.cat-filter-group__body--hidden {
  display: none;
}

/* ============================================================
   Filter option (checkbox)
   ============================================================ */
.cat-filter-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--gx-g500);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.cat-filter-option:hover { color: var(--gx-g500); }

/* Hide native checkbox */
.cat-checkbox { display: none; }

/* Custom checkbox */
.cat-filter-option .cat-checkbox + * {
  display: inline-flex;
  align-items: center;
}

/* Replace checkbox visuals via label pseudo-element trick */
.cat-filter-option {
  position: relative;
}

.cat-filter-option input[type="checkbox"] {
  display: none;
}

.cat-filter-option::before {
  content: '';
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid rgba(31,31,30,0.2);
  border-radius: 0.3125rem;
  background: var(--gx-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  order: -1;
  margin-right: 0;
}

.cat-filter-option:has(input:checked)::before {
  background: var(--gx-g500);
  border-color: var(--gx-g500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpolyline points='1.5,5 4.5,8 10.5,2' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}

.cat-filter-option__count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gx-g75);
  font-family: var(--gx-font-mono);
}

/* ============================================================
   Color swatches
   ============================================================ */
.cat-filter-group__body--colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  padding-bottom: 1.25rem;
}

.cat-color-swatch {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--gx-g500);
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0.625rem;
  border: 1.5px solid rgba(31,31,30,0.08);
  border-radius: 0.625rem;
  transition: border-color 0.2s, background 0.2s;
}

.cat-color-swatch:hover { border-color: rgba(31,31,30,0.2); }

.cat-color-swatch:has(input:checked) {
  border-color: var(--gx-g500);
  background: rgba(31,31,30,0.03);
}

.cat-color-swatch input { display: none; }

.cat-color-swatch__dot {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Apply button (mobile only) */
.cat-sidebar__apply { display: none; }

/* ============================================================
   Mobile filter FAB
   ============================================================ */
.cat-filter-fab {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--gx-g500);
  color: var(--gx-white);
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 50;
  transition: background 0.2s, transform 0.2s;
}

.cat-filter-fab:hover { background: var(--gx-g200); }

/* Sidebar overlay on mobile */
.cat-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.cat-sidebar-overlay--visible { display: block; }

/* ============================================================
   Animated card reveal
   ============================================================ */
@keyframes cat-card-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cat-card--visible {
  animation: cat-card-in 0.38s cubic-bezier(0.22,1,0.36,1) both;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .cat-layout { grid-template-columns: 1fr 19rem; gap: 2rem; }
}

@media (max-width: 1024px) {
  .cat-layout { grid-template-columns: 1fr; }

  .cat-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(22rem, 90vw);
    height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
    z-index: 100;
    transition: right 0.35s cubic-bezier(0.22,1,0.36,1);
    box-shadow: -12px 0 40px rgba(0,0,0,0.15);
  }

  .cat-sidebar--open { right: 0; }

  .cat-sidebar__apply { display: flex; justify-content: center; margin: 1.5rem; }

  .cat-filter-fab { display: flex; }
  .cat-hero__inner { flex-direction: column; align-items: flex-start; }
  .cat-hero__search { width: 100%; }
}

@media (max-width: 640px) {
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card__img { height: 13rem; }
  .cat-hero { padding: 3.5rem 0 3rem; }
  .cat-toolbar { flex-direction: column; align-items: flex-start; }
}
