/* Archive Container */
.if-archive-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.if-archive-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  width: 100%;
}

.if-archive-content--no-sidebar {
  grid-template-columns: 1fr;
}

.if-main {
  min-height: 400px;
  width: 100%;
}

/* Filter Toggle Button (mobile) */
.if-filters-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  margin-bottom: 20px;
  border: solid 1px black;
  border-radius: 0px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.if-filters-toggle:hover,
.if-filters-toggle:focus {
  background: transparent;
  border: solid 1px black;
  border-radius: 0px;
}

.if-filters-toggle:hover {
  background: #f9fafb;
  border-color: #0055B1;
}

.if-filters-toggle svg {
  width: 20px;
  height: 20px;
}

/* Filter Bar */
.if-filter-bar {
  position: sticky;
  top: 20px;
  z-index: 10;
  margin-bottom: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Search row: icon + input */
.if-filter-bar__search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.if-filter-bar__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

.if-filter-bar__input {
  flex: 1;
  border: none !important;
  font-size: 15px;
  padding: 0;
  outline: none !important;
  background: transparent;
  color: #1f2937;
}

.if-filter-bar__input::placeholder {
  color: #9ca3af;
}

.if-filter-bar__suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.if-filter-bar__suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.if-filter-bar__suggestion:hover,
.if-filter-bar__suggestion.is-active {
  background: #f9fafb;
}

.if-filter-bar__suggestion-label {
  font-size: 14px;
  color: #1f2937;
}

.if-filter-bar__suggestion-property {
  font-size: 12px;
  color: #6b7280;
  margin-left: 8px;
}

.if-filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 0;
  margin-top: 12px;
}

.if-filter-bar__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}

.if-filter-bar__chip-label {
  font-weight: 500;
}

.if-filter-bar__chip-property {
  font-size: 11px;
  color: #6b7280;
}

