/* Separate homepage settings from catalogue/product loops.
   The parent archive supplies these same variables locally on its main element. */
#page.az-site :is(.az-shop-grid, .az-product-grid, ul.products) {
  grid-template-columns: repeat(var(--az-shop-columns-desktop, 4), minmax(0, 1fr));
}
/* Product suggestions are standalone sections, without the archive's sidebar track. */
#page.az-site .az-product-related > .az-shop-grid {
  display: grid;
  grid-column: auto;
  min-width: 0;
  align-items: stretch;
}
/* Shared purchase/detail controls survive removal of the former homepage CSS. */
#page.az-site .az-product-card .az-product-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
#page.az-site .az-product-card .az-product-card__actions:has(> .az-child-catalog-details) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
}
#page.az-site .az-product-card .az-product-card__actions > :is(.button, .az-child-catalog-details) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--az-radius-sm, 4px);
  background: var(--az-color-primary, #0863aa);
  color: #fff;
  font-family: var(--az-font-main, Arial, sans-serif);
  font-size: calc(var(--az-body-size, 16px) * .875);
  font-weight: var(--az-font-weight, 400);
  line-height: var(--az-body-line-height, 1.55);
  text-align: center;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
}
#page.az-site .az-product-card .az-product-card__actions > .button { grid-column: 1; grid-row: 1; background: var(--az-color-secondary, #333); }
#page.az-site .az-product-card .az-child-catalog-details { grid-column: 2; grid-row: 1; }
#page.az-site .az-product-card .az-product-card__actions > .added_to_cart { grid-column: 1 / -1; grid-row: 2; }
#page.az-site .az-product-card .az-product-card__actions > :is(.button, .az-child-catalog-details):hover { color: #fff; filter: brightness(.9); }
#page.az-site .az-product-card .az-product-card__actions > :is(.button, .az-child-catalog-details):focus-visible { outline: 2px solid var(--az-color-primary, #0863aa); outline-offset: 3px; }
@media (max-width: 960px) {
  #page.az-site :is(.az-shop-grid, .az-product-grid, ul.products) {
    grid-template-columns: repeat(var(--az-shop-columns-tablet, 3), minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  #page.az-site .az-product-card .az-product-card__actions:has(> .az-child-catalog-details) { grid-template-columns: minmax(0, 1fr); }
  #page.az-site .az-product-card .az-child-catalog-details { grid-column: 1; grid-row: 2; }
  #page.az-site .az-product-card .az-product-card__actions > .added_to_cart { grid-row: 3; }
}
@media (max-width: 782px) {
  #page.az-site :is(.az-shop-grid, .az-product-grid, ul.products) {
    grid-template-columns: repeat(var(--az-shop-columns-mobile, 2), minmax(0, 1fr));
  }
}
