/* ═══════════════════════════════════════════════════════════════
   catalog.css — impre.mx Design System
   Consumes tokens from root.css · Light theme · March 2026
   ═══════════════════════════════════════════════════════════════ */

/* ── Shop wrapper ─────────────────────────────────────────────── */

.bn-shop {
  --bn-bg:           var(--color-bg);
  --bn-surface:      var(--color-surface);
  --bn-border:       var(--color-border);
  --bn-text:         var(--color-text);
  --bn-muted:        var(--color-muted);
  --bn-accent:       var(--color-accent);
  --bn-accent-hover: var(--color-accent-hover);
  --bn-sidebar-width: 300px;
  --bn-header-h: 64px;

  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;

  background-color: var(--bn-bg);
  color: var(--bn-text);
  font-family: var(--font-body);
  box-sizing: border-box;
}

.bn-shop *,
.bn-shop *::before,
.bn-shop *::after { box-sizing: border-box; }

body.is-filters-open { overflow: hidden; }


/* ── Layout ───────────────────────────────────────────────────── */

.bn-shop__layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}


/* ── Filters drawer (mobile) ──────────────────────────────────── */

.bn-filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 27, 0.40);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1100;
}

.bn-filters-drawer {
  position: fixed;
  top: var(--bn-header-h);
  left: 0;
  height: calc(100vh - var(--bn-header-h));
  width: min(88vw, 340px);
  transform: translateX(-110%);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
  z-index: 1200;
  will-change: transform;
  display: flex;
}

body.is-filters-open .bn-filters-drawer { transform: translateX(0); }


/* ── Sidebar ──────────────────────────────────────────────────── */

.bn-shop__sidebar {
  width: 100%;
  background-color: var(--bn-surface);
  padding: 2rem;
  border-right: 1px solid var(--bn-border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  scrollbar-width: none;
}

.bn-shop__sidebar::-webkit-scrollbar { display: none; }


/* ── Title ────────────────────────────────────────────────────── */

.bn-shop__title {
  font-family: var(--font-title);
  font-weight: var(--font-weight-900);
  font-size: 2rem;
  margin: 0;
  color: var(--bn-text);
  letter-spacing: -.02em;
}

.bn-shop__status {
  color: var(--bn-accent);
  font-size: .9rem;
  margin-top: .5rem;
}

.bn-shop__status-strong {
  font-weight: var(--font-weight-600);
  color: var(--bn-text);
}


/* ── Category nav ─────────────────────────────────────────────── */

.bn-shop__nav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.bn-shop__nav-title {
  font-weight: var(--font-weight-600);
  text-transform: uppercase;
  font-size: .85rem;
  color: var(--bn-muted);
  letter-spacing: .05em;
}

.bn-shop__clear {
  font-size: .8rem;
  color: var(--bn-muted);
  text-decoration: none;
}

.bn-shop__clear:hover { color: var(--bn-accent); }

.bn-shop__list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.bn-shop__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  margin-left: -1rem;
  border-radius: var(--radius-btn);
  color: var(--bn-muted);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  transition: background .2s, color .2s, transform .08s;
}

.bn-shop__link:hover {
  color: var(--bn-text);
  background: rgba(26, 26, 27, 0.04);
  text-decoration: none !important;
}

.bn-shop__link:active { transform: scale(.99); }

.bn-shop__link.is-active {
  color: var(--bn-accent);
  background: rgba(114, 150, 212, 0.10);
  font-weight: var(--font-weight-600);
}

.bn-shop__link-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bn-shop__badge {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: var(--font-weight-600);
  padding: .2rem .55rem;
  border-radius: var(--radius-pill);
  background: rgba(26, 26, 27, 0.05);
  border: 1px solid rgba(26, 26, 27, 0.08);
  color: var(--bn-muted);
}

.bn-shop__link.is-active .bn-shop__badge {
  background: rgba(114, 150, 212, 0.12);
  border-color: rgba(114, 150, 212, 0.25);
  color: var(--bn-accent);
}


/* ── Nav groups ───────────────────────────────────────────────── */

.bn-shop__nav-group {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bn-border);
}

.bn-shop__nav-group-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--bn-muted);
  letter-spacing: .12em;
  margin: 0 0 .75rem;
}


/* ── Main content area ────────────────────────────────────────── */

.bn-shop__main {
  flex-grow: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}


/* ── Mobile tools ─────────────────────────────────────────────── */

.bn-shop__mobile-tools {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1rem;
  display: flex;
  justify-content: flex-start;
  position: relative;
  z-index: 1400;
  pointer-events: auto;
}

