/*
 * Project-specific visual adaptations for the Bitrix integration.
 * Keep frontend source assets unchanged; place integration overrides here.
 * Every block below covers markup or a state generated by Bitrix and absent from the static layout.
 */

/* Highlights the active section tag selected by the catalog component. */
.catalog-tags__item._active {
  color: var(--text-green-color);
  border-color: var(--border-green-color);
}

/* Empty catalog result produced after filtering or an empty Bitrix section. */
.catalog-products__empty {
  min-height: 17.5rem;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  padding: 2rem;
  border-radius: 0.5rem;
  background-color: var(--bg-section-color);
  text-align: center;
}

.catalog-products__empty strong {
  font-size: 1.375rem;
  line-height: 1.25;
}

.catalog-products__empty p {
  max-width: 28.75rem;
  color: var(--text-secondary-color);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Makes the Bitrix "show more" button inherit the layout button geometry. */
.catalog-products__more {
  width: 100%;
  border: 0;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.catalog-products__more.disabled,
.catalog-products__more:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* Prevents native button chrome on compare/favorite controls rendered as buttons by Bitrix. */
.product-mini-card_catalog :is(.product-mini-card__compare, .product-mini-card__favorite) {
  border: 0;
  background: transparent;
}

/* Active state returned by the compare/favorites AJAX handlers. */
.product-mini-card_catalog :is(.product-mini-card__compare, .product-mini-card__favorite)._active {
  color: var(--text-green-color);
  opacity: 1;
  pointer-events: auto;
}

/* Locks compare/favorites controls while their AJAX request is running. */
.product-mini-card_catalog :is(.product-mini-card__compare, .product-mini-card__favorite)._pending {
  opacity: 0.45;
  pointer-events: none;
}

/* Removes native button border from the Bitrix add-to-cart control. */
.product-mini-card_catalog .product-mini-card__desktop-cart {
  border: 0;
}

/* Locks the cart control while Bitrix updates the basket. */
.product-mini-card_catalog .product-mini-card__desktop-cart._pending {
  opacity: 0.6;
  pointer-events: none;
}

/* Marks the card when a catalog AJAX action failed. */
.product-mini-card_catalog._action-error {
  border-color: var(--text-error-color);
}

/* Resolves the banner image relative to the template instead of the layout's document-root /img path. */
.catalog-consultation {
  background:
    linear-gradient(90deg, var(--bg-catalog-banner-start-color), var(--bg-catalog-banner-end-color)),
    url("../img/catalog/banner-bg.png") center / cover no-repeat;
}

@media (width < 47.99875em) {
  /* Compact empty-state geometry for the mobile catalog grid. */
  .catalog-products__empty {
    min-height: 13.125rem;
    padding: 1.5rem 1rem;
    border-radius: 0.3125rem;
  }

  .catalog-products__empty strong {
    font-size: 1.125rem;
  }

  /* Keeps the template-relative banner image on mobile as well. */
  .catalog-consultation {
    background: url("../img/catalog/banner-bg.png") right bottom / auto 100% no-repeat;
  }
}
