/* =========================================================
   UI Refresh Overrides (Non-breaking, appended after base)
   - Compact price suggestion pills
   - Modern slimmer dual slider styling
   - Horizontal mode button alignment
   - Sticky mobile action bar & improved focus states
   ========================================================= */

/* Price Filter Card – slightly tighter */
.cpf-price-filter-card {
  padding: 16px 18px 18px;
  border-radius: 10px;
}

/* Suggestion container: switch from grid to flexible pill wrap */
.cpf-price-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-template-columns: unset !important; /* override previous grid */
  margin-bottom: 4px;
}

/* Pill style toggles */
.cpf-price-suggestion-toggle {
  flex-direction: row;
  /* align-items: center; */
  justify-content: start;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  min-width: auto;
  box-shadow: none;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s,
    border-color 0.25s;
  display: inline-flex; /* Ensure inline display for single row layout */
}

.cpf-price-suggestion-toggle:hover {
  background: #f3f4f6;
  border-color: #cbd5e1;
  transform: none;
  box-shadow: 0 0 0 1px #e2e8f0 inset;
}

/* Focus (keyboard) */
.cpf-price-suggestion-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Inner text in pill layout */
.cpf-price-suggestion-toggle .cpf-price-suggestion-text {
  flex-direction: row;
  gap: 6px;
  margin-top: 0;
}

.cpf-price-short-label {
  font-size: 12.5px;
  font-weight: 600;
  display: none; /* Hide short label - only show full label */
}

.cpf-price-full-label {
  font-size: 11px;
  display: block !important; /* Always show full label */
}

/* Selected state enhancements (leverage existing checked chain) */
.cpf-price-suggestion-item:checked
  + .cpf-toggle-switch
  + .cpf-price-suggestion-text
  .cpf-price-short-label {
  color: #0f4bc5;
}
.cpf-price-suggestion-item:checked
  + .cpf-toggle-switch
  + .cpf-price-suggestion-text
  .cpf-price-full-label {
  color: #1d4ed8;
  font-weight: 500;
}

/* Custom range toggle – make pill-like for consistency */
.cpf-custom-range-toggle {
  border-radius: 14px;
  padding: 10px 18px;
  min-width: auto; /* Remove min-width for responsive shrinking */
}

/* Expanded custom range panel – tighter spacing */
.cpf-custom-price-range {
  padding: 16px 18px;
  border-radius: 12px;
}

/* Dual Slider Modernization */
.cpf-dual-slider-container {
  height: 34px;
  margin: 4px 0 2px;
}

.cpf-price-slider-input {
  top: 14px;
  height: 4px;
}

.cpf-price-slider-input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.cpf-price-slider-input::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}
.cpf-price-slider-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  border: none;
}
.cpf-price-slider-input::-moz-range-thumb:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* Track & active range slimmer */
.cpf-slider-track {
  height: 4px;
  top: 15px;
  background: linear-gradient(90deg, #e5e7eb, #d1d5db);
}
.cpf-slider-range {
  height: 4px;
  top: 15px;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

/* Value badges simplified */
.cpf-slider-values {
  background: transparent;
  border: none;
  padding: 4px 0 0;
}
.cpf-slider-value-item span:last-child {
  color: #1d4ed8;
}

/* Action buttons – modern look */
.cpf-filter-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.cpf-filter-button {
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.25px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cpf-apply-button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
}
.cpf-apply-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.45);
}

.cpf-reset-button {
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  color: #334155;
}
.cpf-reset-button:hover {
  background: #eef2f7;
}

/* Horizontal layout tweaks */
.cpf-filter-horizontal .cpf-filter-form {
  align-items: flex-start;
}
.cpf-filter-horizontal .cpf-filter-actions {
  margin-left: auto;
  align-self: flex-start;
  padding-top: 4px;
}

/* Make price card inline-friendly in horizontal mode */
.cpf-filter-horizontal .cpf-price-filter-card {
  display: flex;
  flex-direction: column;
  max-width: 480px;
}

