/* NXSTUDIO shop catalog — homepage-style4a-catalog-sidebar, scoped to the shop/category pages.
   Loaded inline by archive-product.php. Reuses the header from header.php and the
   mockup's .btn primitives are not needed here. Mirrors mockups/homepage-style4a-catalog-sidebar.html. */

/* Eliminate WordPress block/theme top spacing on shop/catalog pages */
body.post-type-archive-product #wrapper,
body.woocommerce-shop #wrapper,
body.tax-product_cat #wrapper {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.post-type-archive-product #inner-wrap,
body.woocommerce-shop #inner-wrap,
body.tax-product_cat #inner-wrap,
body.post-type-archive-product main.wrap,
body.woocommerce-shop main.wrap,
body.tax-product_cat main.wrap {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
  padding-top: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.nx-shop-4a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 16px;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  color: #000000;
  -webkit-font-smoothing: antialiased;
}

.nx-shop-4a a {
  text-decoration: none;
  color: inherit;
}

.nx-shop-4a .page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px 32px 72px;
}

.nx-shop-4a .catalog-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #171717;
  margin: 0 0 28px;
  line-height: 1.25 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.nx-shop-4a .catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.nx-shop-4a .filter-sidebar {
  position: sticky;
  top: 88px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 20px;
  background: #ffffff;
}

.nx-shop-4a .filter-sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.nx-shop-4a .filter-sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: #171717;
  letter-spacing: -0.01em;
}

.nx-shop-4a .filter-sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #737373;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.nx-shop-4a .filter-sidebar-close:hover {
  color: #171717;
}

.nx-shop-4a .filter-backdrop {
  display: none;
}

.nx-shop-4a .filter-toggle-btn {
  display: none;
}

.nx-shop-4a .filter-section {
  margin-bottom: 24px;
}
.nx-shop-4a .filter-section:last-child {
  margin-bottom: 0;
}

.nx-shop-4a .filter-section h2 {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace !important;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a3a3a3;
  margin-bottom: 10px;
  line-height: 1.6;
}

.nx-shop-4a .filter-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nx-shop-4a .filter-section .nx-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  min-height: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: Arial !important;
  font-size: 13.5px;
  font-weight: 500;
  line-height: normal;
  color: #737373;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  text-align: left;
  text-decoration: none;
}

.nx-shop-4a .filter-section .nx-cat:hover {
  background: #fafafa;
  color: #000000;
}

.nx-shop-4a .filter-section .nx-cat.is-active {
  background: #eff6ff;
  color: #0070f3;
  font-weight: 600;
}

.nx-shop-4a .filter-section .nx-cat .ct {
  margin-left: auto;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 11px;
  line-height: normal;
  color: #a3a3a3;
}

.nx-shop-4a .filter-section .nx-cat .arrow {
  color: #a3a3a3;
  font-size: 14px;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}

.nx-shop-4a .filter-section .nx-cat.is-active .arrow {
  transform: translateX(2px);
  color: #0070f3;
}

.nx-shop-4a .cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fafafa;
  color: #737373;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nx-shop-4a .filter-section .nx-cat.is-active .cat-icon {
  background: #eff6ff;
  color: #0070f3;
}

.nx-shop-4a .filter-section label {
  display: block;
  padding: 5px 0;
  font-size: 13px;
  color: #737373;
  cursor: pointer;
  font-family: inherit;
}

.nx-shop-4a .filter-section label input {
  margin-right: 8px;
  accent-color: #0070f3;
  width: auto;
  min-height: 0;
}

.nx-shop-4a .nx-show-all {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #0070f3;
  background: #ffffff;
  border-radius: 6px;
  font-family: Arial !important;
  font-size: 12.5px;
  font-weight: 600;
  line-height: normal;
  color: #0070f3;
  text-align: center;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  min-height: 0;
}

.nx-shop-4a .nx-show-all:hover {
  border-color: #0070f3;
  color: #0070f3;
  background: #ffffff;
}

.nx-shop-4a .nx-show-all.is-active {
  border-color: #0070f3;
  color: #0070f3;
  background: #ffffff;
}

.nx-shop-4a .price-range {
  display: flex;
  justify-content: space-between;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  color: #737373;
  margin-bottom: 8px;
}

.nx-shop-4a .filter-section input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 0 0 6px;
  padding: 0;
  min-height: 0;
  accent-color: #0070f3;
  appearance: auto;
  -webkit-appearance: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.nx-shop-4a .results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.nx-shop-4a .results-toolbar p {
  font-size: 13px;
  color: #a3a3a3;
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nx-shop-4a .results-toolbar p b {
  color: #171717;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 14px;
}

.nx-shop-4a .sort-select {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #ffffff;
  color: #171717;
  outline: none;
  cursor: pointer;
  min-height: 0;
  height: 35px;
  line-height: 1.4;
  box-sizing: border-box;
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  appearance: auto;
  -webkit-appearance: auto;
}

.nx-shop-4a .sort-select:focus {
  border-color: #0070f3;
}

.nx-shop-4a .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.nx-shop-4a .card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}

.nx-shop-4a .card:hover {
  border-color: #0070f3;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.nx-shop-4a .card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
}

.nx-shop-4a .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}

.nx-shop-4a .card:hover .card-media img {
  transform: scale(1.04);
}

.nx-shop-4a .card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid rgba(22,163,74,.15);
  z-index: 2;
  line-height: 1.6;
}

.nx-shop-4a .card-sale {
  right: 10px;
  left: auto;
  color: #ffffff;
  background: #0070f3;
  border-color: #0070f3;
}

.nx-shop-4a .card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nx-shop-4a .card-cat {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 10px;
  color: #a3a3a3;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.6;
}

.nx-shop-4a .card-name {
  font-size: 14px;
  font-weight: 600;
  color: #171717;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.nx-shop-4a .card-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #171717;
  line-height: 1.6;
}

.nx-shop-4a .card-price .from {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 11px;
  color: #a3a3a3;
  font-weight: 500;
}

.nx-shop-4a .card-price .old {
  font-size: 12px;
  color: #a3a3a3;
  font-weight: 500;
  text-decoration: line-through;
  margin-left: 6px;
}

.nx-shop-4a .nx-shop-empty {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  color: #a3a3a3;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .nx-shop-4a .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .nx-shop-4a .catalog-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Show the filter button in the products toolbar */
  .nx-shop-4a .filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #171717;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nx-shop-4a .filter-toggle-btn:hover {
    background: #f5f5f5;
    border-color: #d4d4d4;
  }

  .nx-shop-4a .filter-toggle-btn svg {
    color: #0070f3;
  }

  /* Transform filter-sidebar into slide-out drawer */
  .nx-shop-4a .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    z-index: 1200;
    background: #ffffff;
    border: none;
    border-right: 1px solid #e5e5e5;
    border-radius: 0;
    padding: 24px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    display: block;
  }

  .nx-shop-4a .filter-sidebar.is-open {
    transform: translateX(0);
  }

  .nx-shop-4a .filter-sidebar-header {
    display: flex;
  }

  /* Backdrop dark overlay */
  .nx-shop-4a .filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .nx-shop-4a .filter-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  body.nx-drawer-locked {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .nx-shop-4a .page { padding: 32px 16px 48px; }
  .nx-shop-4a .catalog-title {
    font-size: 22px;
    margin-bottom: 20px;
  }
  .nx-shop-4a .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}