.if-filter-bar__chip-remove {
  border: none !important;
  background: transparent !important;
  border-radius: 2px;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  color: #6b7280 !important;
  transition: all 0.15s ease;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

.if-filter-bar__chip-remove svg,
.if-filter-bar__chip-remove i,
.if-filter-bar__chip-remove::before,
.if-filter-bar__chip-remove::after {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.if-filter-bar__chip-remove:hover {
  background: #e5e7eb;
  color: #374151;
}

.if-filter-bar__empty {
  padding: 12px 16px;
  font-size: 14px;
  color: #94a3b8;
}

.if-sidebar {
  background: transparent;
  height: fit-content;
}

/* Loading and Error States */
.if-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.if-error {
  background: #ffe6e6;
  border: 1px solid #ff9999;
  color: #cc0000;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
}

/* Active Filters Display */
.if-active-filters {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.if-active-filters h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.if-active-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.if-active-filter {
  background: #007cba;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.if-active-filter__remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  padding: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.if-active-filter__remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Results Count */
.if-results-count {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

/* Archive and Products Grid */
.if-archive {
  margin-bottom: 30px;
}

/* Products Grid - Base styles */
.if-products-grid {
  display: grid;
  gap: 30px;
  width: 100%;
}

/* Grid WITH sidebar (280px sidebar + main content) - MAX 4 kolommen */
.if-archive-content:not(.if-archive-content--no-sidebar) .if-products-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* Grid WITHOUT sidebar (full width) - MAX 5 kolommen */
.if-archive-content--no-sidebar .if-products-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* Responsive Grid WITH sidebar - blijft altijd max 4 kolommen */
@media (max-width: 1400px) {
  .if-archive-content:not(.if-archive-content--no-sidebar) .if-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive Grid WITHOUT sidebar - blijft altijd max 5 kolommen */
@media (max-width: 1400px) {
  .if-archive-content--no-sidebar .if-products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  /* Grid WITH sidebar - 2 kolommen op tablet */
  .if-archive-content:not(.if-archive-content--no-sidebar) .if-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* Grid WITHOUT sidebar - 2 kolommen op tablet */
  .if-archive-content--no-sidebar .if-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* Off-canvas filters */
  .if-filters-toggle {
    display: flex;
  }
  
  .if-archive-content {
    grid-template-columns: 1fr;
  }
  
  .if-filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  }
  
  .if-filter-sidebar.is-open {
    left: 0;
  }
  
  /* Overlay */
  .if-filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .if-filters-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
  }
}

@media (max-width: 640px) {
  /* Grid WITH sidebar - 1 kolom op mobiel */
  .if-archive-content:not(.if-archive-content--no-sidebar) .if-products-grid {
    grid-template-columns: 1fr;
  }
  
  /* Grid WITHOUT sidebar - 1 kolom op mobiel */
  .if-archive-content--no-sidebar .if-products-grid {
    grid-template-columns: 1fr;
  }
  
  .if-card {
    height: auto;
  }
}

.if-card__placeholder {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
}

.if-test-shortcode {
  background: #f0f0f0;
  padding: 20px;
  border: 2px solid #007cba;
  margin: 20px 0;
  border-radius: 8px;
}

.if-test-shortcode h3 {
  margin-top: 0;
  color: #007cba;
}

/* IF Filter Styles - Used by both shortcodes and SSR */
.if-filter {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background: #ffffff;
}

.if-filter__title {
  padding: 0px;
  margin: 0 0 0 0;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

/* Filter Toggle Button (for collapsed properties) */
.if-filter__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  margin: 0 0 0 0;
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.2s;
}

.if-filter__toggle:hover {
  color: #007cba;
}

.if-filter__toggle-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  color: #666;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 6px;
}

.if-filter__toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.if-filter__toggle[aria-expanded="true"] .if-filter__toggle-icon {
  transform: rotate(90deg);
}

/* Always show toggle button for accordion */
.if-filter__title .if-filter__toggle {
  display: flex;
}

/* Desktop: filters are always expanded, no toggle button */
.if-filter__title {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.if-filter__title button {
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
}

.if-filter__title button:hover,
.if-filter__toggle[aria-expanded="true"] {
  background: transparent;
}

.if-filter__toggle[aria-expanded="false"] {
  background-color: transparent;
}

.if-filter__toggle {
  display: none; /* Hidden on desktop by default */
}

.if-filter__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
  row-gap: 0px;
}

/* Mobile: show toggle button and allow collapsing */
@media (max-width: 1024px) {
  .if-filter__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: left;
  }
  
  .if-filter__toggle-icon {
    transition: transform 0.2s ease;
  }
  
  .if-filter--expanded .if-filter__toggle-icon {
    transform: rotate(90deg);
  }
  
  .if-filter--collapsed .if-filter__title {
    margin-bottom: 0;
  }
  
  .if-filter--collapsed .if-filter__options {
    display: none;
  }
  
  .if-filter--expanded .if-filter__options {
    display: flex;
  }
}

.if-filter__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
  row-gap: 0px;
}

.if-filter__option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s;
}

.if-filter__option:hover {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 5px 8px;
  margin: 0 -8px;
}

.if-filter__checkbox,
.if-filter__radio {
  margin: 0;
  cursor: pointer;
}

.if-filter__select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s;
}

.if-filter__select:hover {
  border-color: #007cba;
}

.if-filter__select:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.if-filter__label {
  font-size: 14px;
  color: #555;
  flex: 1;
}

.if-filter__count {
  font-size: 12px;
  color: #999;
  margin-left: auto;
}

/* Accordion */
.if-filter__options-hidden {
  display: none;
}

.if-filter__accordion-toggle {
  margin-top: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  color: #007cba;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.if-filter__accordion-toggle:hover {
  background: #f0f8ff;
  border-color: #007cba;
}

.if-filter__accordion-count {
  color: #999;
  font-weight: normal;
}


/* Color Swatches */
.if-filter__options--color {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  align-items: start;
}

.if-filter__color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}