/* Sticky action bar on small screens */
@media (max-width: 640px) {
  .cpf-filter-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 12px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 30;
  }
  .cpf-filter-horizontal .cpf-filter-actions {
    order: 100; /* push to end */
    width: 100%;
    justify-content: center;
  }
  .cpf-price-suggestion-toggle {
    padding: 7px 14px;
  }
}

/* Ultra small devices */
@media (max-width: 420px) {
  .cpf-price-suggestions {
    gap: 6px;
  }
  .cpf-price-suggestion-toggle {
    padding: 6px 12px;
  }
  .cpf-filter-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cpf-price-suggestion-toggle,
  .cpf-custom-price-range,
  .cpf-filter-button,
  .cpf-price-slider-input::-webkit-slider-thumb,
  .cpf-price-slider-input::-moz-range-thumb {
    transition: none !important;
  }
}

/**
 * Frontend CSS for Custom Product Filter
 *
 * @since 1.0.0
 */

/* Filter Container */
.cpf-filter-container {
  max-width: 1200px;
  width: 100%;
  /* margin: 20px auto; */
  margin: 0 auto;
  /* padding: 20px 24px 28px; */
  padding: 10px 12px 14px;
  border: 1px solid #e3e6e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  position: relative;
}

/* Optional outer layout wrapper: .cpf-layout-wrapper (30% / 70%) */
.cpf-layout-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.cpf-layout-wrapper .cpf-filter-container {
  flex: 0 0 30%;
}
.cpf-layout-wrapper .cpf-products-area {
  flex: 1 1 70%;
  min-width: 0;
}
@media (max-width: 992px) {
  .cpf-layout-wrapper {
    flex-direction: column;
  }
  .cpf-layout-wrapper .cpf-filter-container,
  .cpf-layout-wrapper .cpf-products-area {
    flex: 1 1 100%;
  }
}

/* Filter Form */
.cpf-filter-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

/* Horizontal bar mode (add class .cpf-filter-horizontal to container) */
.cpf-filter-container.cpf-filter-horizontal {
  padding-top: 64px;
}
.cpf-filter-container.cpf-filter-horizontal .cpf-filter-form {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: stretch;
}
.cpf-filter-container.cpf-filter-horizontal .cpf-filter-section {
  flex: 1 1 180px;
  margin: 0;
  min-width: 170px;
  background: #fdfdfd;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  border-radius: 8px;
}
.cpf-filter-container.cpf-filter-horizontal .cpf-price-section {
  flex: 2 1 360px;
}
.cpf-filter-container.cpf-filter-horizontal .cpf-buttons-section {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  background: transparent;
  border: none;
  padding: 0;
}
.cpf-filter-container.cpf-filter-horizontal .cpf-filter-title {
  font-size: 13px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #555;
}
@media (max-width: 900px) {
  .cpf-filter-container.cpf-filter-horizontal {
    padding-top: 20px;
  }
  .cpf-filter-container.cpf-filter-horizontal .cpf-filter-form {
    flex-direction: column;
  }
}

/* Filter Sections */
.cpf-filter-section {
  padding: 16px 18px 18px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  background: #fafafa;
  position: relative;
  box-sizing: border-box;
}

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

/* Filter Options */
.cpf-filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cpf-checkbox-label,
.cpf-select-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.cpf-checkbox-label:hover {
  background-color: #f0f0f0;
}

/* Check All wrapper styling */
.cpf-check-all-wrapper {
  border-bottom: 1px solid #ddd;
  margin-bottom: 8px;
  padding-bottom: 8px;
  font-weight: 600;
}

.cpf-check-all-text {
  color: #0073aa;
  font-weight: 600;
}

/* Hide default checkboxes */
.cpf-checkbox {
  display: none !important;
}

/* Toggle Switch Styling */
.cpf-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.cpf-toggle-switch:hover {
  background-color: #bbb;
}

.cpf-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.cpf-checkbox:checked + .cpf-toggle-switch {
  background-color: #0073aa;
}