.bn-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--bn-border);
  background: var(--bn-surface);
  color: var(--bn-text);
  font-weight: var(--font-weight-600);
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .08s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1401;
  pointer-events: auto;
}

.bn-filters-toggle:hover {
  background: var(--color-cloud);
  border-color: rgba(26, 26, 27, 0.18);
}

.bn-filters-toggle:active { transform: scale(.99); }

.bn-filters-toggle:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--bn-accent);
}

.bn-filters-toggle__icon { color: var(--bn-muted); }
.bn-filters-toggle__text { font-size: .95rem; }


/* ── Search ───────────────────────────────────────────────────── */

.bn-search-container {
  margin-bottom: 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.bn-search-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.bn-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.bn-search-input {
  width: 100%;
  padding: 1rem 3.25rem 1rem 3rem;
  background: var(--bn-surface);
  border: 1px solid var(--bn-border);
  border-radius: var(--radius-card);
  color: var(--bn-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: background .3s, border-color .3s, box-shadow .3s;
  outline: none;
}

.bn-search-input:focus {
  border-color: var(--bn-accent);
  background: #fff;
  box-shadow: var(--focus-ring);
}

.bn-search-input::placeholder { color: var(--bn-muted); }

.bn-search-icon {
  position: absolute;
  left: 1rem;
  color: var(--bn-muted);
  pointer-events: none;
}

.bn-search-clear {
  position: absolute;
  right: .6rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--bn-muted);
  font-size: 1.5rem;
  line-height: 1;
  transition: background .2s, color .2s, transform .08s;
}

.bn-search-clear:hover {
  background: rgba(26, 26, 27, 0.06);
  color: var(--bn-text);
}

.bn-search-clear:active { transform: scale(.96); }


/* ── Live search chip ─────────────────────────────────────────── */

.bn-live-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  padding: .45rem .75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--bn-border);
  background: rgba(26, 26, 27, 0.03);
  color: var(--bn-muted);
  font-size: .85rem;
  letter-spacing: .01em;
}

.bn-live-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(26, 26, 27, 0.18);
}


/* ── Top bar ──────────────────────────────────────────────────── */

.bn-shop__top-bar {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto 2rem;
  color: var(--bn-muted);
  font-size: .9rem;
}

.bn-shop__count strong { color: var(--bn-text); }


/* ── Product grid ─────────────────────────────────────────────── */

.bn-shop__grid {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  position: relative;
  min-width: 0;
}


/* ── Loading state ────────────────────────────────────────────── */

.bn-shop__main[aria-busy="true"] .bn-shop__grid,
.bn-shop__main[aria-busy="true"] .bn-pagination {
  opacity: .55;
  filter: saturate(.9) blur(.2px);
  pointer-events: none;
  transition: opacity 180ms ease, filter 180ms ease;
}

.bn-shop__main[aria-busy="true"] .bn-live-chip {
  color: var(--bn-accent);
  border-color: rgba(114, 150, 212, 0.30);
  background: rgba(114, 150, 212, 0.06);
}

.bn-shop__main[aria-busy="true"] .bn-live-chip__dot {
  background: var(--bn-accent);
  box-shadow: 0 0 0 6px rgba(114, 150, 212, 0.12);
  animation: bnPulse 1s ease-in-out infinite;
}

@keyframes bnPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .75; }
}

.bn-shop__main[aria-busy="true"] .bn-shop__grid::before {
  content: "";
  position: absolute;
  inset: -.5rem;
  border-radius: var(--radius-card);
  background: linear-gradient(
    90deg,
    rgba(114, 150, 212, 0.03) 0%,
    rgba(114, 150, 212, 0.08) 45%,
    rgba(114, 150, 212, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: bnShimmer 1.1s linear infinite;
  pointer-events: none;
  opacity: .55;
}

@keyframes bnShimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}


/* ── Product card ─────────────────────────────────────────────── */

.bn-card {
  background: var(--bn-surface);
  border: 1px solid var(--bn-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.25, .8, .25, 1), border-color .3s, box-shadow .3s;
  position: relative;
  box-shadow: var(--shadow-card);
}

.bn-card:hover {
  transform: translateY(-5px);
  border-color: var(--bn-accent);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none !important;
}

.bn-card__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-cloud);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--bn-border);
}

.bn-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .4s ease;
}

.bn-card__placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  background: rgba(26, 26, 27, 0.03);
  border: 1px solid var(--bn-border);
}

.bn-card:hover .bn-card__img { transform: scale(1.05); }

.bn-card__info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: .5rem;
}

