/* ─────────────────────────────────────────────────────────────────────
   NEXTON — Shop / Collection page (Figma 34:1220)
   Sidebar (285px) · Categories / Price range / Sort order
   + 3-up product grid + numbered pagination.
   ───────────────────────────────────────────────────────────────────── */

.nx-shop { padding: var(--space-6) 0 var(--space-10); }

/* ── Bold amber page header ─────────────────────────────────────────── */
.nx-shop__header { margin-bottom: var(--space-7); }
.nx-shop__crumb {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text-muted); margin-bottom: var(--space-3);
}
.nx-shop__crumb a:hover { color: var(--color-accent); }
.nx-shop__crumb-sep { color: var(--color-text-soft); }
.nx-shop__crumb-current { color: var(--color-text); }
.nx-shop__title {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 40px);
}
.nx-shop__count {
  margin: var(--space-3) 0 0;
  font-size: var(--text-md); font-weight: 600;
  color: var(--color-text-muted);
}

.nx-shop__layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
}

/* ── Mobile filter trigger (hidden on desktop) ──────────────────────── */
.nx-shop__filter-trigger {
  display: none;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
}
.nx-shop__filter-trigger svg { width: 18px; height: 18px; }
.nx-shop__filter-trigger:hover { border-color: var(--color-text); }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.nx-filter {
  position: sticky;
  top: calc(var(--header-height, 100px) + 24px);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  /* Bound the sidebar to the viewport and let the WHOLE filter scroll. */
  max-height: calc(100vh - var(--header-height, 100px) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.nx-filter::-webkit-scrollbar { width: 6px; }
.nx-filter::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 6px; }

/* Drawer header — desktop hidden, shown only in the mobile drawer. */
.nx-filter__top {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.nx-filter__top-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-text);
}
.nx-filter__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 0; background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.nx-filter__close svg { width: 22px; height: 22px; }

.nx-filter__form { display: flex; flex-direction: column; gap: var(--space-6); }

/* Each group separated by a hairline (40px bottom padding per Figma). */
.nx-filter__group {
  border: 0;
  margin: 0;
  padding: 0 0 var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.nx-filter__group--last { border-bottom: 0; padding-bottom: 0; }

.nx-filter__group-title {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;            /* Poppins Black — bold amber filter headings */
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--color-text);
}

/* ── Categories checklist ───────────────────────────────────────────── */
.nx-filter__checklist,
.nx-filter__radiolist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-left: var(--space-3);
}

.nx-check,
.nx-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 24px;
}
.nx-check input,
.nx-radio input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* Checkbox box — 20px, 4px radius, #94A3B8 border, accent fill checked. */
.nx-check__box {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1px solid #94A3B8;
  border-radius: 4px;
  background: var(--color-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.nx-check__box svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--transition); }
.nx-check input:checked ~ .nx-check__box {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.nx-check input:checked ~ .nx-check__box svg { opacity: 1; }
.nx-check input:focus-visible ~ .nx-check__box { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.nx-check__label,
.nx-radio__label {
  font-family: var(--font-body);
  font-size: var(--text-base);  /* 14px */
  line-height: 20px;
  color: var(--color-text-muted);
}
.nx-check input:checked ~ .nx-check__label,
.nx-radio input:checked ~ .nx-radio__label { color: var(--color-text); }

/* Radio dot — 20px circle, accent ring + dot when checked. */
.nx-radio__dot {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1px solid #94A3B8;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  position: relative;
  transition: border-color var(--transition);
}
.nx-radio input:checked ~ .nx-radio__dot { border-color: var(--color-accent); }
.nx-radio input:checked ~ .nx-radio__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}
.nx-radio input:focus-visible ~ .nx-radio__dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ── Price range slider ─────────────────────────────────────────────── */
.nx-price-slider {
  position: relative;
  height: 28px;
  margin: 0 var(--space-3) var(--space-5) var(--space-3);
  touch-action: none;
  cursor: pointer;
}
.nx-price-slider__rail {
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 4px;
  border-radius: 6px;
  background: var(--color-border);
}
.nx-price-slider__fill {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 4px;
  border-radius: 6px;
  background: var(--color-accent);
  left: var(--lo, 0%);
  width: var(--fill, 100%);
}
.nx-price-slider__thumb {
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  margin-left: -9px;
  transform: translateY(-50%);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
  z-index: 2;
}
.nx-price-slider__thumb:active { cursor: grabbing; }
.nx-price-slider__thumb--lo { left: var(--lo, 0%); }
.nx-price-slider__thumb--hi { left: var(--hi, 100%); }

/* ── Min / Max pill inputs ──────────────────────────────────────────── */
.nx-price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.nx-price-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.nx-price-field__cap {
  font-family: var(--font-body);
  font-size: var(--text-md);   /* 16px label per Figma */
  line-height: 24px;
  color: var(--color-text-muted);
}
.nx-price-field__pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  background: var(--color-bg);
  transition: border-color var(--transition);
}
.nx-price-field__pill:focus-within { border-color: var(--color-accent); }
.nx-price-field__pill input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
}
.nx-price-field__pill input:focus { outline: none; }
/* Strip native number spinners */
.nx-price-field__pill input::-webkit-outer-spin-button,
.nx-price-field__pill input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nx-price-field__pill input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.nx-price-field__suffix {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
}

.nx-filter__submit { margin-top: var(--space-4); }

/* ── Products column ────────────────────────────────────────────────── */
.nx-shop__products { min-width: 0; }

/* Pagination aligns bottom-right (Figma). Extends .nx-pagination from
   common.css with prev/next + ellipsis + active styling. */
.nx-shop__products .nx-pagination { justify-content: flex-end; }
.nx-pagination__nav {
  border: 1px solid transparent;
}
.nx-pagination__nav svg { width: 16px; height: 16px; }
.nx-pagination__nav.is-disabled { opacity: 0.35; pointer-events: none; }
.nx-pagination__ellipsis {
  min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-text-soft);
}
.nx-pagination a { color: var(--color-text-muted); }
.nx-pagination a:hover { color: var(--color-text); }

/* ── Empty state ────────────────────────────────────────────────────── */
.nx-shop__empty {
  display: grid;
  gap: var(--space-5);
  place-items: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.nx-shop__empty-text {
  margin: 0;
  font-size: var(--text-md);
  color: var(--color-text-muted);
}

/* ── Tablet ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nx-shop__layout { grid-template-columns: 1fr; }
  .nx-shop__filter-trigger { display: inline-flex; }

  /* Sidebar → slide-in drawer */
  .nx-filter {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 210;
    width: min(88vw, 360px);
    max-height: none;
    background: var(--color-bg);
    padding: var(--space-5);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 360ms var(--ease);
    box-shadow: 0 0 80px rgba(0,0,0,0.18);
    gap: var(--space-5);
  }
  .nx-filter--open { transform: translateX(0); }
  .nx-filter__top { display: flex; }

  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 205;
    background: var(--color-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms var(--ease);
  }
  body.has-filter-open .filter-backdrop { opacity: 1; pointer-events: auto; }
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .nx-shop__products .nx-pagination { justify-content: center; }
}

/* Desktop default: drawer scrim hidden. */
.filter-backdrop { display: none; }
@media (max-width: 900px) { .filter-backdrop { display: block; } }
