/*
 * [nx_product_row] (inc/product-rows.php, assets/js/product-row.js): a heading with "View all",
 * then a category's product cards (Shoptimizer's own cards) in one row that scrolls sideways, with
 * an arrow at each end (inside the screen below 993 px).
 */
.nx-row { position: relative; margin: 30px 0; }
.nx-row__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 0 0 16px; padding: 0 2px;
}
.nx-row__title { margin: 0; } /* The theme's own h2 type. */
.nx-row__all { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nx-row__all:hover { text-decoration: underline; }
.nx-row__stage { position: relative; }

/* The arrows: bare circles that fill black on hover (as the brand strip's). */
.nx-row__stage .nx-row__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  padding: 0; border: 0; background: transparent; color: #333;
  font-size: 20px; line-height: 38px; text-align: center;
  cursor: pointer; z-index: 7; /* Under the sticky navigation bar. */
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.nx-row__stage .nx-row__prev { left: -20px; }
.nx-row__stage .nx-row__next { right: -20px; }
.nx-row__stage .nx-row__arrow[disabled] { opacity: .3; cursor: default; }
.nx-row__stage.nx-row--still .nx-row__arrow { display: none; }
@media (min-width: 1024px) {
  .nx-row__stage .nx-row__arrow:hover { background: #000; color: #fff; }
}

.nx-row ul.products {
  display: flex !important;
  grid-template-columns: initial !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  gap: 0 !important;
  margin: 0 0 1.5em !important;
  padding: 5px 4px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.2) transparent;
}
.nx-row ul.products::-webkit-scrollbar { height: 8px; }
.nx-row ul.products::-webkit-scrollbar-track { background: transparent; }
.nx-row ul.products::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

/* !important: Shoptimizer's grid sets each card's width with its own !important rules. */
.nx-row ul.products > li.product {
  flex: 0 0 230px !important;
  min-width: 230px !important;
  max-width: 230px !important;
  width: auto !important;
  scroll-snap-align: start;
  margin: 0 !important;
  padding: 0 15px !important;
  float: none;
}
/* Room between the price and Add to cart in a row this narrow. */
@media (min-width: 993px) {
  .nx-row ul.products li.product .price { margin-bottom: 3.35rem; }
}
@media (max-width: 992px) {
  .nx-row ul.products > li.product { flex: 0 0 280px !important; min-width: 280px !important; max-width: 280px !important; }
  .nx-row__stage .nx-row__arrow { width: 34px; height: 34px; font-size: 18px; line-height: 32px; }
  .nx-row__stage .nx-row__prev { left: 2px; }
  .nx-row__stage .nx-row__next { right: 2px; }
}
@media (max-width: 560px) {
  .nx-row ul.products > li.product { flex: 0 0 80vw !important; min-width: 80vw !important; max-width: 80vw !important; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-row ul.products { scroll-snap-type: none; }
}
