/* Airgrill2 catalog category - Figma 170:727 */
/* light header: см. .ag2-header--light в home.css */

body.tpl-airgrill2.is-catalog {
  background: #fff;
  color: var(--ag2-text-dark, #282828);
}

.ag2-catalog-page {
  padding: 24px 0 48px;
}

.ag2-breadcrumbs {
  margin-bottom: 24px;
}

.ag2-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--ag2-muted, #7a7a7a);
}

.ag2-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: 12px;
}

.ag2-breadcrumbs__item a {
  color: var(--ag2-muted, #7a7a7a);
  text-decoration: none;
}

.ag2-breadcrumbs__item a:hover {
  color: var(--ag2-text-dark, #282828);
}

.ag2-breadcrumbs__sep {
  color: var(--ag2-muted, #7a7a7a);
}

.ag2-cat {
  margin-bottom: 32px;
}

.ag2-cat__title {
  margin: 0 0 24px;
  max-width: 648px;
  font-size: 36px;
  line-height: 44px;
  font-weight: 600;
  color: #282828;
}

.ag2-cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.ag2-cat-filters__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border: 0;
  border-radius: 0;
  background: #f7f7f7;
  color: #7a7a7a;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

a.ag2-cat-filters__chip:hover,
a.ag2-cat-filters__chip:focus {
  text-decoration: none !important;
}

.ag2-cat-filters__chip .ag2-cat-filters__check {
  display: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ag2-cat-filters__chip.is-active {
  background: #282828;
  color: #fff;
  padding-left: 12px;
}

.ag2-cat-filters__chip.is-active .ag2-cat-filters__check {
  display: block;
}

.ag2-cat-filters__chip:not(.is-active):hover {
  background: #e0e0e0;
  color: #282828;
}

/* корневой /catalog: только категории */
.ag2-cat--root {
  margin-bottom: 0;
}

.ag2-cat-root {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag2-cat-root__link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #282828;
  text-decoration: none;
}

.ag2-cat-root__link:hover .ag2-cat-root__name {
  color: #282828;
}

.ag2-cat-root__thumb {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f7f7f7;
}

.ag2-cat-root__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ag2-cat-root__name {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
}

body.tpl-airgrill2.is-catalog .hikashop_category_listing_root .hikashop_subcategories_listing,
body.tpl-airgrill2.is-catalog .hikashop_category_listing_root .hikashop_submodules {
  display: none !important;
}

/* HikaShop listing -> Figma grid */
body.tpl-airgrill2.is-catalog .hikashop_products .hk-row-fluid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  width: 100%;
}

body.tpl-airgrill2.is-catalog .hikashop_products .hk-row-fluid > [class*="hkc-"] {
  display: flex !important;
  flex-direction: column;
  align-self: stretch;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  float: none !important;
  clear: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative;
  /* HikaShop 12-col: .hkc-md-4 = span 4; у нас 4 колонки - нужен span 1 */
  grid-column: auto / span 1 !important;
}

body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_container,
body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_subcontainer,
body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_subcontainer_border,
body.tpl-airgrill2.is-catalog .hikashop_products .thumbnail {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

body.tpl-airgrill2.is-catalog .hikashop_category_description {
  display: none;
}

@media (max-width: 1199px) {
  body.tpl-airgrill2.is-catalog .hikashop_products .hk-row-fluid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body.tpl-airgrill2.is-catalog .hikashop_products .hk-row-fluid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

.ag2-search-page-wrap {
  padding: 48px 0 64px;
}

.ag2-search-page__title {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  color: #282828;
}

.ag2-search-page__query,
.ag2-search-page__empty {
  margin: 0 0 32px;
  color: #686868;
}

.ag2-search-page__grid {
  margin-bottom: 0;
}

.ag2-product-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
}

.ag2-product-grid > * {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
}

/* карточка - Figma 170:727; острые углы; глушим legacy .items .product-card */
body.tpl-airgrill2.is-catalog .items .product-card.ag2-product-card,
body.tpl-airgrill2.is-catalog .ag2-product-card,
body.tpl-airgrill2 .ag2-product-grid .product-card.ag2-product-card,
body.tpl-airgrill2 .ag2-product-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 16px;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 100%;
  padding: 16px !important;
  background: #fff;
  border-radius: 0 !important;
  border: 1.5px solid transparent !important;
  box-sizing: border-box;
  overflow: visible;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.tpl-airgrill2.is-catalog .items .product-card.ag2-product-card:hover,
body.tpl-airgrill2.is-catalog .ag2-product-card:hover,
body.tpl-airgrill2 .ag2-product-grid .product-card.ag2-product-card:hover,
body.tpl-airgrill2 .ag2-product-card:hover {
  border-color: #282828 !important;
  box-shadow: 0 12px 32px rgba(19, 19, 19, 0.08);
}

.ag2-product-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 312px;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 0;
  overflow: hidden;
}

.ag2-product-card__media .jbimage-link,
.ag2-product-card__media a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ag2-product-card__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0 !important;
}

.ag2-product-card__media .jbimage-link:after {
  display: none !important;
}

.ag2-product-card__badges {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

body.tpl-airgrill2 .ag2-product-card .badges .badge,
.ag2-product-card__badges .badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 500 !important;
  color: #fff !important;
}

body.tpl-airgrill2 .ag2-product-card .badges .badge-new,
.ag2-product-card__badges .badge-new {
  background: #2bbf66 !important;
}

body.tpl-airgrill2 .ag2-product-card .badges .badge-sale,
.ag2-product-card__badges .badge-sale {
  background: #131313 !important;
}

body.tpl-airgrill2 .ag2-product-card .badges .badge-bestseller,
.ag2-product-card__badges .badge-bestseller {
  background: #ff6123 !important;
}

.ag2-product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  padding: 0;
  min-width: 0;
  min-height: 0;
}

.ag2-product-card .product-name,
.ag2-product-card .ag2-product-card__title {
  margin: 0;
  min-height: 0 !important;
  font-size: 18px !important;
  line-height: 26px !important;
  font-weight: 500 !important;
  color: #282828;
}

.ag2-product-card .product-name a,
.ag2-product-card .ag2-product-card__title a {
  color: inherit !important;
  text-decoration: none;
}

.ag2-product-card .product-name a:hover,
.ag2-product-card .ag2-product-card__title a:hover {
  color: #ff6123 !important;
}

.ag2-product-card .production-time,
.ag2-product-card .ag2-product-card__time {
  margin: 0 0 8px !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
  color: #7a7a7a !important;
}

.ag2-product-card__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  /* свободное место над ценой - цены и кнопки в одном ряду на одной линии */
  margin-top: auto;
}