.if-filter__color-box {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.if-filter__color-swatch:hover .if-filter__color-box {
  border-color: #007cba;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.if-filter__checkbox--color:checked + .if-filter__color-box {
  border-color: #007cba;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.if-filter__checkbox--color {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.if-filter__color-pattern {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: inherit;
}

.if-filter__color-label {
  font-size: 11px;
  color: #666;
  line-height: 1.2;
  word-break: break-word;
  max-width: 60px;
}

.if-filter__color-swatch .if-filter__count {
  font-size: 10px;
  color: #999;
  margin-top: -2px;
}

/* Range Slider */
.if-filter__options--range {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.if-filter__range-display {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  padding: 8px 0;
}

.if-filter__range-separator {
  margin: 0 8px;
  color: #666;
}

.if-filter__range-slider-wrapper {
  position: relative;
  padding: 20px 0;
  height: 20px; /* Ruimte voor thumbs (20px hoog) */
}

/* Visuele track achtergrond - gecentreerd tussen thumbs */
.if-filter__range-slider-wrapper::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  z-index: 1;
}

/* Zorg dat beide sliders echt over elkaar liggen */
/* Belangrijk: geen zichtbare track op de inputs zelf */
.if-filter__range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: transparent !important;
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* WebKit track transparant */
.if-filter__range-slider::-webkit-slider-runnable-track {
  background: transparent !important;
}

/* Firefox track transparant */
.if-filter__range-slider::-moz-range-track {
  background: transparent !important;
}

.if-filter__range-slider--min,
.if-filter__range-slider--max {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

/* Z-index swap alleen voor de input-laag (niet voor track, want die is nu transparant) */
.if-filter__range-slider--max {
  z-index: 3;
}

.if-filter__range-slider--min {
  z-index: 2;
}

.if-filter__range-slider--min:active,
.if-filter__range-slider--min:focus {
  z-index: 5;
}

/* Thumb altijd boven alles */
.if-filter__range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007cba;
  position: relative;
  z-index: 10;
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
  pointer-events: auto;
}

.if-filter__range-slider::-webkit-slider-thumb:hover {
  background: #005a87;
}

.if-filter__range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.if-filter__range-slider::-webkit-slider-thumb:hover {
  background: #005a87;
}

.if-filter__range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007cba;
  position: relative;
  z-index: 10;
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
  pointer-events: auto;
}

.if-filter__range-slider::-moz-range-thumb:active {
  cursor: grabbing;
}

.if-filter__range-slider::-moz-range-thumb:hover {
  background: #005a87;
}

.if-filter__range-slider::-ms-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007cba;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.if-filter__range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.if-filter__range-min,
.if-filter__range-max {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

.if-filter__range-min:focus,
.if-filter__range-max:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Number Input */
.if-filter__options--number {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.if-filter__number-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  transition: border-color 0.2s;
}

.if-filter__number-input:hover {
  border-color: #007cba;
}

.if-filter__number-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.if-filter__number-input::placeholder {
  color: #999;
}

/* Toggle Switch */
.if-filter__options--toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.if-filter__toggle-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.if-filter__toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.if-filter__toggle-slider {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  background: #ccc;
  border-radius: 32px;
  transition: background 0.3s;
  overflow: hidden;
}

.if-filter__toggle-slider::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.if-filter__toggle-input:checked + .if-filter__toggle-slider {
  background: #007cba;
}

.if-filter__toggle-input:checked + .if-filter__toggle-slider::before {
  transform: translateX(28px);
}

.if-filter__toggle-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}

.if-filter__toggle-label--off {
  left: 8px;
  opacity: 1;
}

.if-filter__toggle-label--on {
  right: 8px;
  opacity: 0;
}

.if-filter__toggle-input:checked + .if-filter__toggle-slider .if-filter__toggle-label--off {
  opacity: 0;
}

.if-filter__toggle-input:checked + .if-filter__toggle-slider .if-filter__toggle-label--on {
  opacity: 1;
}

.if-filter__toggle-wrapper:hover .if-filter__toggle-slider {
  box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
}

.if-filter__toggle-input:focus + .if-filter__toggle-slider {
  box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.2);
}