.cpf-checkbox:checked + .cpf-toggle-switch:hover {
  background-color: #005a87;
}

.cpf-checkbox:checked + .cpf-toggle-switch .cpf-toggle-slider {
  transform: translateX(20px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Focus state for accessibility */
.cpf-checkbox:focus + .cpf-toggle-switch {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* Check all toggle styling */
.cpf-check-all .cpf-toggle-switch {
  background-color: #e0e0e0;
  border: 2px solid #0073aa;
}

.cpf-checkbox.cpf-check-all:checked + .cpf-toggle-switch {
  background-color: #0073aa;
  border-color: #0073aa;
}

.cpf-checkbox {
  margin: 0;
}

.cpf-checkbox-text {
  font-size: 14px;
  color: #555;
}

.cpf-count {
  color: #999;
  font-size: 12px;
}

/* Sorting Controls */
.cpf-sorting-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cpf-select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  min-width: 200px;
}

.cpf-order-toggle {
  display: flex;
  gap: 15px;
}

.cpf-order-toggle label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
}

/* Price Range */
.cpf-price-range {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Price Filter Card Container */
.cpf-price-filter-card {
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 12px;
  margin-top: 15px;
  transition: box-shadow 0.3s ease;
}

.cpf-price-filter-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Price Suggestions Section */
.cpf-price-suggestions-section {
  margin-bottom: 20px;
}

.cpf-price-subsection-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  text-align: center;
}

.cpf-price-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

/* Price Suggestion Toggle Switches */
.cpf-price-suggestion-toggle {
  display: flex;
  /* flex-direction: column; */
  /* align-items: center; */
  padding: 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  position: relative;
}

.cpf-price-suggestion-toggle:hover {
  background: #f9fafb;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.cpf-price-suggestion-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  text-align: center;
}

.cpf-price-short-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  line-height: 1.2;
}

.cpf-price-full-label {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.2;
  display: block; /* Show on hover/focus */
}

.cpf-price-suggestion-toggle:focus-within .cpf-price-full-label {
  display: block;
}

/* Checked state for price suggestions */
.cpf-price-suggestion-item:checked
  + .cpf-toggle-switch
  + .cpf-price-suggestion-text
  .cpf-price-short-label {
  color: #1d4ed8;
  font-weight: 700;
}

.cpf-price-suggestion-item:checked
  + .cpf-toggle-switch
  + .cpf-price-suggestion-text
  .cpf-price-full-label {
  color: #3b82f6;
  display: block;
}

/* Divider */
.cpf-price-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

.cpf-price-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    #e5e7eb 20%,
    #e5e7eb 80%,
    transparent
  );
}

.cpf-divider-text {
  background: #fff;
  z-index: 1;
  padding: 0 16px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Custom Range Section */
.cpf-custom-range-section {
  margin-top: 20px;
}

.cpf-custom-range-header {
  display: flex;
  align-items: center;
  /* justify-content: center; */
}

.cpf-custom-range-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  /* min-width: 280px; */
  width: 100%;
}

.cpf-custom-range-toggle:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.cpf-custom-range-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  display: block;
}

.cpf-custom-range-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  display: block;
}

/* Checked state for custom range toggle */
#cpf-use-custom-range:checked
  + .cpf-toggle-switch
  + .cpf-checkbox-text
  .cpf-custom-range-title {
  color: #1d4ed8;
}

#cpf-use-custom-range:checked
  + .cpf-toggle-switch
  + .cpf-checkbox-text
  .cpf-custom-range-desc {
  color: #3b82f6;
}

