.products-page-title {
  text-align: center;
  font-size: 32px;
  font-weight: bold;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #fc40c7a1;
}

/* Сетка карточек товаров */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 40px 20px;
  max-width: 1300px;
  margin: 0 auto;
  justify-items: center;
  box-sizing: border-box;
}

/* === Карточка товара === */
.product-card {
  width: 240px;
  height: 420px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Картинка товара */
.product-image {
  position: relative;
  flex: 1;
  width: 100%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Бейджик */
.label-hit {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #fc40c7a1;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 2;
}

/* Информация о товаре */
.product-info {
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  height: 40%;
  justify-content: space-between;
  text-align: left;
}

.product-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}

.product-info .name {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  line-height: 1.2;
  height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.product-info .price {
  font-size: 16px;
  font-weight: bold;
  color: #fc40c7a1;
}

/* Кнопки */
.action-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.view-btn,
.buy-btn {
  text-decoration: none;
  background-color: #fc40c7a1;
  color: white;
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.view-btn:hover,
.buy-btn:hover {
  background-color: #d136c4;
}

.products-pagination {
  text-align: center;
  margin: 40px 0;
}

.page-info {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: bold;
}

.page-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.page-buttons a {
  padding: 8px 12px;
  background-color: #fc40c7a1;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.page-buttons a:hover {
  background-color: #d136c4;
}

/* === Статус наличия — справа снизу в блоке с фото === */
.stock-status {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 2;
}

/* === Статус наличия — в наличии === */
.availability {
  background-color: rgba(93, 179, 96, 0.8);
  padding: 3px 6px;
  border-radius: 4px;
}

/* === Статус наличия — нет в наличии === */
.noneavailabile {
  background-color: rgba(229, 57, 53, 0.8);
  padding: 3px 6px;
  border-radius: 4px;
}


.products-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;          /* центрируем все фильтры */
  align-items: flex-end;
  margin: 30px auto;
  padding: 24px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  max-width: 1000px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

/* Каждая группа — фиксированной ширины */
.filter-group {
  width: 160px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
}

.filter-group label {
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
  font-size: 15px;
}

/* Поля селекта — стандартного размера и стиля */
.form-select {
  height: 42px;
  min-width: 160px;
  border-radius: 10px;
  font-size: 15px;
  box-sizing: border-box;
  padding: 8px 14px;          /* уменьшенный вертикальный паддинг для избежания обрезки текста */
  border: 1px solid #ccc;
  background-color: #fdfdfd;
  color: #222;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  display: inline-block;
}

/* Фокус для селекта */
.form-select:focus {
  border-color: #fc40c7;
  box-shadow: 0 0 0 3px rgba(252, 64, 199, 0.15);
  outline: none;
}

/* Кнопка применить фильтр */
.filter-submit {
  width: 160px;               /* совпадает с шириной селектов */
  height: 42px;               /* совпадает с высотой селектов */
  border-radius: 10px;
  font-size: 15px;
  box-sizing: border-box;
  padding: 8px 14px;          /* уменьшенный вертикальный паддинг */
  border: none;
  background-color: #fc40c7a1;
  color: white;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;       /* прижимает кнопку к нижнему краю остальных элементов */
  transition: background-color 0.25s ease;
}

.filter-submit:hover {
  background-color: #d136c4;
}

.no-results-message {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 38px;
    color: #888;
    height: 300px;
    width: 100%;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .products-filter {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
    min-width: auto;
  }

  .form-select,
  .filter-submit {
    width: 100%;
    min-width: auto;
  }

  .filter-submit {
    align-self: stretch;
  }

  .availability,
  .noneavailabile {
    font-size: 10px;
    padding: 2px 5px;
  }
}



@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}

/* Адаптивная сетка */
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page-buttons a {
    padding: 4px 8px;
    font-size: 17px;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
  }

  .product-card {
    width: 100%;
    max-width: 160px;
    height: 350px;
  }

  .product-info .name {
    font-size: 13px;
  }

  .product-info .price {
    font-size: 15px;
  }

  .buy-btn {
    font-size: 17px;
    padding: 6px 12px;
  }

  .title {
    font-size: 18px;
  }
  .icon-size {
    font-size: 20px;
  }
}
