/* стили для фильтра на главной странице */

.wrap {
    display: flex;
    /*margin: 0 85px;*/
  }
  .main__wrapper {
    width: 50%;
    margin-left: 20px;
  }
  .main__title {
    margin: 20px 0 20px 20px;
  }
  .main__results {
    width: 50%;
    margin-left: 20px;
    margin-right: 20px;
  }
  #map {
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  .filters {
    /*display: grid;*/
    /*grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));*/
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }
  .filter-group {
    display: flex;
    flex-direction: column;
  }
  label {
    margin-bottom: 5px;
    font-weight: bold;
  }
  select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  .buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }
  button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
  }
  .search-btn {
    background-color: #4CAF50;
    color: white;
  }
  .reset-btn {
    background-color: #f44336;
    color: white;
  }
  .checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
    height: 100%;
  }
  .checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }
  .checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
  }
  .checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
  }
  .checkbox-container input:checked ~ .checkmark {
    background-color: #4CAF50;
    border-color: #4CAF50;
  }
  .checkmark:after {
    content: "";
    position: absolute;
    display: none;
  }
  .checkbox-container input:checked ~ .checkmark:after {
    display: block;
  }
  .checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .checkbox-label {
    margin-left: 5px;
    font-weight: normal;
  }
  .products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .product-item {
    display: block;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
  }
  
  .product-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
  }
  
  .product-item__inner {
    padding: 15px;
  }
  
  .product-item__image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
  }
  
  .product-item__image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  
  .product-item__no-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    margin-bottom: 15px;
  }
  
  .product-item__title {
    font-size: 16px;
    margin: 0 0 10px;
    font-weight: 600;
    line-height: 1.3;
  }
  
  .product-item__price {
    font-weight: bold;
    font-size: 18px;
    color: #d32f2f;
    margin-bottom: 8px;
  }
  
  .product-item__stock {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .product-item__stock.in-stock {
    color: #388e3c;
  }
  
  .product-item__stock.out-of-stock {
    color: #f57c00;
  }
  
  .product-item__article {
    font-size: 13px;
    color: #666;
  }
  
  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
  }
  
  .pagination button {
    border: 1px solid #ddd;
    background: #fff;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
  }
  
  .pagination button:hover {
    background: #f5f5f5;
  }
  
  .pagination button.active {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
  }
  
  .pagination__dots {
    padding: 0 10px;
  }
  
  .loading,
  .no-results,
  .error {
    text-align: center;
    padding: 30px;
    grid-column: 1 / -1;
    font-size: 16px;
  }
  
  .loading {
    color: #666;
  }
  
  .error {
    color: #d32f2f;
  }
  /* Адаптив */
  @media (max-width: 1200px) {
  .wrap {
  flex-direction: column;
  margin: auto;
  }
  
  .main__wrapper, 
  .main__results {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  }
  
  .main__title {
  margin-left: 0;
  }
  }
  
  @media (max-width: 992px) {
  .products-list {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .product-item__image,
  .product-item__no-image {
  height: 150px;
  }
  }
  
  @media (max-width: 768px) {
  .filters {
  grid-template-columns: 1fr;
  }
  
  .buttons {
  flex-direction: column;
  }
  
  button {
  width: 100%;
  }
  
  .product-item__inner {
  padding: 10px;
  }
  
  .product-item__title {
  font-size: 14px;
  }
  
  .product-item__price {
  font-size: 16px;
  }
  }
  
  @media (max-width: 576px) {
  .products-list {
  grid-template-columns: 1fr;
  }
  
  #map {
  height: 350px;
  }
  
  .filter-group {
  margin-bottom: 10px;
  }
  
  .product-item__image,
  .product-item__no-image {
  height: 120px;
  }
  
  .pagination {
  gap: 3px;
  }
  
  .pagination button {
  padding: 3px 8px;
  font-size: 14px;
  }
  }
  
  
  @media (min-width: 577px) and (max-width: 768px) {
  .products-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  }
  
  @media (orientation: landscape) and (max-height: 500px) {
  #map {
  height: 300px;
  }
  
  .main__wrapper,
  .main__results {
  max-height: 80vh;
  overflow-y: auto;
  }
  }
  
  @media (pointer: coarse) {
  button, 
  .checkbox-container,
  select {
  min-height: 44px; /* Рекомендованный размер для касаний */
  }
  
  .product-item {
  border-width: 2px; /* Более заметные границы для мобильных */
  }
  }
  
  #product-search {
  padding: 8px;
  border: 1px solid #cecece;
  border-radius: 5px;
  }
  
  .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 20px 0;
  }
  
  .pagination a, 
  .pagination span {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-decoration: none;
  color: #333;
  border-radius: 3px;
  min-width: 15px;
  text-align: center;
  }
  
  .pagination a:hover {
  background-color: #f5f5f5;
  }
  
  .pagination .active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
  }
  
  .pagination .dots {
  padding: 8px 5px;
  border: none;
  }
  
  .results-info {
  text-align: center;
  margin: 10px 0;
  color: #666;
  font-size: 14px;
  }

  .searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    background: white;
    z-index: 1000;
    display: none;
}

.dropdown-option {
    padding: 8px;
    cursor: pointer;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-no-results {
    padding: 8px;
    color: #999;
    font-style: italic;
}

.highlight {
    background-color: yellow;
    font-weight: bold;
}
#product-group-search {
    text-align: left !important;
    padding-left: 8px;
    text-indent: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    outline: none;
}

/* Стили для поиска по брендам (аналогичны стилям для групп товаров) */
#brand-search {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#brand-options {
    display: none;
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#brand-options .dropdown-option {
    padding: 10px;
    cursor: pointer;
}

#brand-options .dropdown-option:hover {
    background-color: #f5f5f5;
}

#brand-options .dropdown-no-results {
    padding: 10px;
    color: #999;
    font-style: italic;
}

.searchable-select {
    position: relative;
}

#hist {
  cursor: pointer;
}

#hist:hover {
  color: rgb(255, 94, 0);
  text-decoration: underline;
}

.search_history {
  position: absolute;
  left: 53%;
  top: -200px;
  background: #ececec;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 1px 1px 6px #333;
  transform: translate(-50%);
  margin: 0 auto;
  -webkit-transform: translate(-50%);
  -moz-transform: translate(-50%);
  -ms-transform: translate(-50%);
  -o-transform: translate(-50%);
  z-index: 999;
}

.history_element {
  cursor: pointer;
}

.history_element:hover {
  color: rgb(255, 94, 0);
  text-decoration: underline;
}