/* Custom Price Range */
.cpf-custom-price-range {
  padding: 20px;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  margin-top: 15px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpf-custom-price-range[aria-expanded="true"] {
  opacity: 1;
  max-height: 500px;
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Price Input Labels */
.cpf-price-input-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  color: #374151;
}

.cpf-price-inputs {
  /* display: flex;
  gap: 15px; */
  margin-bottom: 10px;
}

.cpf-price-inputs label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.cpf-input-help {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.cpf-price-input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.cpf-price-input:focus {
  border-color: #0073aa;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Dual Handle Price Slider */
.cpf-dual-price-slider {
  display: flex;
  flex-direction: column;
  /* gap: 12px; */
}

.cpf-slider-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.cpf-dual-slider-container {
  position: relative;
  height: 40px;
  margin: 10px 0;
}

.cpf-price-slider-input {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  outline: none;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  pointer-events: none;
  top: 17px;
}

.cpf-price-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #0073aa;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  pointer-events: all;
  position: relative;
  z-index: 2;
}

.cpf-price-slider-input::-webkit-slider-thumb:hover {
  background: #005a87;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.cpf-price-slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #0073aa;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  pointer-events: all;
  position: relative;
  z-index: 2;
}

.cpf-price-slider-input::-moz-range-thumb:hover {
  background: #005a87;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.cpf-price-slider-input::-moz-range-track {
  background: transparent;
  border: none;
}

.cpf-price-slider-input::-webkit-slider-track {
  background: transparent;
  border: none;
}

/* Slider Track */
.cpf-slider-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  top: 17px;
  z-index: 1;
}

/* Active Range */
.cpf-slider-range {
  position: absolute;
  height: 6px;
  background: #0073aa;
  border-radius: 3px;
  top: 17px;
  z-index: 1;
  transition: all 0.2s ease;
}

/* Max slider should be on top */
.cpf-max-slider {
  z-index: 3;
}

.cpf-min-slider {
  z-index: 2;
}

/* Value Display */
.cpf-slider-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e9ecef;
}

.cpf-slider-value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cpf-value-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.cpf-slider-value-item span:last-child {
  font-weight: bold;
  color: #0073aa;
  font-size: 14px;
}

