/* Módulo Vista de catálogo (Ecomm): estados del listado sin recarga y scroll infinito */
.ecomm-products { transition: opacity .25s ease; }
.ecomm-products.is-loading { opacity: .45; pointer-events: none; }
.ecomm-products.is-fresh .products-grid > *, .ecomm-products.is-fresh tbody tr, .ecomm-appear { animation: ecomm-catalog-in .55s var(--b2b-ease, cubic-bezier(.22, 1, .36, 1)) both; }
.ecomm-products.is-fresh .products-grid > :nth-child(2), .ecomm-products.is-fresh tbody tr:nth-child(2) { animation-delay: .03s; }
.ecomm-products.is-fresh .products-grid > :nth-child(3), .ecomm-products.is-fresh tbody tr:nth-child(3) { animation-delay: .06s; }
.ecomm-products.is-fresh .products-grid > :nth-child(4), .ecomm-products.is-fresh tbody tr:nth-child(4) { animation-delay: .09s; }
.ecomm-products.is-fresh .products-grid > :nth-child(5), .ecomm-products.is-fresh tbody tr:nth-child(5) { animation-delay: .12s; }
.ecomm-products.is-fresh .products-grid > :nth-child(6), .ecomm-products.is-fresh tbody tr:nth-child(6) { animation-delay: .15s; }
.ecomm-products.is-fresh .products-grid > :nth-child(n+7), .ecomm-products.is-fresh tbody tr:nth-child(n+7) { animation-delay: .18s; }
.ecomm-appear { animation-delay: calc(min(var(--ecomm-i, 0), 8) * 45ms); }
@keyframes ecomm-catalog-in { from { opacity: 0; transform: translateY(14px); } }

/* Sin resultados */
.ecomm-noresults { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 3.5rem 1rem; text-align: center; background: #fff; border-radius: var(--b2b-radius, 16px); box-shadow: 0 0 0 1px var(--b2b-line, #E3E8EE); color: var(--b2b-muted, #5E6B7A); }
.ecomm-noresults__icon { width: 48px; height: 48px; padding: 11px; border-radius: 14px; background: var(--b2b-primary-50, #EEF4FA); color: var(--b2b-primary, #1B5585); margin-bottom: .5rem; }
.ecomm-noresults strong { color: var(--b2b-text, #0F1B2A); font-weight: 600; }

/* Barra de progreso superior mientras carga */
.ecomm-progress { position: fixed; z-index: 2000; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; opacity: 0; transition: opacity .3s; overflow: hidden; }
.ecomm-progress::before { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--b2b-accent, #2FA6CB), var(--b2b-primary, #1B5585)); animation: ecomm-progress 1s ease-in-out infinite; }
.ecomm-progress.is-active { opacity: 1; }
@keyframes ecomm-progress { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Pie del listado: progreso + cargar más */
.ecomm-more { display: flex; flex-direction: column; align-items: center; gap: .65rem; margin: 2rem auto 0; max-width: 320px; text-align: center; }
.ecomm-more:empty { display: none; }
.ecomm-more__text { margin: 0; font-size: .84rem; color: var(--b2b-muted, #5E6B7A); }
.ecomm-more__text strong { color: var(--b2b-text, #0F1B2A); font-weight: 600; }
.ecomm-more__bar { width: 100%; height: 4px; border-radius: 4px; background: var(--b2b-line, #E3E8EE); overflow: hidden; }
.ecomm-more__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--b2b-primary, #1B5585), var(--b2b-accent, #2FA6CB)); transition: width .6s var(--b2b-ease, ease); }
.ecomm-more__btn { margin-top: .35rem; border-radius: 999px; padding-left: 1.4rem; padding-right: 1.4rem; }
.ecomm-more__spin { display: none; }
.ecomm-more.is-loading .ecomm-more__spin { display: inline-block; animation: ecomm-spin-more .8s linear infinite; }
@keyframes ecomm-spin-more { to { transform: rotate(360deg); } }
/* Con el JS activo la paginación clásica sobra: el pie carga las páginas siguientes y el botón de arriba las anteriores */
.ecomm-catalog-js .col-lg-9 .pagination { display: none !important; }
.ecomm-prev { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.ecomm-prev.is-loading, .ecomm-more__btn.is-loading { opacity: .6; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .ecomm-products.is-fresh *, .ecomm-appear, .ecomm-progress::before { animation: none !important; }
}
