/* Демо-режим: водяной знак */
.acs-catalog.acs-demo{ position:relative; }
.acs-catalog.acs-demo::after{
  content:'demo';
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%) rotate(-25deg);
  font-size:48px;
  font-weight:bold;
  color:rgba(0,0,0,.06);
  pointer-events:none;
  user-select:none;
  z-index:0;
}
.acs-catalog.acs-demo .acs-grid{ position:relative; z-index:1; }
.acs-catalog.acs-demo .acs-filters{ position:relative; z-index:1; }

.acs-grid{
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  box-sizing:border-box;
}

/* Карточки в ряд по оси X: ширина рассчитывается с учётом промежутков (gap = 20px) */
.acs-grid.acs-cols-1 .acs-card{ flex:0 0 calc(100% - 0px); }
.acs-grid.acs-cols-2 .acs-card{ flex:0 0 calc((100% - 20px) / 2); }
.acs-grid.acs-cols-3 .acs-card{ flex:0 0 calc((100% - 40px) / 3); }
.acs-grid.acs-cols-4 .acs-card{ flex:0 0 calc((100% - 60px) / 4); }

/* Адаптив */
@media(max-width:992px){
  .acs-grid.acs-cols-4 .acs-card,
  .acs-grid.acs-cols-3 .acs-card {
    flex:0 0 calc((100% - 20px) / 2);
  }
  .acs-grid.acs-cols-2 .acs-card {
    flex:0 0 calc((100% - 20px) / 2);
  }
  .acs-grid.acs-cols-1 .acs-card {
    flex:0 0 100%;
  }
}
@media(max-width:600px){
  .acs-grid .acs-card { flex:0 0 100%; }
}

/* Устройства телефонов (широкие и узкие телефоны) — один столбец */
@media (max-width: 768px) {
  .acs-grid .acs-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

.acs-card{
  border:1px solid #e5e5e5;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
  padding:0 !important;
  box-sizing:border-box;
}

/* Картинка: фиксированная высота 220px, контент по центру */
.acs-thumb{
  width:calc(100% + 2px) !important;
  max-width:calc(100% + 2px) !important;
  margin:-1px -1px 0 -1px !important;
  padding:0 !important;
  background:#f6f6f6 !important;
  height:220px !important;
  min-height:220px !important;
  max-height:220px !important;
  overflow:hidden;
  line-height:0;
  border-radius:12px 12px 0 0;
  box-sizing:border-box;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.acs-thumb img{
  width:100% !important;
  height:220px !important;
  min-height:220px !important;
  max-height:220px !important;
  object-fit:cover !important;
  object-position:center center !important;
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  border:0;
  vertical-align:top;
  transition:transform 0.35s ease;
}
.acs-card:hover .acs-thumb img{
  transform:scale(1.08);
}
.acs-thumb-placeholder{width:100% !important;height:220px !important;min-height:220px !important;background:#eee;display:block !important;margin:0;padding:0;}

.acs-body{
  padding:14px 14px 24px 14px;
  flex:1;
  display:flex;
  flex-direction:column;
}

.acs-title{
  font-size:20px;
  font-weight:bold;
  text-transform:uppercase;
  margin:0 0 8px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  /* Резервируем место под 3 строки даже если текста меньше */
  min-height: calc(1.3em * 3);
  max-height: calc(1.3em * 3); /* fallback */
}

.acs-price{
  font-weight:700;
  font-size:18px;
  margin-bottom:8px;
}
.acs-price .acs-amount{margin-right:6px;}
.acs-excerpt{
  font-size:14px;
  color:#555;
  flex:1;
}
/* Ограничиваем описание визуально пятью строками */
.acs-excerpt{
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  /* Резервируем место под 5 строк даже если текста меньше */
  min-height: calc(1.4em * 5);
  max-height: calc(1.4em * 5); /* fallback */
}

.acs-btn{
  display:block;
  text-align:center;
  background:#2b6cff;
  color:#fff;
  padding:12px 16px;
  border-radius:8px;
  text-decoration:none;
  margin-top:10px;
  font-size:16px;
  font-weight:600;
  line-height:1.2;
}
.acs-btn:hover{background:#1d54cc;}
.acs-btn--no-link{
  opacity:0.7;
  cursor:not-allowed;
  pointer-events:none;
}

/* Фильтры: в одну строчку, при нехватке места — перенос на следующую */
.acs-filters{
  display:flex;
  flex-direction:row;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:18px;
  align-items:center;
}
.acs-filters input[type="text"], .acs-filters input[type="number"], .acs-filters select{
  flex:0 1 auto;
  min-width:0;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:6px;
  background:#fff;
}
.acs-filters .button, .acs-filters button[type="submit"]{
  flex:0 0 auto;
  padding:8px 12px;
  border-radius:6px;
  cursor:pointer;
}

.acs-pagination{margin-top:20px;}

/* Пагинация WP (paginate_links type=list) — делаем горизонтально */
.acs-pagination ul.page-numbers{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  list-style:none;
  padding:0;
  margin:0;
}
.acs-pagination ul.page-numbers > li{
  margin:0;
  padding:0;
}

.acs-pagination a.page-numbers,
.acs-pagination span.page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 10px;
  border:1px solid #e5e5e5;
  border-radius:6px;
  text-decoration:none;
  background:#fff;
  color:inherit;
  box-sizing:border-box;
}
.acs-pagination span.page-numbers.current{
  background:#2b6cff;
  color:#fff;
  border-color:#2b6cff;
}

