/* ============================================
   ACTIVE FILTER PILLS
   ============================================ */


.awpa-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f8f8;
  border-radius: 8px;
  align-items: center;
}

.awpa-active-filters:empty {
  display: none;
}

.awpa-active-filters__label {
  font-weight: 600;
  font-size: 13px;  
  color: #666;
  margin-right: 4px;
  line-height: 1.2;  
}

.awpa-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px; 
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;  
  font-size: 13px;
  color: #333;
  transition: all 0.2s ease;
  line-height: 1.2;  
}

.awpa-filter-pill:hover {
  border-color: #000;
  background: #f5f5f5;
}

.awpa-filter-pill__remove {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  width: 14px !important;  
  height: 14px !important;  
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #666 !important;
  font-size: 16px !important;  
  line-height: 1 !important;
  transition: color 0.2s ease !important;
}

.awpa-filter-pill__remove:hover {
  color: #000;
}

.awpa-clear-all {
  margin-left: auto;
  padding: 4px 12px;  
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 16px; 
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;  
}

.awpa-clear-all:hover {
  background: #fff;
  color: #000;
}

/* ============================================
   FILTER CONTAINER - HORIZONTAL FLEX LAYOUT
   ============================================ */
.awpa-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

/* ============================================
   FILTER SECTIONS - HORIZONTAL CARDS
   ============================================ */
.awpa-filter {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 0 0 auto;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.awpa-filter:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.awpa-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition: background 0.2s ease;
  user-select: none;
  border-bottom: 1px solid transparent;
}

.awpa-filter[data-collapsed="false"] .awpa-filter__header {
  border-bottom-color: #e5e5e5;
}

.awpa-filter__header:hover {
  background: #fafafa;
}

.awpa-filter__label {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
}

.awpa-filter__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #666;
  font-size: 0;
  margin-left: 8px;
}

.awpa-filter__toggle::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: all 0.3s ease;
}

.awpa-collapsible[data-collapsed="false"] .awpa-filter__toggle {
  transform: rotate(180deg);
}

.awpa-filter__content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              padding 0.3s ease;
  padding: 0 16px;
}

.awpa-collapsible[data-collapsed="false"] .awpa-filter__content {
  max-height: 600px;
  opacity: 1;
  padding: 16px;
}

/* ============================================
   WIDER FILTERS (COLORS, BRANDS, ETC)
   ============================================ */
.awpa-filter--colors,
.awpa-filter--brands {
  min-width: 300px;
}

.awpa-filter--price {
  min-width: 280px;
}

/* ============================================
   COLOR SWATCHES
   ============================================ */
.awpa-swatches {
  display: grid;
  grid-template-columns: repeat(9, 36px);
  grid-template-rows: repeat(2, auto);
  gap: 8px;
  max-height: 80px; /* 2 rows of 36px + gap */
}

.awpa-swatch {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 2px solid #ddd !important;
  background-color: #ccc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.awpa-swatch:hover {
  border-color: #999 !important;
  transform: scale(1.15);
}

.awpa-swatch[aria-pressed="true"] {
  border-color: #000 !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
  transform: scale(1.1);
}

.awpa-swatch[aria-pressed="true"]::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

/* Always visible filters - top row */
.awpa-filters-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e5;
}

/* Active filter pills section */
.awpa-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;  
  background: #f8f8f8;
  border-radius: 8px;
  align-items: center;
}

/* Toggle button for secondary filters */
.awpa-filters-toggle {
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.awpa-filters-toggle:hover {
  background: #fafafa;
  border-color: #000;
}

.awpa-filters-toggle-icon {
  transition: transform 0.3s ease;
}

.awpa-filters-toggle[aria-expanded="true"] .awpa-filters-toggle-icon {
  transform: rotate(180deg);
}

/* Secondary filters - collapsible group */
.awpa-filters-secondary {
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.awpa-filters-secondary.is-visible {
  display: flex;
}

/* Fix × button centering in pills */
.awpa-filter-pill__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 2px; /* Fine-tune vertical alignment */
}

/* Hide the bottom "Rensa" button */
.awpa-filter__actions {
  display: none;
}

/* ============================================
   CHECKBOXES
   ============================================ */
.awpa-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.awpa-checkboxes::-webkit-scrollbar {
  width: 6px;
}

.awpa-checkboxes::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.awpa-checkboxes::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.awpa-checkboxes::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.awpa-checkboxes input[type="checkbox"] {
  accent-color: #111;
}

/* ============================================
   PRICE SLIDER
   ============================================ */
.awpa-price {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.awpa-range {
  position: relative;
  height: 32px;
  display: grid;
  align-items: center;
  margin-bottom: 8px;
}

.awpa-range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  position: absolute;
  margin: 0;
  pointer-events: none;
  height: 32px;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

.awpa-range input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
}

.awpa-range input[type="range"]::-moz-range-track {
  background: transparent;
  height: 6px;
}

.awpa-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

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

.awpa-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111;
  border: 2px solid #fff;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.awpa-range input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.awpa-range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to right,
    rgba(0,0,0,.1) 0 var(--start, 0%),
    #111 var(--start, 0%) var(--end, 100%),
    rgba(0,0,0,.1) var(--end, 100%) 100%);
  border-radius: 999px;
  z-index: 1;
}

