/**
 * Woo Infinite Scroll — Estilos CSS
 *
 * Cubre: barra superior, botón / toggle, loader, animaciones
 * y visibilidad de la paginación nativa según el modo activo.
 */

.wis-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #1a3a5c, #2d6a9f);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease, opacity 0.6s ease 0.8s;
  pointer-events: none;
  will-change: width;
}

.wis-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: wis-shimmer 1.2s infinite;
}

@keyframes wis-shimmer {
  0% { transform: translateX(-80px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(80px); opacity: 0; }
}

.wis-top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 14px;
}

.wis-view-toggle,
.wis-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-sizing: border-box;
}

.wis-view-toggle {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
}

.wis-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.wis-btn-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.wis-symbol-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.wis-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wis-view-toggle {
  position: relative;
  border: 1px solid #d6dce3;
  background: #ffffff;
  color: #1a3a5c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.wis-load-more-btn {
  position: relative;
  min-width: 132px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--wis-button-bg, #1a3a5c);
  color: var(--wis-button-color, #ffffff);
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.wis-view-toggle:hover,
.wis-load-more-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
}

.wis-load-more-btn.is-loading {
  opacity: .65;
  cursor: default;
  transform: none;
}

.wis-top-pagination {
  width: 100%;
}

.wis-load-more-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 14px 0 0;
}


.wis-top-pagination.woocommerce-pagination,
.wis-top-controls nav.woocommerce-pagination {
  display: block !important;
  width: 100%;
  margin: 0;
}

.wis-sentinel {
  width: 100%;
  height: 1px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: none;
  visibility: hidden;
}

.wis-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 32px 16px;
  box-sizing: border-box;
}

.wis-spinner {
  width: 48px;
  height: 48px;
  animation: wis-rotate 1.4s linear infinite;
  flex-shrink: 0;
}

@keyframes wis-rotate {
  100% { transform: rotate(360deg); }
}

.wis-spinner-track {
  stroke: #e0e0e0;
}

.wis-spinner-head {
  stroke: #1a3a5c;
  animation: wis-dash 1.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes wis-dash {
  0% {
    stroke-dasharray: 1, 125.664;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 100.531, 125.664;
    stroke-dashoffset: -31.416;
  }
  100% {
    stroke-dasharray: 100.531, 125.664;
    stroke-dashoffset: -125.664;
  }
}

.wis-loader-text {
  display: block;
  font-size: 0.875rem;
  color: #888;
  letter-spacing: 0.02em;
  text-align: center;
}

li.product.wis-animate-fade {
  opacity: 0;
  transition: opacity 0.5s ease;
}

li.product.wis-animate-fade.wis-animate-in {
  opacity: 1;
}

li.product.wis-animate-slide {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

li.product.wis-animate-slide.wis-animate-in {
  opacity: 1;
  transform: translateY(0);
}

li.product.wis-animate-fade:nth-child(6n+1),
li.product.wis-animate-slide:nth-child(6n+1) { transition-delay: 0ms; }
li.product.wis-animate-fade:nth-child(6n+2),
li.product.wis-animate-slide:nth-child(6n+2) { transition-delay: 60ms; }
li.product.wis-animate-fade:nth-child(6n+3),
li.product.wis-animate-slide:nth-child(6n+3) { transition-delay: 120ms; }
li.product.wis-animate-fade:nth-child(6n+4),
li.product.wis-animate-slide:nth-child(6n+4) { transition-delay: 180ms; }
li.product.wis-animate-fade:nth-child(6n+5),
li.product.wis-animate-slide:nth-child(6n+5) { transition-delay: 240ms; }
li.product.wis-animate-fade:nth-child(6n+6),
li.product.wis-animate-slide:nth-child(6n+6) { transition-delay: 300ms; }

.woo-infinite-scroll-active.wis-mode-infinite .woocommerce-pagination,
.woo-infinite-scroll-active.wis-mode-infinite nav.woocommerce-pagination,
.woo-infinite-scroll-active.wis-mode-button .woocommerce-pagination,
.woo-infinite-scroll-active.wis-mode-button nav.woocommerce-pagination {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  li.product.wis-animate-fade,
  li.product.wis-animate-slide {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .wis-spinner,
  .wis-spinner-head,
  .wis-progress-bar::after {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .wis-top-controls {
    gap: 8px;
    margin-bottom: 12px;
  }

  .wis-view-toggle,
  .wis-load-more-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .wis-load-more-wrap {
    margin-top: 14px;
  }

  .wis-loader {
    padding: 24px 12px;
    gap: 8px;
  }

  .wis-spinner {
    width: 36px;
    height: 36px;
  }

  .wis-loader-text {
    font-size: 0.8125rem;
  }
}