/* Star Rating */
.if-filter__options--rating {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.if-filter__stars-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.if-filter__rating-input {
  display: none;
}

.if-filter__star-label {
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  padding: 2px;
}

.if-filter__star-label:hover {
  color: #fbbf24;
}

.if-filter__star-label.is-on {
  color: #fbbf24;
}

/* Rating stars: JavaScript adds is-on class for highlighting */

/* Unknown color fallback */
.if-filter__color-box--unknown {
  background: transparent;
  background-image: 
    repeating-linear-gradient(45deg, #f0f0f0 0px, #f0f0f0 4px, transparent 4px, transparent 8px);
  position: relative;
}

.if-filter__color-unknown-icon {
  color: #dc3545;
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.if-filter-empty {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Filter Group Styles */
.if-filter-group {
  margin-bottom: 30px;
}

.if-filter-group__title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  border-bottom: 2px solid #007cba;
  padding-bottom: 10px;
}

.if-filter-group__filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Filter Sidebar Styles */
.if-filter-sidebar {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 0px;
  margin-bottom: 20px;
}

/* Desktop sidebar - show header with Clear All, hide close button and footer */
.if-filter-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 5px 5px 0px 0px;
}

.if-filter-sidebar__title {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.if-filter-sidebar__clear {
  background: transparent;
  color: #666;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.if-filter-sidebar__clear:hover {
  background: #f3f4f6;
  border-color: #d0d0d0;
  color: #333;
}

/* Close button is dynamically added by JavaScript for mobile only */
.if-filter-sidebar__close {
  display: none; /* Hidden on desktop */
}

.if-filter-sidebar__content {
  margin: 0px 15px;
  margin-bottom: 0;
}

/* Footer with action buttons - hidden on desktop */
.if-filter-sidebar__footer {
  display: none;
}

.if-filter-sidebar__clear-btn {
  background: transparent;
  color: #666;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  flex: 0 0 auto;
}

.if-filter-sidebar__clear-btn:hover {
  background: #f3f4f6;
  border-color: #d0d0d0;
  color: #333;
}

.if-filter-sidebar__apply-btn {
  background: #0055B1;
  color: white;
  border: solid 1px #2A3FF4;
  padding: 10px 20px;
  border-radius: 0px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  flex: 1;
}

.if-filter-sidebar__apply-btn:hover {
  background: #004494;
}

@media (max-width: 1024px) {
  .if-filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  
  .if-filter-sidebar.is-open {
    left: 0;
  }
  
  /* Show header on mobile */
  .if-filter-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 0;
    background: #0055B1;
    color: white;
    border-bottom: none;
  }
  
  .if-filter-sidebar__header .if-filter-sidebar__title {
    display: block;
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: white;
  }
  
  /* Hide Clear All button on mobile (use footer instead) */
  .if-filter-sidebar__clear {
    display: none;
  }
  
  .if-filter-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none !important;
    background: transparent;
    cursor: pointer;
    font-size: 28px;
    font-weight: 600;	
    line-height: 1;
    color: white;
    padding: 0;
    margin-left: auto;
  }

  .if-filter-sidebar__close:hover {
    opacity: 0.8;
  }
  
  .if-filter-sidebar__content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 0;
  }
  
  /* Show footer on mobile */
  .if-filter-sidebar__footer {
    display: flex;
    gap: 12px;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 15px 20px;
    margin-top: 0;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* Legacy instant-filter styles for backward compatibility */
.instant-filter {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
}

.instant-filter-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.instant-filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instant-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 0;
}

.instant-filter-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.option-label {
  font-size: 14px;
  color: #555;
}

.option-count {
  font-size: 12px;
  color: #999;
  margin-left: auto;
}

.instant-filter-option:hover {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 5px 8px;
  margin: 0 -8px;
}

/* IF Card Styles - Used by both SSR and regular rendering */
.if-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.if-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.if-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.if-card__image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
}

.if-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.1s ease-in;
}

.if-card__image img.loaded {
  opacity: 1;
}

.if-card__content {
  padding: 16px;
}

.if-card__title {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.if-card__title a {
  color: #333;
  text-decoration: none;
}

.if-card__title a:hover {
  color: #007cba;
}

.if-card__price {
  font-size: 19px;
  font-weight: bold;
  color: #007cba;
}

.price {
  font-size: 19px;
}

.if-card__price .price {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.woocommerce-Price-amount {
  font-size: 19px;
}

/* Pagination */
.if-pagination {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.if-pagination__list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.if-pagination__item {
  margin: 0;
}

.if-pagination__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: white;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.if-pagination__link:hover {
  border-color: #007cba;
  background: #f0f8ff;
  color: #007cba;
}

.if-pagination__item.is-current .if-pagination__link {
  border-color: #007cba;
  background: #007cba;
  color: white;
  cursor: default;
}

.if-pagination__item.is-current .if-pagination__link:hover {
  background: #007cba;
  color: white;
}

.if-pagination__link--prev,
.if-pagination__link--next {
  font-size: 20px;
  font-weight: bold;
}

.if-pagination__item--ellipsis {
  padding: 0 8px;
  color: #999;
}

/* Product Cards */
.if-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 350px;
  max-height: none;
  padding: 20px;
  border-radius: 5px;
  background: #fff;
  transition: box-shadow 0.2s ease;
  box-sizing: border-box;
}

.if-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hide WooCommerce added_to_cart message in cards */
.if-card .added_to_cart {
  display: none;
}

/* Productafbeelding */
.if-card__image-wrapper {
  flex-shrink: 0;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.if-card__image-link {
  display: block;
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 aspect ratio - prevents stretching */
  overflow: hidden;
}

.if-card__image-link img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  max-width: 100%;
  max-height: 100%;
}

/* Header: titel + voorraad */
.if-card__header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 80px; /* Fixed height for title (2 lines) + stock status */
  max-height: 80px;
  border: none;
}

.if-card__title {
  margin: 0;
  font-size: inherit;
  font-weight: bold;
  line-height: 1.4;
  flex: 0 0 auto;
  min-height: 44px; /* Fixed height for 2 lines of title */
  max-height: 44px;
}

.if-card__title a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 100%;
}