.awpa-price-values {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  text-align: center;
}

/* ============================================
   BRAND SEARCH
   ============================================ */
.awpa-brand-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 8px;
  transition: border-color 0.2s ease;
}

.awpa-brand-search:focus {
  outline: none;
  border-color: #000;
}

/* ============================================
   CATEGORY LIST
   ============================================ */
.awpa-cat-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
}

.awpa-cat-list::-webkit-scrollbar {
  width: 6px;
}

.awpa-cat-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.awpa-cat-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.awpa-cat-list .awpa-cat-list {
  padding-left: 16px;
  margin-top: 6px;
}

.awpa-cat-item > label {
  cursor: pointer;
}

/* ============================================
   "SHOW MORE" BUTTONS
   ============================================ */
.awpa-more {
  background: #000 !important;
  border: 1px solid #000 !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.awpa-more:hover {
  background: #fff !important;
  color: #000 !important;
}

.awpa-collapsible[data-collapsed="true"] [data-extra="true"] {
  display: none;
}

/* ============================================
   SORT DROPDOWN
   ============================================ */
.awpa-filter--sort select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s ease;
}

.awpa-filter--sort select:focus {
  outline: none;
  border-color: #000;
}

/* ============================================
   FILTER ACTIONS
   ============================================ */
.awpa-filter__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  flex: 1 1 100%;
  justify-content: flex-start;
  margin-top: 8px;
}

.awpa-filter__actions .button-link {
  padding: 10px 20px;
  background: #fff;
  color: #000;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.awpa-filter__actions .button-link:hover {
  border-color: #000;
  background: #f5f5f5;
}

/* ============================================
   CHECKBOX WRAPPER STYLING
   ============================================ */
.checkbox-wrapper-1 *,
.checkbox-wrapper-1 ::after,
.checkbox-wrapper-1 ::before {
  box-sizing: border-box;
}

.checkbox-wrapper-1 {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.checkbox-wrapper-1 [type=checkbox].substituted {
  margin: 0;
  width: 0;
  height: 0;
  display: inline;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.checkbox-wrapper-1 [type=checkbox].substituted + label {
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
}

.checkbox-wrapper-1 [type=checkbox].substituted + label:before {
  content: "";
  display: inline-block;
  vertical-align: top;
  height: 1.1em;
  width: 1.1em;
  margin-right: 0.5em;
  color: rgba(0, 0, 0, 0.275);
  border: solid 0.06em #000;
  box-shadow: 0 0 0.04em, 0 0.06em 0.16em -0.03em inset, 0 0 0 0.07em transparent inset;
  border-radius: 0.2em;
  background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xml:space="preserve" fill="white" viewBox="0 0 9 9"><rect x="0" y="4.3" transform="matrix(-0.707 -0.7072 0.7072 -0.707 0.5891 10.4702)" width="4.3" height="1.6" /><rect x="2.2" y="2.9" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 12.1877 2.9833)" width="6.1" height="1.7" /></svg>') no-repeat center, white;
  background-size: 0;
  transition: color 0.1s, border 0.1s, background 0.15s, box-shadow 0.1s;
  flex-shrink: 0;
}

.checkbox-wrapper-1 [type=checkbox].substituted:enabled:active + label:before,
.checkbox-wrapper-1 [type=checkbox].substituted:enabled + label:active:before {
  box-shadow: 0 0 0.04em, 0 0.06em 0.16em -0.03em transparent inset, 0 0 0 0.07em rgba(0,0,0,0.1) inset;
  background-color: #f2f2f2;
}

.checkbox-wrapper-1 [type=checkbox].substituted:checked + label:before {
  background-color: #000;
  background-size: 0.7em;
  color: rgba(0,0,0,0.075);
  border-color: #000;
}

.checkbox-wrapper-1 [type=checkbox].substituted:focus + label:before {
  box-shadow: 0 0 0.04em, 0 0.06em 0.16em -0.03em transparent inset, 0 0 0 0.07em rgba(0,0,0,0.1) inset, 0 0 0 3px rgba(0,0,0,0.25);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .awpa-filters {
    gap: 10px;
  }
  
  .awpa-filter {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .awpa-filters {
    flex-direction: column;
  }
  
  .awpa-filter {
    min-width: 100%;
  }
  
  .awpa-filter__header {
    padding: 12px 14px;
  }
  
  .awpa-collapsible[data-collapsed="false"] .awpa-filter__content {
    padding: 14px;
  }
  
  .awpa-active-filters {
    padding: 12px;
  }
}