@import 'variables.css';
.cards .container:not(.title) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 12px;
  margin-top: var(--block-margin);
}
.cards .title {
  display:flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.cards .container.title h1 {
  font-weight: 400;
}
.cards .container .item {
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid transparent;
  transition: .2s;
}
.cards .container .item:hover {
  border: 1px solid var(--primary);
}
.cards .container .item:hover a {
  background-color: var(--white);

}

.cards .container .item img {
  width: 100%;
  height: 150px;
}
.cards .container .item .item-text {
  padding: 10px 5px 5px 5px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cards .container .item .item-text h1 {
  font-size: var(--card-title);
  line-height: 1.2em;
  height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-info {
  margin: 0 0 20px 0;
}
.cards .container .item .item-text .card-info div {
  display: flex;
  justify-content: space-between;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.32);
  padding: 1px 0;
  margin: 7px 0 0 0;
}
.cards .container .item .item-text .card-info div span:nth-child(1) {
  color: #222;
  opacity: 0.5;
  font-size: 15px;
}
.cards .container .item .item-text .button {
  text-align: center;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  width: 100%;
  padding: 9px 0;
  margin: auto 0 0 0;
  font-size: 20px;
}

.image-wrapper {
  width: 100%;
  overflow: hidden;
}

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

:root {
  --primary: #007bff; /* заменяй на свой основной цвет */
  --text-color: #333;
  --background-color: #fff;
  --border-radius: 8px;
  --transition: 0.3s ease;
}

.pagination-container {
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.page-numbers .dots {
  padding: 0.5rem 0.75rem;
  color: #999;
  font-weight: bold;
  user-select: none;
}

.sort-wrapper {
  position: relative;
  display: inline-block;
  font-family: sans-serif;
}

.sort-button {
  background-color: var(--primary);
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.sort-menu {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  min-width: 220px;
  z-index: 10;
  padding: 10px;
}
@media(max-width: 392px) {
  .sort-menu {
    left: 0;
  }
}
.sort-group {
  margin-bottom: 10px;
}
.active_sort {
  color: red;
}

.sort-group:last-child {
  margin-bottom: 0;
}

.sort-group-title {
  font-weight: bold;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

.sort-menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.sort-menu a:hover {
  background-color: #f0f0f0;
}
.page-numbers a,
.page-numbers span {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--primary);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
  font-size: 1rem;
  min-width: 2.5rem;
  text-align: center;
}

.page-numbers a:hover {
  background-color: var(--primary);
  color: #fff;
}

.page-numbers .current-page {
  background-color: var(--primary);
  color: #fff;
  font-weight: bold;
  cursor: default;
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.nav-link {
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
}

.nav-link:hover {
  opacity: 0.9;
}

/* Адаптивность */
@media (max-width: 600px) {
  .page-numbers a,
  .page-numbers span,
  .nav-link {
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
  }
}