.if-card__title a:hover {
  text-decoration: underline;
}

/* Voorraad status */
.if-card__stock {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
  flex: 0 0 auto;
  min-height: 24px; /* Fixed height for stock status */
  max-height: 24px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.if-card__stock.status-groen {
  background: #e8f5e9;
  color: #2e7d32;
}

.if-card__stock.status-oranje {
  background: #fff3e0;
  color: #f57c00;
}

.if-card__stock.status-rood {
  background: #ffebee;
  color: #c62828;
}

.if-card__stock.status-grijs {
  background: #f5f5f5;
  color: #757575;
}

/* Footer: prijs + button */
.if-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  flex: 0 0 auto;
  min-height: 45px; /* Fixed height for price + button alignment */
  max-height: 45px;
}

.if-card__price {
  flex: 1;
  font-size: 19px;
  font-weight: bold;
  color: #1D1D1B;
  min-height: 24px; /* Fixed height for price */
  max-height: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.if-card__price .price {
  margin: 0;
  color: #1D1D1B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Variable product "From" text styling */
.if-card__price .if-price-from {
  font-size: 0.85em;
  font-weight: normal;
  opacity: 0.8;
  margin-right: 4px;
}

/* Add to cart button - Consistent shape for all card buttons */
.if-card__button,
.if-card__button.if-button,
a.if-card__button,
a.if-card__button.if-button,
button.if-card__button,
button.if-card__button.if-button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  min-width: 45px;
  min-height: 45px;
  border: none;
  border-radius: 50%;
  background: #0055B1;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  position: relative;
}

.if-card__button svg,
.if-card__button i,
.if-card__button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  display: block;
}

.if-card__button:hover:not(:disabled),
a.if-card__button:hover {
  background: #049326;
  transform: scale(1.05);
}

.if-card__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state */
.if-card__button.is-loading {
  pointer-events: none;
}

.if-card__button.is-loading i,
.if-card__button.is-loading svg {
  animation: if-spin 0.6s linear infinite;
  transform: translate(-50%, -50%) rotate(0deg);
  position: absolute;
  top: 50%;
  left: 50%;
}

/* Success state */
.if-card__button.is-added {
  background: #049326;
}

/* Error state */
.if-card__button.is-error {
  background: #c62828;
}

@keyframes if-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Performance Metrics */
.if-performance {
  margin-top: 40px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.if-performance__title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1b;
}

.if-performance__section {
  margin-bottom: 24px;
}

.if-performance__section:last-child {
  margin-bottom: 0;
}

.if-performance__section-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.if-performance__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.if-performance__metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.if-performance__label {
  font-size: 13px;
  color: #6c757d;
  font-weight: 500;
}

.if-performance__value {
  font-size: 14px;
  color: #1d1d1b;
  font-weight: 600;
}

.if-performance__client {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  min-height: 60px;
}

.if-performance__loading {
  margin: 0;
  color: #6c757d;
  font-size: 13px;
  font-style: italic;
}

.if-performance__client-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.if-performance__client-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.if-performance__client-label {
  font-size: 12px;
  color: #6c757d;
}

.if-performance__client-value {
  font-size: 13px;
  color: #1d1d1b;
  font-weight: 600;
}

.if-performance__client-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.if-performance__client-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.if-performance__client-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #333;
  text-transform: capitalize;
}

.if-performance__client-metric {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 4px;
}

.if-performance__client-metric .if-performance__client-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.if-performance__client-metric .if-performance__client-value {
  font-size: 14px;
  font-weight: 600;
  color: #007cba;
}

