/* Анимация появления карточек */
.card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Стили для панели фильтров */
#filterSidebar {
    z-index: 1050;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

#filterSidebar .filter-group {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#filterSidebar .filter-group:last-child {
    border-bottom: none;
}

#filterSidebar h6 {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

/* Кастомный стиль для чекбоксов */
.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: #3DCD58;
    cursor: pointer;
}

.filter-option span {
    color: #555;
    font-size: 0.95rem;
}

/* Стиль для ползунка цены */
.price-range-container {
    padding: 0 0.5rem;
}

.price-range-value {
    font-weight: 600;
    color: #3DCD58;
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3DCD58;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Стили для отображения товаров в одну колонку */
.products-grid.grid-1 {
  grid-template-columns: 1fr !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.products-grid.grid-1 .card {
  display: flex !important;
  flex-direction: row !important;
  max-width: 100% !important;
  height: auto !important;
  margin-bottom: 1.5rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  border: none !important;
  border-radius: 8px !important;
  overflow: visible !important;
}

.products-grid.grid-1 .card-img-top {
  width: 200px !important;
  height: 200px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  border-radius: 0 !important;
  padding: 1rem !important;
  background: #f8f9fa !important;
}

.products-grid.grid-1 .card-body {
  display: flex !important;
  flex-direction: column !important;
  padding: 1.5rem !important;
  flex-grow: 1 !important;
}

.products-grid.grid-1 .item-title {
  font-size: 1.25rem !important;
  margin-bottom: 0.75rem !important;
  color: #333 !important;
}

.products-grid.grid-1 .details-wrapper {
  margin-top: auto !important;
  width: 100% !important;
}

.products-grid.grid-1 .price {
  margin: 1rem 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.products-grid.grid-1 .price__currency {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #3DCD58 !important;
}

.products-grid.grid-1 .items {
  margin: 0.5rem 0 1rem 0 !important;
  width: auto !important;
  max-width: 120px !important;
}

/* Плавное появление изображений товаров при скролле */
.product-img {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
}
.product-img.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover .product-img.visible {
  transform: scale(1.07) translateY(0);
  box-shadow: 0 8px 24px rgba(61,205,88,0.16), 0 1.5px 5px rgba(0,0,0,0.07);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s cubic-bezier(.4,0,.2,1);
  /* z-index убран, чтобы не перекрывать кнопку */
}


.quick-view-btn {
  pointer-events: auto !important;
}

.quick-view-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000 !important;
  opacity: 1 !important;
  transition: opacity 0.2s;
  pointer-events: auto !important;
}
.card:hover .quick-view-btn,
.card:focus-within .quick-view-btn {
  opacity: 1;
}

/* Для совместимости: удалить .eye-icon если не используется */

/* --- PRODUCT SEARCH BAR --- */
.product-search-bar {
  background: #fff;
  border-radius: 2.2rem;
  box-shadow: 0 2px 12px rgba(61,205,88,0.07);
  padding: 3px 9px 3px 3px;
  min-width: 0;
  position: relative;
  transition: box-shadow 0.18s;
}
.product-search-bar:focus-within {
  box-shadow: 0 4px 18px rgba(61,205,88,0.13);
}
.stylish-search {
  border-radius: 2rem !important;
  border: none;
  background: #f8f9fa;
  font-size: 1.08rem;
  padding: 0.6rem 1.2rem;
  box-shadow: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.stylish-search:focus {
  background: #fff;
  box-shadow: 0 2px 8px rgba(61,205,88,0.13);
}
.product-search-bar .btn-success {
  border-radius: 2rem;
  padding: 0.55rem 1.1rem;
  font-size: 1.15rem;
}
.search-suggestions {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 1001;
  border-radius: 1.2rem;
  box-shadow: 0 8px 32px rgba(61,205,88,0.13);
  max-height: 340px;
  overflow-y: auto;
  padding: 0.4rem 0;
  font-size: 1.01rem;
  display: none;
}
.search-suggestions.show, .search-suggestions:not(.d-none) {
  display: block;
}
.search-suggestions .suggestion {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.16s;
}
.search-suggestions .suggestion:hover, .search-suggestions .suggestion.active {
  background: #f1fdf5;
  color: #3DCD58;
}
/* --- END PRODUCT SEARCH BAR --- */




/* Навигационное меню */
.navbar-nav {
  position: relative;
  gap: 0.5rem;
}

.nav-link {
  position: relative;
  color: #333;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none !important; /* Убираем подчеркивание */
  display: flex;
  align-items: center;
  height: 100%;
  border: none !important; /* Убираем рамки */
  outline: none !important; /* Убираем контур при фокусе */
}

/* Убираем стандартное подчеркивание Bootstrap */
.nav-link:focus,
.nav-link:hover {
  text-decoration: none !important;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: #3DCD58;
  background-color: rgba(61, 205, 88, 0.1);
}

.nav-link.active {
  color: #3DCD58;
  font-weight: 600;
}

/* Анимация для активного состояния */
@keyframes navLinkFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-item {
  opacity: 0;
  animation: navLinkFade 0.5s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }

/* Адаптивность */
@media (max-width: 991.98px) {
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-item {
    margin: 0.25rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* Кнопки фильтров */
.filter-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0 1rem 1rem;
}

.filter-buttons button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#resetFilters {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #666;
}

#resetFilters:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

#applyFilters {
    background: #3DCD58;
    border: none;
    color: white;
}

#applyFilters:hover {
    background: #35b84d;
}

/* Счетчик товаров */
#results-counter {
    font-size: 0.9rem;
    color: #666;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Сообщение, когда товары не найдены */
.no-results-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.no-results-message .material-symbols-outlined {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* Стили для переключения количества колонок в сетке */
.products-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.products-grid.animating {
  position: relative;
}

.products-grid.animating .card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 1 колонка */
.products-grid.grid-1 {
  grid-template-columns: repeat(1, 1fr);
  max-width: 800px;
  margin: 0 auto;
}

/* 2 колонки */
.products-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 колонки */
.products-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* 4 колонки */
.products-grid.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Адаптивность */
@media (max-width: 1200px) {
  .products-grid.grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid.grid-3,
  .products-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #filterSidebar {
    width: 280px;
  }
  
  .filter-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .filter-buttons button {
    width: 100%;
  }
  
  .products-grid.grid-2,
  .products-grid.grid-3,
  .products-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .products-grid.grid-1,
  .products-grid.grid-2,
  .products-grid.grid-3,
  .products-grid.grid-4 {
    grid-template-columns: 1fr;
  }
}
