/* Vasti Mega Menu - pagine /catalogo/ */
.vmm-listing-header { margin: 4px 0 22px }
.vmm-subnav-parent {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 13px; font-weight: 600; color: #c00000; text-decoration: none;
}
.vmm-subnav-parent:hover, .vmm-subnav-parent:focus { color: #c00000; text-decoration: underline }
.vmm-listing-title { margin: 0 0 6px }
.vmm-listing-desc { color: #66717c; margin: 0 0 14px; max-width: 70ch }

.vmm-subnav { margin-top: 14px }
.vmm-subnav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px }
.vmm-subnav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a949d }
.vmm-subnav-all {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #c00000;
}
.vmm-subnav-all:hover { text-decoration: underline }
.vmm-subnav-all[hidden] { display: none }
.vmm-subnav-all .vmm-all-close, .vmm-subnav.is-expanded .vmm-all-open { display: none }
.vmm-subnav.is-expanded .vmm-all-close { display: inline }

.vmm-rail { position: relative }
.vmm-rail-track { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0 }
.vmm-rail-track li { margin: 0 }
.vmm-rail-track a {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px;
  border: 1px solid #e3e7eb; border-radius: 999px; background: #fff;
  color: #2f3b45; font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  text-decoration: none; transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.vmm-rail-track a:hover { border-color: #e00000; color: #c00000; text-decoration: none }
.vmm-rail-track a.is-current { background: #e00000; border-color: #e00000; color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(224, 0, 0, .22) }
.vmm-chip-count { font-size: 11px; font-weight: 600; color: #8a949d; font-variant-numeric: tabular-nums }
.vmm-rail-track a.is-current .vmm-chip-count { color: rgba(255, 255, 255, .8) }
.vmm-rail-track a:focus-visible, .vmm-rail-btn:focus-visible, .vmm-subnav-all:focus-visible { outline: 3px solid #007da8; outline-offset: 2px }
.vmm-subnav button:focus:not(:focus-visible), .vmm-rail-track a:focus:not(:focus-visible) { outline: none; box-shadow: none }

/* con JavaScript: una riga scorrevole */
.vmm-subnav.is-rail .vmm-rail-track {
  flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
  padding: 2px 2px 8px; margin: 0 -2px; -webkit-overflow-scrolling: touch;
}
.vmm-subnav.is-rail .vmm-rail-track::-webkit-scrollbar { display: none }
.vmm-subnav.is-rail .vmm-rail::before, .vmm-subnav.is-rail .vmm-rail::after {
  content: ''; position: absolute; top: 0; bottom: 8px; width: 56px; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .2s;
}
.vmm-subnav.is-rail .vmm-rail::before { left: 0; background: linear-gradient(90deg, var(--vmm-bg, #fff), transparent) }
.vmm-subnav.is-rail .vmm-rail::after { right: 0; background: linear-gradient(270deg, var(--vmm-bg, #fff), transparent) }
.vmm-subnav.fade-start .vmm-rail::before, .vmm-subnav.fade-end .vmm-rail::after { opacity: 1 }
.vmm-rail-btn {
  position: absolute; top: 1px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid #e3e7eb; background: #fff; color: #2f3b45;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .12); transition: color .15s, border-color .15s;
}
.vmm-rail-btn:hover { color: #c00000; border-color: #e00000 }
.vmm-rail-btn[hidden] { display: none }
.vmm-rail-prev { left: -6px }
.vmm-rail-next { right: -6px }

/* "Vedi tutte": griglia ordinata */
.vmm-subnav.is-expanded .vmm-rail-track {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px;
  overflow: visible; padding: 4px 0 0;
}
.vmm-subnav.is-expanded .vmm-rail-track a {
  width: 100%; height: auto; min-height: 40px; padding: 9px 14px; border-radius: 10px;
  justify-content: space-between; white-space: normal; line-height: 1.3;
}
.vmm-subnav.is-expanded .vmm-rail::before, .vmm-subnav.is-expanded .vmm-rail::after { display: none }

@media (max-width: 767px) {
  .vmm-rail-btn { display: none !important }
  .vmm-rail-track a { height: 36px; padding: 0 13px; font-size: 13px }
  .vmm-subnav.is-expanded .vmm-rail-track { grid-template-columns: 1fr 1fr }
  .vmm-listing-title { font-size: 1.35rem }
}

/* Prodotti per riga (desktop): 3 / 4 / 5 */
@media (min-width: 1200px) {
  body.vmm-cols-4 #js-product-list .products > *,
  body.vmm-cols-4 #js-product-list .product_list > * { flex: 0 0 25%; max-width: 25%; width: 25% }
  body.vmm-cols-5 #js-product-list .products > *,
  body.vmm-cols-5 #js-product-list .product_list > * { flex: 0 0 20%; max-width: 20%; width: 20% }
  body.vmm-cols-3 #js-product-list .products > *,
  body.vmm-cols-3 #js-product-list .product_list > * { flex: 0 0 33.3333%; max-width: 33.3333%; width: 33.3333% }
}
@media (min-width: 992px) and (max-width: 1199px) {
  body.vmm-cols-4 #js-product-list .products > *,
  body.vmm-cols-5 #js-product-list .products > *,
  body.vmm-cols-4 #js-product-list .product_list > *,
  body.vmm-cols-5 #js-product-list .product_list > * { flex: 0 0 33.3333%; max-width: 33.3333%; width: 33.3333% }
}
