/* ===========================
   PAGE DE RECHERCHE
   =========================== */

.search-page {
  padding: 2rem 0;
  background: linear-gradient(135deg, #f8f5f0 0%, #fff 100%);
  min-height: calc(100vh - 200px);
}

.search-header {
  text-align: center;
  margin-bottom: 3rem;
}

.search-header h1 {
  color: #1a1a1a;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.search-bar {
  display: flex;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  overflow: hidden;
  background: white;
}

.search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: #999;
}

.btn-search {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #8b7355 0%, #d4a574 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-search:hover {
  background: linear-gradient(135deg, #6d5a44 0%, #b88a5f 100%);
  transform: translateX(-2px);
}

/* Layout de recherche */
.search-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Sidebar de filtres */
.filters-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f8f5f0;
}

.filters-header h2 {
  font-size: 1.5rem;
  color: #1a1a1a;
  margin: 0;
}

.btn-clear-filters {
  background: none;
  border: none;
  color: #d4a574;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.3s ease;
}

.btn-clear-filters:hover {
  color: #8b7355;
}

/* Groupes de filtres */
.filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-title {
  font-size: 1rem;
  color: #1a1a1a;
  margin-bottom: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-title i {
  color: #8b7355;
  font-size: 0.9rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.3s ease;
}

.filter-checkbox:hover {
  color: #8b7355;
}

.filter-checkbox input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #8b7355;
}

.filter-checkbox span {
  font-size: 0.95rem;
}

/* Catégories hiérarchiques */
.category-filter-group {
  margin-bottom: 0.5rem;
}

.subcategory-list {
  margin-left: 1.5rem;
  margin-top: 0.3rem;
  padding-left: 0.8rem;
  border-left: 2px solid #e0e0e0;
}

.subcategory-checkbox {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.subcategory-checkbox span {
  font-size: 0.85rem;
  color: #666;
}

/* Tags de filtres (pour tailles) */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  position: relative;
  cursor: pointer;
}

.filter-tag input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.filter-tag span {
  display: block;
  padding: 0.4rem 0.8rem;
  background: #f8f5f0;
  border: 2px solid #f8f5f0;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-tag input[type="checkbox"]:checked + span {
  background: #8b7355;
  color: white;
  border-color: #8b7355;
}

.filter-tag:hover span {
  border-color: #d4a574;
}

/* Filtre prix */
.filter-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.price-input {
  width: 70px;
  padding: 0.5rem;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.price-input:focus {
  border-color: #8b7355;
}

.btn-apply-price {
  width: 100%;
  padding: 0.6rem;
  background: linear-gradient(135deg, #8b7355 0%, #d4a574 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-apply-price:hover {
  background: linear-gradient(135deg, #6d5a44 0%, #b88a5f 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

/* Tri */
.sort-select {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  background: white;
  transition: border-color 0.3s ease;
}

.sort-select:focus {
  border-color: #8b7355;
}

/* Résultats */
.search-results {
  min-height: 400px;
}

.results-header {
  margin-bottom: 2rem;
}

.results-header h2 {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

/* Filtres actifs */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.active-filters-label {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 0.9rem;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: #8b7355;
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
}

.remove-filter {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.2rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.remove-filter:hover {
  transform: scale(1.2);
}

/* Grille de produits (réutiliser les styles existants) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Aucun résultat */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.no-results i {
  color: #d4a574;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ==========================
   RESPONSIVE - SEARCH PAGE
   ========================== */

/* Mobile - Téléphone (jusqu'à 767px) */
@media (max-width: 767px) {
  .search-page {
    padding: 1rem 0;
  }

  .search-header {
    margin-bottom: 2rem;
  }

  .search-header h1 {
    font-size: 1.75rem;
  }

  .search-bar {
    flex-direction: column;
    border-radius: 12px;
    max-width: 100%;
  }

  .search-input {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
  }

  .btn-search {
    justify-content: center;
    border-radius: 0 0 12px 12px;
    padding: 0.9rem 1.5rem;
  }

  .search-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .filters-sidebar {
    position: static;
    max-height: none;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .filters-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .filters-header h2 {
    font-size: 1.25rem;
  }

  .btn-clear-filters {
    width: 100%;
    justify-content: center;
  }

  .filter-group {
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .filter-title {
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    padding: 0.75rem;
    background: #f8f5f0;
    border-radius: 8px;
    margin-bottom: 0;
    position: relative;
  }

  .filter-title::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
  }

  .filter-title.active::after {
    transform: rotate(-180deg);
  }

  .filter-options,
  .filter-price,
  .filter-group .sort-select {
    display: none !important;
    max-height: 0;
    transition: all 0.3s ease-in-out;
  }

  .filter-options.show,
  .filter-price.show,
  .filter-group .sort-select.show {
    display: flex !important;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 500px;
    padding-top: 0.75rem;
    overflow-y: auto;
  }

  /* Pour les tags (tailles) */
  .filter-options.filter-tags.show {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filter-checkbox,
  .filter-tag {
    font-size: 0.9rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .results-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .results-header h2 {
    font-size: 1.1rem;
  }

  .sort-select {
    width: 100%;
  }

  .no-results {
    padding: 2rem 1rem;
  }

  .no-results i {
    font-size: 3rem;
  }

  .no-results p {
    font-size: 0.95rem;
  }
}

/* Tablette (768px à 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .search-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .filters-sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: 1fr;
  }

  .filters-header {
    margin-bottom: 1.25rem;
  }

  .filter-group {
    padding: 1.25rem 0;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .search-header h1 {
    font-size: 2.25rem;
  }

  .search-bar {
    max-width: 700px;
  }

  .results-header h2 {
    font-size: 1.3rem;
  }
}

/* Desktop / PC (1025px et plus) */
@media (min-width: 1025px) {
  .search-content {
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
  }

  .filters-sidebar {
    position: sticky;
    top: 100px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
  }

  .filter-checkbox:hover,
  .filter-tag:hover {
    background-color: rgba(139, 115, 85, 0.05);
  }
}