body.tpl-airgrill2.is-catalog .items .product-card .jbcurrency-value,
body.tpl-airgrill2.is-catalog .items .product-card .jbcurrency-symbol,
.ag2-product-card .pricecolor-red,
.ag2-product-card .ag2-product-card__price,
.ag2-product-card .jbcurrency-value,
.ag2-product-card .jbcurrency-symbol,
.ag2-product-card .jbcartvalue {
  color: #ff6123 !important;
  font-size: 20px !important;
  line-height: 28px !important;
  font-weight: 600 !important;
}

.ag2-product-card .oldprice,
.ag2-product-card .ag2-product-card__old {
  color: #7a7a7a !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
  text-decoration: line-through;
}

.ag2-product-card .oldprice::before {
  display: none !important;
}

.ag2-product-card__cart-wrap {
  margin-top: 0 !important;
  padding-top: 8px;
}

/* если цены нет - кнопку всё равно жмём вниз */
.ag2-product-card__body:not(:has(.ag2-product-card__prices)) .ag2-product-card__cart-wrap {
  margin-top: auto !important;
}

body.tpl-airgrill2.is-catalog .ag2-product-card .jsAddToCart,
body.tpl-airgrill2.is-catalog .ag2-product-card .product-link,
.ag2-product-card .jsAddToCart,
.ag2-product-card .product-link,
.ag2-product-card .ag2-product-card__cart,
.ag2-product-card .hikabtn.hikacart,
.ag2-product-card button.hikacart,
.ag2-product-card .hikashop_cart_input_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f7f7f7 !important;
  color: #282828 !important;
  font-family: inherit;
  font-size: 16px !important;
  line-height: 24px !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