.cpf-slider-separator {
  font-weight: bold;
  color: #666;
  margin: 0 10px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cpf-slider-values {
    flex-direction: column;
    gap: 8px;
  }

  .cpf-slider-separator {
    display: none;
  }

  .cpf-slider-value-item {
    flex-direction: row;
    gap: 8px;
  }

  /* Price filter mobile adjustments */
  .cpf-price-filter-card {
    padding: 16px;
    border-radius: 8px;
  }

  .cpf-price-suggestions {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .cpf-price-suggestion-toggle {
    padding: 10px 6px;
  }

  .cpf-price-short-label {
    font-size: 12px;
  }

  .cpf-price-full-label {
    font-size: 10px;
  }

  .cpf-custom-range-toggle {
    min-width: auto;
    padding: 10px 12px;
  }

  .cpf-custom-range-title {
    font-size: 13px;
  }

  .cpf-custom-range-desc {
    font-size: 11px;
  }

  .cpf-price-inputs {
    /* flex-direction: column; */
    /* gap: 12px; */
  }

  .cpf-custom-price-range {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .cpf-price-suggestions {
    grid-template-columns: 1fr;
  }

  .cpf-price-suggestion-toggle {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .cpf-price-suggestion-text {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    text-align: left;
  }

  .cpf-price-full-label {
    display: block;
    font-size: 11px;
  }

  .cpf-divider-text {
    font-size: 12px;
    padding: 0 12px;
  }
}

.cpf-price-display {
  text-align: center;
  font-weight: bold;
  color: #333;
}

.cpf-price-separator {
  margin: 0 5px;
}

/* Action Buttons */
.cpf-filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.cpf-filter-button {
  padding: 12px 24px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cpf-apply-button {
  background: #0073aa;
  color: white;
}

.cpf-apply-button:hover {
  background: #005a87;
}

.cpf-apply-button:disabled,
.cpf-apply-button.cpf-loading-state {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.cpf-reset-button {
  background: #f1f1f1;
  color: #333;
  border: 1px solid #ccc;
}

.cpf-reset-button:hover {
  background: #e0e0e0;
}

/* Loading State */
.cpf-loading {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 5px;
  position: relative;
}

.cpf-loading-text {
  display: inline-block;
}

.cpf-loading::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-top: 2px solid #0073aa;
  border-radius: 50%;
  animation: cpf-spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes cpf-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error State */
.cpf-error {
  padding: 15px;
  background: #ffebee;
  border: 1px solid #f44336;
  border-radius: 5px;
  color: #c62828;
  font-weight: 500;
  margin: 10px 0;
}

.cpf-error::before {
  content: "⚠ ";
  font-weight: bold;
}

/* Results Container */
.cpf-results {
  margin-top: 20px;
  min-height: 50px;
}

.cpf-results.cpf-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success State */
.cpf-success {
  padding: 15px;
  background: #e8f5e8;
  border: 1px solid #4caf50;
  border-radius: 5px;
  color: #2e7d32;
  margin: 10px 0;
}

/* Loading Button Animation */
.cpf-loading-state::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: cpf-spin 1s linear infinite;
}

/* Product Grid */
.cpf-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.cpf-product-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 15px;
  transition: all 0.3s ease;
}

.cpf-product-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cpf-product-item h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.cpf-product-item h3 a {
  text-decoration: none;
  color: #333;
}

.cpf-product-item h3 a:hover {
  color: #0073aa;
}

.cpf-product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.cpf-price {
  font-weight: bold;
  color: #0073aa;
}

/* No Results */
.cpf-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cpf-filter-container {
    padding: 15px;
  }

  .cpf-price-inputs {
    /* flex-direction: column;
    gap: 10px; */
  }

  .cpf-filter-actions {
    flex-direction: column;
  }

  .cpf-filter-button {
    width: 100%;
  }

  .cpf-sorting-controls .cpf-select {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cpf-filter-section {
    padding: 10px;
  }

  .cpf-filter-title {
    font-size: 14px;
  }

  .cpf-order-toggle {
    flex-direction: column;
    gap: 8px;
  }
}

/* Mobile Toggle Functionality */
.cpf-mobile-toggle {
  display: none;
  background: var(--cpf-primary-color);
  /* color: #fff; */
  color: #3aa6b9;
  border: none;
  padding: 12px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  position: relative;
}

/* .cpf-mobile-toggle:hover,
.cpf-mobile-toggle:focus {
  background: var(--cpf-primary-color-dark);
  outline: 2px solid var(--cpf-focus-color);
  outline-offset: 2px;
} */

.cpf-mobile-toggle::after {
  content: "\25BC";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.cpf-mobile-toggle.active::after {
  transform: translateY(-50%) rotate(180deg);
}

.cpf-mobile-toggle span {
  margin-right: 8px;
}

/* Mobile Panel Behavior */
@media (max-width: 768px) {
  .cpf-mobile-toggle {
    display: block;
  }

  .cpf-filter-container {
    position: relative;
  }

  .cpf-filters-panel {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .cpf-filters-panel.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
  }

  .cpf-filters-panel.expanded {
    max-height: 2000px;
    opacity: 1;
  }
}

/* Accessibility Enhancements */
.cpf-filter-form {
  outline: none;
}

.cpf-filter-form:focus-within {
  box-shadow: 0 0 0 2px var(--cpf-focus-color);
  border-radius: 4px;
}

/* Screen Reader Only Text */
.cpf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles for Interactive Elements */
.cpf-filter-field select:focus,
.cpf-filter-field input:focus,
.cpf-checkbox-item input:focus + label,
.cpf-radio-item input:focus + label {
  outline: 2px solid var(--cpf-focus-color);
  outline-offset: 2px;
}

/* Keyboard Navigation */
.cpf-filter-field select,
.cpf-filter-field input,
.cpf-checkbox-item input,
.cpf-radio-item input,
.cpf-button,
.cpf-mobile-toggle {
  position: relative;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  .cpf-filter-container {
    border: 2px solid;
  }

  .cpf-button {
    border: 2px solid;
  }

  .cpf-mobile-toggle {
    border: 2px solid;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .cpf-mobile-toggle,
  .cpf-mobile-toggle::after,
  .cpf-filters-panel {
    transition: none;
  }
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  background: transparent;
}