.bn-card__title {
  font-family: var(--font-body);
  font-weight: var(--font-weight-600);
  font-size: 1rem;
  color: var(--bn-text);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bn-card__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
}

.bn-card__price {
  color: var(--bn-accent);
  font-weight: 700;
  font-size: 1.1rem;
}

.bn-card__cta {
  font-size: .8rem;
  text-transform: uppercase;
  font-weight: var(--font-weight-600);
  color: var(--bn-muted);
  letter-spacing: .03em;
}

.bn-card:hover .bn-card__cta {
  color: var(--bn-accent);
  text-decoration: underline;
}


/* ── Empty state ──────────────────────────────────────────────── */

.bn-shop__empty {
  width: 100%;
  max-width: 720px;
  margin: 2rem auto 0;
  border: 1px solid var(--bn-border);
  border-radius: var(--radius-card);
  background: var(--bn-surface);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.bn-shop__empty-title {
  font-family: var(--font-title);
  font-weight: var(--font-weight-900);
  margin: 0 0 .5rem;
  font-size: 1.6rem;
  letter-spacing: -.02em;
  color: var(--bn-text);
}

.bn-shop__empty-text {
  margin: 0 0 1.25rem;
  color: var(--bn-muted);
  line-height: 1.55;
  font-size: 1rem;
}

.bn-shop__empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.1rem;
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: var(--font-weight-600);
  letter-spacing: .02em;
  background: var(--bn-accent);
  border: none;
  color: #fff;
  box-shadow: var(--shadow-cta);
  transition: transform 180ms ease, background 180ms ease;
}

.bn-shop__empty-cta:hover {
  transform: translateY(-2px);
  background: var(--bn-accent-hover);
  color: #fff;
}


/* ── Pagination ───────────────────────────────────────────────── */

.bn-pagination {
  margin: 5rem auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--bn-surface);
  border: 1px solid var(--bn-border);
  padding: .5rem .75rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}

.bn-pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--bn-muted);
  transition: all .2s cubic-bezier(.2, .8, .2, 1);
  text-decoration: none;
  background: transparent;
}

.bn-pagination__btn:hover:not(.bn-pagination__btn--disabled) {
  background: rgba(26, 26, 27, 0.06);
  color: var(--bn-text);
  transform: scale(1.1);
}

.bn-pagination__btn--disabled {
  opacity: .2;
  cursor: default;
}

.bn-pagination__list {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: 0 .5rem;
  border-left: 1px solid var(--bn-border);
  border-right: 1px solid var(--bn-border);
}

.bn-pagination__link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  font-size: .95rem;
  font-weight: 500;
  color: var(--bn-text);
  text-decoration: none;
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}

.bn-pagination__link:hover:not(.is-active) {
  background: rgba(26, 26, 27, 0.06);
  color: var(--bn-text);
}

.bn-pagination__link.is-active {
  background: var(--bn-accent);
  color: #fff;
  font-weight: var(--font-weight-600);
  box-shadow: 0 4px 12px rgba(114, 150, 212, 0.35);
  transform: scale(1.05);
  cursor: default;
}

.bn-pagination__dots {
  color: var(--bn-muted);
  padding: 0 .25rem;
  font-size: .8rem;
  letter-spacing: 1px;
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  body.is-filters-open { overflow: auto; }

  .bn-shop__layout {
    flex-direction: row;
    align-items: stretch;
  }

  .bn-filters-drawer {
    position: relative;
    top: auto;
    left: auto;
    height: auto;
    width: var(--bn-sidebar-width);
    transform: none;
    transition: none;
    z-index: auto;
    display: block;
  }

  .bn-filters-backdrop { display: none !important; }

  .bn-shop__sidebar {
    width: var(--bn-sidebar-width);
    flex-shrink: 0;
    border-right: 1px solid var(--bn-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .bn-shop__main {
    padding: 3rem 4rem;
    min-width: 0;
    overflow: hidden;
  }

  .bn-shop__mobile-tools { display: none; }
}

@media (max-width: 640px) {
  .bn-shop__main { padding: 1.5rem; }

  .bn-search-form { max-width: 100%; }

  .bn-shop__grid {
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .bn-pagination {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
  }

  .bn-pagination__list { border: none; }

  .bn-pagination__link {
    width: 32px;
    height: 32px;
    font-size: .85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bn-filters-drawer,
  .bn-card,
  .bn-card__img,
  .bn-pagination__btn,
  .bn-shop__main[aria-busy="true"] .bn-shop__grid::before {
    transition: none !important;
    animation: none !important;
  }
}