/**
 * AGI-SYSTEMS — CSS слой для переоформления каталога товаров (спарчасти).
 * Размещать: /agro/agi_catalog_list.css
 * Подключить в template.php на странице каталога /catalog/parts/
 */

:root {
  --green: #16a34a;
  --green-d: #15803d;
  --text: #111827;
  --text2: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg2: #f9fafb;
  --rad: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 1. Сетка товаров */
/* ─────────────────────────────────────────────────────────────────────────── */

.display_list.flexbox {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

@media (max-width: 768px) {
  .display_list.flexbox {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 2. Карточка товара */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp {
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  transition: all 0.3s;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.list_item_wrapp:hover {
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1) !important;
  transform: translateY(-2px);
}

.list_item_wrapp .list_item {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 3. Фото товара */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp .image_block {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.list_item_wrapp .image_block img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 16px;
}

.list_item_wrapp .image_wrapper_block {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list_item_wrapp .fast_view_block,
.list_item_wrapp .adaptive {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 4. Описание и информация */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp .description_wrapp {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

.list_item_wrapp .description {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.list_item_wrapp .item-title {
  margin: 0;
}

.list_item_wrapp .item-title a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  transition: color 0.2s;
}

.list_item_wrapp .item-title a:hover {
  color: var(--green);
}

/* Скрыть ненужные элементы */
.list_item_wrapp .wrapp_stockers,
.list_item_wrapp .preview_text,
.list_item_wrapp .props_list_wrapp,
.list_item_wrapp .show_props,
.list_item_wrapp .properties {
  display: none !important;
}

.list_item_wrapp .article_block {
  font-size: 12px;
  color: var(--text2);
  margin: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 5. Цена и наличие */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp .information_wrapp {
  padding: 0 16px 16px;
  margin: 0 !important;
}

.list_item_wrapp .information {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list_item_wrapp .cost {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Переформатирование цен */
.list_item_wrapp .price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.list_item_wrapp .price_old {
  display: none;
}

.list_item_wrapp .price_new {
  display: none;
}

/* Скрыть матрицу цен */
.list_item_wrapp .price-matrix,
.list_item_wrapp .counter_wrapp table {
  display: none !important;
}

/* Статус наличия */
.list_item_wrapp .quantity_block,
.list_item_wrapp .store,
.list_item_wrapp .in_stock {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
  margin: 0;
}

.list_item_wrapp .in_stock {
  background-color: #dcfce7;
  color: #166534;
}

.list_item_wrapp .not_in_stock {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 6. Кнопки покупки */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp .counter_wrapp {
  margin: 0 !important;
  padding: 0 !important;
  gap: 8px;
  display: flex;
  flex-direction: column;
}

.list_item_wrapp .button_block {
  margin: 0 !important;
  padding: 0 !important;
}

.list_item_wrapp .button_block .btn {
  width: 100%;
  padding: 10px 12px !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  display: block;
  margin: 0 !important;
}

.list_item_wrapp .button_block .btn.basket,
.list_item_wrapp .button_block .btn-default {
  background-color: var(--green) !important;
  color: white !important;
  border: none !important;
}

.list_item_wrapp .button_block .btn.basket:hover,
.list_item_wrapp .button_block .btn-default:hover {
  background-color: var(--green-d) !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.list_item_wrapp .button_block .btn.orange,
.list_item_wrapp .button_block .btn-transparent-border-color {
  background-color: white !important;
  color: var(--text) !important;
  border: 2px solid var(--border) !important;
}

.list_item_wrapp .button_block .btn.orange:hover,
.list_item_wrapp .button_block .btn-transparent-border-color:hover {
  border-color: var(--green) !important;
  color: var(--green) !important;
}

/* Скрыть ненужные кнопки */
.list_item_wrapp .offer_buy_block,
.list_item_wrapp .basket_props_block,
.list_item_wrapp .sku_props {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 7. Скрыть ненужные элементы */
/* ─────────────────────────────────────────────────────────────────────────── */

.list_item_wrapp .js-item-gallery,
.list_item_wrapp .compare_block,
.list_item_wrapp .delay_compare_block,
.list_item_wrapp .bonus_block {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* 8. Пагинация */
/* ─────────────────────────────────────────────────────────────────────────── */

.bottom_nav {
  margin-top: 40px;
  text-align: center;
}

.bottom_nav a,
.bottom_nav span {
  padding: 10px 12px;
  margin: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.bottom_nav a:hover,
.bottom_nav span.active {
  background-color: var(--green);
  color: white;
  border-color: var(--green);
}
