/**
 * Search and Filter Styles
 * Styled to match the site's design system
 */

.custom-webshop-search-form {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.custom-webshop-search-form .search-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--color-text, #666666);
  background-color: var(--color-bg-light, #ffffff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.custom-webshop-search-form .search-input:focus {
  outline: none;
  border-color: var(--color-primary, #e80000);
  box-shadow: 0 0 0 3px rgba(232, 0, 0, 0.1);
}

.custom-webshop-search-form .search-submit {
  padding: 0.875rem 2rem;
  background-color: var(--color-primary, #e80000);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  font-family: inherit;
}

.custom-webshop-search-form .search-submit:hover {
  background-color: var(--color-primary-dark, #cc0000);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.custom-webshop-search-form .search-submit:active {
  transform: translateY(0);
}

.search-results {
  margin-top: 1.5rem;
}

/* Filter container - styles already defined in main.css but ensuring consistency */
.custom-webshop-filters {
  background: var(--color-bg-light, #ffffff);
  padding: 2.5rem;
  border-radius: var(--border-radius, 12px);
  margin: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

.custom-webshop-filters .filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.custom-webshop-filters .filter-header h3 {
  margin: 0;
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #666666);
}

.custom-webshop-filters .filter-content {
  display: block;
}

.custom-webshop-filters .filter-group {
  margin-bottom: 2rem;
}

.custom-webshop-filters .filter-group:last-child {
  margin-bottom: 0;
}

/* Filter row layout - always vertical stack */
.filter-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-row .filter-group {
  width: 100%;
  margin-bottom: 0;
}

.filter-range-inputs {
  display: flex;
  gap: 0.75rem;
}

.filter-range-inputs input {
  flex: 1;
}

/* Price range double-handle slider */
.filter-price-slider-wrapper {
  margin-top: 0.5rem;
}

.filter-price-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text, #333);
}

.filter-price-slider-labels .filter-price-label-min {
  flex-shrink: 0;
}

.filter-price-slider-labels .filter-price-label-max {
  flex-shrink: 0;
}

.filter-price-slider {
  margin-bottom: 0;
  max-width: 100%;
}

.filter-price-slider-wrapper .filter-min-price,
.filter-price-slider-wrapper .filter-max-price {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* noUiSlider theme overrides */
.custom-webshop-filters .filter-price-slider.noUi-target {
  margin: 0.75rem 0;
}

.custom-webshop-filters .filter-price-slider .noUi-connect {
  background: var(--color-primary, #e80000);
}

.custom-webshop-filters .filter-price-slider .noUi-handle {
  border-color: var(--color-primary, #e80000);
}

.custom-webshop-filters .filter-price-slider .noUi-handle:after,
.custom-webshop-filters .filter-price-slider .noUi-handle:before {
  background: var(--color-primary, #e80000);
}

.custom-webshop-filters label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--color-text, #666666);
  font-size: 0.9375rem;
}

.custom-webshop-filters .filter-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0;
}

.custom-webshop-filters .filter-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary, #e80000);
}

.custom-webshop-filters select,
.custom-webshop-filters input[type="number"],
.custom-webshop-filters input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--color-text, #666666);
  background-color: var(--color-bg-light, #ffffff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.custom-webshop-filters select:focus,
.custom-webshop-filters input[type="number"]:focus,
.custom-webshop-filters input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary, #e80000);
  box-shadow: 0 0 0 3px rgba(232, 0, 0, 0.1);
}

.custom-webshop-filters .filter-apply,
.custom-webshop-filters .filter-reset {
  padding: 0.875rem 2rem;
  margin-right: 0.75rem;
  margin-top: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  font-family: inherit;
}

.custom-webshop-filters .filter-apply {
  background-color: var(--color-primary, #e80000);
  color: #fff;
}

.custom-webshop-filters .filter-apply:hover {
  background-color: var(--color-primary-dark, #cc0000);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.custom-webshop-filters .filter-apply:active {
  transform: translateY(0);
}

.custom-webshop-filters .filter-reset {
  background-color: var(--color-border, #e5e7eb);
  color: var(--color-text, #666666);
}

.custom-webshop-filters .filter-reset:hover {
  background-color: var(--color-text-light, #999999);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.custom-webshop-filters .filter-reset:active {
  transform: translateY(0);
}

/* Pagination Styles */
.custom-webshop-pagination {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: none;
}

.custom-webshop-pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.custom-webshop-per-page {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.custom-webshop-per-page label {
  font-weight: 500;
  color: var(--color-text, #666666);
  font-size: 0.9375rem;
}

.custom-per-page-select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background-color: var(--color-bg-light, #ffffff);
  font-size: 0.9375rem;
  color: var(--color-text, #666666);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.custom-per-page-select:hover {
  border-color: var(--color-primary, #e80000);
}

.custom-per-page-select:focus {
  outline: none;
  border-color: var(--color-primary, #e80000);
  box-shadow: 0 0 0 3px rgba(232, 0, 0, 0.1);
}

.custom-webshop-pagination .page-numbers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.custom-webshop-pagination .page-numbers li {
  margin: 0;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
}

.custom-webshop-pagination .page-numbers a,
.custom-webshop-pagination .page-numbers span:not(.current):not(.dots) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center;
  text-decoration: none;
  border: none !important;
  border-radius: 8px;
  color: var(--color-text, #666666);
  background-color: var(--color-bg-light, #ffffff);
  transition: all 0.2s ease;
  font-weight: 500;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.custom-webshop-pagination .page-numbers a:hover {
  background-color: var(--color-primary, #e80000) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-weight: 600 !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.custom-webshop-pagination .page-numbers .current {
  background-color: var(--color-primary, #e80000) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-weight: 600 !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.custom-webshop-pagination .page-numbers .dots {
  border: none !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--color-text-light, #999999);
}

.custom-webshop-pagination .page-numbers .prev,
.custom-webshop-pagination .page-numbers .next {
  font-weight: 600;
}

/* Tag Autocomplete Styles */
.tag-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.tag-autocomplete-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--color-text, #666666);
  background-color: var(--color-bg-light, #ffffff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.tag-autocomplete-input:focus {
  outline: none;
  border-color: var(--color-primary, #e80000);
  box-shadow: 0 0 0 3px rgba(232, 0, 0, 0.1);
}

.tag-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-height: 30px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background-color: var(--color-primary, #e80000);
  color: #fff;
  border-radius: 16px;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 500;
}

.tag-chip-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  font-weight: bold;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  padding: 0 0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tag-autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-light, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
  display: none;
  margin-top: -1px; /* Overlap border with input */
}

.tag-autocomplete-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  transition: background-color 0.2s ease;
  color: var(--color-text, #666666);
  font-size: 0.9375rem;
}

.tag-autocomplete-item:hover {
  background-color: var(--color-bg, #ffffff);
}

.tag-autocomplete-item:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .custom-webshop-search-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .custom-webshop-search-form .search-submit {
    width: 100%;
  }

  .custom-webshop-filters {
    padding: 1.5rem;
    position: static;
  }

  .custom-webshop-filters .filter-group {
    margin-bottom: 1.5rem;
  }

  .custom-webshop-filters .filter-apply,
  .custom-webshop-filters .filter-reset {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.75rem;
  }

  .custom-webshop-filters .filter-reset {
    margin-bottom: 0;
  }

  .custom-webshop-pagination-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .custom-webshop-per-page {
    width: 100%;
  }
}