body.tpl-airgrill2.is-catalog .ag2-product-card .jsAddToCart:hover,
body.tpl-airgrill2.is-catalog .ag2-product-card .product-link:hover,
.ag2-product-card .jsAddToCart:hover,
.ag2-product-card .product-link:hover,
.ag2-product-card .ag2-product-card__cart:hover,
.ag2-product-card .hikabtn.hikacart:hover,
.ag2-product-card button.hikacart:hover {
  background: #ff6123 !important;
  color: #fff !important;
}

.ag2-product-card .jsAddToCart svg,
.ag2-product-card .hikacart svg,
.ag2-product-card__cart-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
  color: inherit;
}

.ag2-product-card__cart-wrap .hikacart .ag2-product-card__cart-icon {
  filter: none;
  opacity: 0.9;
}

.ag2-product-card__cart-wrap .hikacart:hover .ag2-product-card__cart-icon {
  filter: brightness(0) invert(1);
}

/* глушим stock HikaShop "за шт." на карточке */
body.tpl-airgrill2.is-catalog .ag2-product-card .hikashop_product_price_per_unit,
body.tpl-airgrill2.is-catalog .ag2-product-card .hikashop_product_price_full {
  display: none !important;
}

body.tpl-airgrill2.is-catalog .ag2-product-card .ag2-product-card__price,
body.tpl-airgrill2.is-catalog .ag2-product-card .ag2-product-card__old {
  display: inline !important;
}

body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_container,
body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_subcontainer {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* глушим JS equal-height (min-height), тянем карточки через flex/grid */
body.tpl-airgrill2.is-catalog .hikashop_products .hikashop_subcontainer[style*="min-height"] {
  min-height: 0 !important;
}

/* пагинация */
body.tpl-airgrill2.is-catalog .hikashop_products_pagination,
body.tpl-airgrill2.is-catalog .uk-pagination,
.ag2-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

body.tpl-airgrill2.is-catalog .hikashop_products_pagination ul {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.tpl-airgrill2.is-catalog .hikashop_products_pagination li,
body.tpl-airgrill2.is-catalog .uk-pagination > *,
.ag2-pagination > * {
  margin: 0 !important;
  list-style: none;
}

body.tpl-airgrill2.is-catalog .hikashop_products_pagination a,
body.tpl-airgrill2.is-catalog .hikashop_products_pagination span,
body.tpl-airgrill2.is-catalog .uk-pagination > * > *,
.ag2-pagination a,
.ag2-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
  color: #282828;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  box-sizing: border-box;
}

body.tpl-airgrill2.is-catalog .hikashop_products_pagination .active span,
body.tpl-airgrill2.is-catalog .hikashop_products_pagination li.active > *,
body.tpl-airgrill2.is-catalog .uk-pagination .uk-active > *,
.ag2-pagination .uk-active > *,
.ag2-pagination .is-active {
  background: #282828;
  color: #fff !important;
}

body.tpl-airgrill2.is-catalog .hikashop_results_counter {
  display: none;
}

body.tpl-airgrill2.is-catalog .rsslink {
  display: none;
}

@media (max-width: 1199px) {
  .ag2-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ag2-cat-root {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ag2-cat__title {
    font-size: 28px;
    line-height: 36px;
  }
}

@media (max-width: 639px) {
  .ag2-catalog-page {
    padding: 16px 0 32px;
  }

  .ag2-search-page-wrap {
    padding: 32px 0 48px;
  }

  .ag2-product-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ag2-cat-root {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ag2-product-card__media {
    min-height: 240px;
  }

  .ag2-cat-filters {
    gap: 8px;
  }
}
