/* ОСНОВНОЙ КОНТЕЙНЕР */
.search-results-map-container {
  display: flex;
  gap: 30px;
  margin: 30px 0;
  width: 100%;
  /* max-width: 1400px; */
  margin-left: auto;
  margin-right: auto;
}

.left-column {
  flex: 2.3;
  min-width: 0;
}

.right-column {
  flex: 2;
  min-width: 300px;
}

/* КАРТА */
.map-section {
  width: 100%;
  margin-top: 0;
}

#map {
  width: 100%;
  height: 750px;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 20px;
}

/* ОСНОВНЫЕ СТИЛИ ФОРМЫ */
.search-form-section {
  margin-bottom: 30px;
}

.search-form-wrapper {
  margin: 0;
  padding: 0;
}

.search-form-container {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.input-with-suggestions {
  display: flex;
  gap: 0.8em;
  position: relative;
  width: 100%;
}

#queryField {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  background-color: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#queryField:focus {
  outline: none;
  border-color: #0d5920;
  box-shadow: 0 4px 12px rgba(13, 89, 32, 0.15);
}

#queryField::placeholder {
  color: #999;
}

.form-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.form-control {
  display: flex;
  align-items: center;
}

.in-stock-control {
  padding: 8px 16px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.in-stock-control:hover {
  border-color: #0d5920;
  background: #f0f7f2;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  color: #444;
  margin: 0;
}

.checkbox-custom {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #0d5920;
  border-radius: 4px;
  background: white;
  transition: all 0.3s ease;
}

#inStockCheckbox {
  display: none;
}

#inStockCheckbox:checked + .checkbox-label .checkbox-custom {
  background: #0d5920;
  border-color: #0d5920;
}

#inStockCheckbox:checked + .checkbox-label .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-weight: 500;
  color: #333;
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 52px;
}

.btn-primary {
  background: #26863c;
  color: white;
  /* box-shadow: 0 4px 12px rgba(13, 89, 32, 0.2); */
}

.btn-primary:hover {
  background: linear-gradient(135deg, #10472b 0%, #0d5920 100%);
  /* transform: translateY(-2px); */
  /* box-shadow: 0 6px 16px rgba(13, 89, 32, 0.3); */
}

.btn-primary:active {
  transform: translateY(0);
  /* box-shadow: 0 2px 8px rgba(13, 89, 32, 0.2); */
}

.btn-secondary {
  background: #d88027;
  color: #fff;
}

.btn-secondary:hover {
  background: #c36b14;
  /* transform: translateY(-2px); */
}

.btn-secondary:active {
  /* transform: translateY(0); */
}

.btn-icon {
  margin-right: 8px;
  font-size: 18px;
}

.btn-text {
  white-space: nowrap;
}

.reset-icon {
  font-size: 18px;
  font-weight: bold;
}

/* СТИЛИ ПОДСКАЗОК */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
  margin-top: 4px;
}

.search-suggestion {
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  font-size: 15px;
  color: #333;
  line-height: 1.4;
}

.search-suggestion:hover {
  background-color: #f8f9fa;
  color: #0d5920;
}

.search-suggestion:last-child {
  border-bottom: none;
}

/* СТИЛИ РЕЗУЛЬТАТОВ */
.main__results {
  margin-top: 0;
  width: 100%;
}

#searchResults {
  margin-top: 0;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 18px;
  background: #f8f9fa;
  border-radius: 5px;
  margin: 20px 0;
}

.error {
  color: #dc3545;
  padding: 20px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 5px;
  margin: 20px 0;
  text-align: center;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
  background: #f8f9fa;
  border-radius: 5px;
  margin: 20px 0;
  line-height: 1.6;
}

/* СТИЛИ ТОВАРОВ - 3 В РЯД */
.products-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.product-item {
  display: block;
  text-decoration: none;
  color: inherit;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: #0d5920;
}

.product-item__inner {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-item__image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.product-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.3s ease;
}

.product-item:hover .product-item__image img {
  transform: scale(1.05);
}

.product-item__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px 0;
  line-height: 1.4;
  color: #333;
  min-height: 40px;
  overflow: hidden;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
}

.product-item__article {
  color: #666;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.3;
}

.product-item__price {
  font-weight: 700;
  color: #d32f2f;
  margin: 10px 0;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-item__price div:first-child {
  font-size: 18px;
}

.product-item__vendor {
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.product-item__stock {
  font-size: 13px;
  border-radius: 6px;
  display: inline-block;
  font-weight: 600;
}

.product-item__stock.in-stock {
  color: #155724;
}

.product-item__stock.out-of-stock {
  background-color: #f8d7da;
  color: #721c24;
  padding: 2px 6px;
}

.add-to-cart-btn {
  background: #26863c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #10472b 0%, #0d5920 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 89, 32, 0.2);
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1200px) {
  .search-results-map-container {
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    padding: 0 20px;
  }
  
  .right-column {
    min-width: 100%;
    order: 1;
  }
  
  .left-column {
    order: 2;
  }
  
  #map {
    height: 300px;
    position: static;
  }
  
  .products-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .search-form-container {
    padding: 0;
  }
  
  .form-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-controls {
    justify-content: flex-start;
  }
  
  .action-buttons {
    justify-content: center;
    width: 100%;
  }
  
  .products-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .product-item__image {
    height: 140px;
  }
}

@media (max-width: 768px) {
  .search-results-map-container {
    margin: 20px 0;
    padding: 0 16px;
  }
  
  .search-form-wrapper {
    margin: 0;
  }
  
  .input-group {
    gap: 16px;
  }
  
  #queryField {
    padding: 14px 20px;
    font-size: 15px;
  }
  
  .form-controls {
    gap: 16px;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .in-stock-control {
    width: 100%;
    justify-content: center;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  
  .btn-secondary {
    width: 100%;
    min-height: 48px;
  }
  
  #map {
    height: 250px;
  }
  
  .products-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .product-item__inner {
    padding: 16px;
  }
  
  .product-item__image {
    height: 160px;
  }
  
  .product-item__title {
    font-size: 15px;
    min-height: 42px;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 480px) {
  .search-results-map-container {
    padding: 0 12px;
  }
  
  #queryField {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .checkbox-text {
    font-size: 14px;
  }
  
  .btn-primary, .btn-secondary {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 48px;
  }
  
  .btn-icon {
    font-size: 16px;
  }
  
  #map {
    height: 200px;
  }
  
  .products-list {
    gap: 12px;
  }
  
  .product-item__image {
    height: 140px;
  }
  
  .product-item__title {
    font-size: 14px;
    min-height: 38px;
  }
  
  .product-item__price {
    font-size: 14px;
  }
  
  .product-item__price div:first-child {
    font-size: 16px;
  }
}

/* АНИМАЦИИ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-suggestions {
  animation: fadeIn 0.2s ease-out;
}

.product-item {
  animation: fadeIn 0.3s ease-out;
}

/* УЛУЧШЕНИЯ ДЛЯ ФОКУСА И ДОСТУПНОСТИ */
#queryField:focus-visible {
  outline: 3px solid rgba(13, 89, 32, 0.3);
  outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
#inStockCheckbox:focus-visible + .checkbox-label .checkbox-custom {
  outline: 3px solid rgba(13, 89, 32, 0.3);
  outline-offset: 2px;
}

/* СКРОЛЛБАР ДЛЯ ПОДСКАЗОК */
.search-suggestions::-webkit-scrollbar {
  width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 8px 8px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}