/* Bisnesplas production loading states: stable layout, honest feedback, no empty shelves. */
.home-loading-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  margin: 2px 0 8px;
  color: #526178;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.home-loading-status[hidden] {
  display: none !important;
}

.home-loading-status__pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: #0f8b7f;
  box-shadow: 0 0 0 0 rgba(15, 139, 127, 0.28);
  animation: bp-loading-pulse 1.35s ease-out infinite;
}

.products-grid[aria-busy="true"] {
  min-height: 360px;
}

#opportunitiesGrid.products-grid[aria-busy="true"] {
  min-height: 0;
  align-items: flex-start;
}

.product-card--server {
  animation: none !important;
}

.product-card--skeleton {
  pointer-events: none;
  min-height: 330px;
  animation: none !important;
}

.product-card--skeleton .product-info {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
}

.skeleton-block,
.skeleton-line,
.skeleton-circle,
.category-chip--skeleton {
  position: relative;
  overflow: hidden;
  background: #eef2f7;
}

.skeleton-block::after,
.skeleton-line::after,
.skeleton-circle::after,
.category-chip--skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-105%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  animation: bp-skeleton-shimmer 1.45s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
}

.skeleton-line--short { width: 38%; height: 9px; }
.skeleton-line--price { width: 54%; height: 24px; margin-top: 3px; }
.skeleton-line--chips { width: 72%; height: 20px; margin-top: auto; }
.skeleton-circle { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; }

.category-chip--skeleton {
  display: inline-flex;
  width: 190px;
  min-width: 190px;
  height: 54px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.category-chip--skeleton .skeleton-line {
  width: 112px;
}

@keyframes bp-skeleton-shimmer {
  100% { transform: translateX(105%); }
}

@keyframes bp-loading-pulse {
  70%, 100% { box-shadow: 0 0 0 8px rgba(15, 139, 127, 0); }
}

@media (max-width: 640px) {
  .home-loading-status {
    margin: 1px 0 6px;
    font-size: 11px;
  }

  .products-grid[aria-busy="true"] {
    min-height: 720px;
  }

  .product-card--skeleton {
    min-height: 290px;
  }

  .product-card--skeleton .product-info {
    min-height: 132px;
    gap: 9px;
    padding: 10px;
  }

  .category-chip--skeleton {
    width: 152px;
    min-width: 152px;
    height: 48px;
  }

  .category-chip--skeleton .skeleton-line {
    width: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-loading-status__pulse,
  .skeleton-block::after,
  .skeleton-line::after,
  .skeleton-circle::after,
  .category-chip--skeleton::after {
    animation: none !important;
  }
}


/* Catalog fetch feedback: delayed by JS to avoid flicker on fast responses. */
#productsGrid {
  position: relative;
}

#productsGrid.is-fetching::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

#productsGrid.is-fetching::after {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 31;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border: 3px solid rgba(7, 132, 111, 0.18);
  border-top-color: var(--bp-primary, #07846f);
  border-radius: 50%;
  animation: bp-catalog-spin 720ms linear infinite;
  pointer-events: none;
}

.home-section__summary.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-section__summary.is-loading::before {
  content: '';
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid rgba(7, 132, 111, 0.2);
  border-top-color: var(--bp-primary, #07846f);
  border-radius: 50%;
  animation: bp-catalog-spin 720ms linear infinite;
}

.bp-filter-dock.is-loading::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--bp-primary, #07846f) 45%, transparent 100%);
  transform: translateX(-100%);
  animation: bp-catalog-progress 1.05s ease-in-out infinite;
  pointer-events: none;
}

.catalog-loading-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1150;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(7, 132, 111, 0.18);
  border-radius: 999px;
  color: #184b42;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px -20px rgba(5, 67, 56, 0.55);
  font: 750 12px/1 var(--bp-font-interface, sans-serif);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 180ms ease;
  pointer-events: none;
}

.catalog-loading-toast[hidden] {
  display: none !important;
}

.catalog-loading-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.catalog-loading-toast__spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(7, 132, 111, 0.2);
  border-top-color: var(--bp-primary, #07846f);
  border-radius: 50%;
  animation: bp-catalog-spin 720ms linear infinite;
}

@keyframes bp-catalog-spin {
  to { transform: rotate(360deg); }
}

@keyframes bp-catalog-progress {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(10%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 640px) {
  #productsGrid.is-fetching::after {
    top: 16px;
    width: 24px;
    height: 24px;
    margin-left: -12px;
  }

  .catalog-loading-toast {
    min-height: 40px;
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 0 13px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #productsGrid.is-fetching::after,
  .home-section__summary.is-loading::before,
  .bp-filter-dock.is-loading::after,
  .catalog-loading-toast__spinner {
    animation: none !important;
  }

  .catalog-loading-toast {
    transition: none !important;
  }
}
