/* ============================================================
   PROMA FARBEN — MODERNES FILTER-SYSTEM v2.0
   Targets: .proma-fb, .pf-hd, .pf-row, .pf-i
   ============================================================ */

:root {
  --pf-primary: #e8241c;
  --pf-primary-dark: #c01a13;
  --pf-white: #ffffff;
  --pf-border: #e2e8f0;
  --pf-text: #1a202c;
  --pf-muted: #718096;
  --pf-shadow: 0 2px 16px rgba(0,0,0,0.08);
  --pf-radius: 12px;
  --pf-radius-sm: 8px;
  --pf-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === HAUPT CONTAINER === */
.proma-fb {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  margin-bottom: 24px;
  overflow: visible;
  transition: box-shadow 0.2s ease;
}

.proma-fb:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.11);
}

/* === FILTER HEADER === */
.pf-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  border-radius: var(--pf-radius) var(--pf-radius) 0 0;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-ttl {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-ttl::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cline x1='4' y1='6' x2='20' y2='6'/%3e%3cline x1='8' y1='12' x2='20' y2='12'/%3e%3cline x1='12' y1='18' x2='20' y2='18'/%3e%3c/svg%3e");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.pf-cnt {
  background: rgba(255,255,255,0.18);
  color: #ffffff !important;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255,255,255,0.3);
  letter-spacing: 0.3px;
}

/* === FILTER ROW (Grid der Filter-Items) === */
.pf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  padding: 0;
  gap: 0;
  border-top: none;
}

/* === EINZELNER FILTER === */
.pf-i {
  flex: 1 1 160px;
  min-width: 150px;
  max-width: 220px;
  border-right: 1px solid var(--pf-border);
  border-bottom: 1px solid var(--pf-border);
  padding: 0;
  position: relative;
  background: white;
  transition: background 0.15s ease;
}

.pf-i:last-child {
  border-right: none;
}

/* Preis-Item etwas breiter */
.pf-i:has(.facetwp-type-slider) {
  flex: 1 1 200px;
  min-width: 180px;
}

/* === LABEL === */
.pf-i label {
  display: block;
  padding: 11px 16px 8px;
  font-size: 10px !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--pf-muted) !important;
  cursor: default;
  margin: 0;
  line-height: 1;
}

/* === FACET LABEL (title oben) === */
.pf-i .facet-label.widget-title.wpc-filter-title {
  display: none !important;
}

/* === DROPDOWN SELECT === */
.pf-i select.facetwp-dropdown {
  width: 100%;
  padding: 0 32px 12px 16px !important;
  border: none !important;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='%23718096' fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3e%3c/svg%3e") no-repeat right 10px center / 16px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--pf-text) !important;
  cursor: pointer;
  outline: none !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  line-height: 1.3;
}

.pf-i select.facetwp-dropdown:focus {
  background-color: #fafafa !important;
}

/* Hat aktive Auswahl */
.pf-i select.facetwp-dropdown[data-active="true"],
.pf-i.has-value select.facetwp-dropdown {
  color: var(--pf-primary) !important;
  font-weight: 700 !important;
}

.pf-i:hover {
  background: #fafcff;
}

.pf-i:focus-within {
  background: #fff8f8;
  box-shadow: inset 0 0 0 2px rgba(232,36,28,0.15);
  z-index: 2;
}

/* === PREIS SLIDER === */
.pf-i .facetwp-type-slider {
  padding: 0 16px 14px;
}

.pf-i .facetwp-slider-wrap {
  padding: 4px 0 10px;
}

.pf-i .ui-slider {
  background: #e2e8f0 !important;
  height: 4px !important;
  border-radius: 3px !important;
  border: none !important;
  margin: 6px 8px !important;
}

.pf-i .ui-slider-range {
  background: linear-gradient(to right, var(--pf-primary-dark), var(--pf-primary)) !important;
  border-radius: 3px !important;
}

.pf-i .ui-slider-handle {
  background: white !important;
  border: 2.5px solid var(--pf-primary) !important;
  border-radius: 50% !important;
  width: 18px !important;
  height: 18px !important;
  top: -7px !important;
  cursor: grab !important;
  box-shadow: 0 2px 8px rgba(232,36,28,0.3) !important;
  outline: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.pf-i .ui-slider-handle:hover,
.pf-i .ui-slider-handle:focus,
.pf-i .ui-slider-handle:active {
  transform: scale(1.25) !important;
  box-shadow: 0 3px 12px rgba(232,36,28,0.45) !important;
  cursor: grabbing !important;
}

.facetwp-slider-reset {
  display: none !important;
}

/* Preis-Anzeige */
.pf-i .facetwp-slider-reset + .facetwp-pager,
.pf-price-range-display {
  display: flex !important;
  justify-content: space-between;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--pf-primary) !important;
  padding-top: 2px;
}

/* === FILTER RESET LINK === */
a.facetwp-reset,
.facetwp-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--pf-primary) !important;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: opacity 0.15s;
}

a.facetwp-reset:hover {
  opacity: 0.7;
}

/* === MOBILE FILTER BUTTON === */
button.facetwp-flyout-open {
  display: none !important;
}

@media (max-width: 768px) {
  button.facetwp-flyout-open {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: var(--pf-primary) !important;
    color: white !important;
    border: none !important;
    padding: 11px 20px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(232,36,28,0.35) !important;
    margin-bottom: 16px !important;
    transition: var(--pf-transition) !important;
  }

  button.facetwp-flyout-open::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3e%3cline x1='4' y1='6' x2='20' y2='6'/%3e%3cline x1='8' y1='12' x2='20' y2='12'/%3e%3cline x1='12' y1='18' x2='20' y2='18'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
  }

  .proma-fb {
    display: none;
  }
}

/* === FLYOUT DRAWER (MOBILE) === */
.facetwp-flyout {
  border-radius: 20px 20px 0 0 !important;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.2) !important;
}

/* === AKTIVE FILTER CHIPS BEREICH === */
#pf-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 22px;
  background: #fffaf9;
  border-bottom: 1px solid var(--pf-border);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}

#pf-chips-wrapper.hidden {
  display: none;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff0f0;
  color: var(--pf-primary-dark);
  border: 1px solid rgba(192,26,19,0.25);
  border-radius: 20px;
  padding: 4px 6px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  animation: chipIn 0.18s ease;
  white-space: nowrap;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.pf-chip-x {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pf-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
  line-height: 1;
  font-weight: 800;
}

.pf-chip-x:hover {
  background: var(--pf-primary-dark);
  transform: scale(1.15);
}

#pf-reset-btn {
  display: none;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1.5px solid var(--pf-primary);
  color: var(--pf-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pf-transition);
  margin-left: auto;
}

#pf-reset-btn:hover {
  background: var(--pf-primary);
  color: white;
}

#pf-reset-btn.show {
  display: inline-flex;
}

/* === LOADING / TRANSITION === */
.facetwp-loading .products {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s;
}

.products {
  transition: opacity 0.25s ease;
}

/* === PRODUCT ANIMATION === */
@keyframes pfProdIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.products.fwp-animate .product {
  animation: pfProdIn 0.25s ease both;
}

/* === RESPONSIVE FILTER ROW === */
@media (max-width: 1200px) {
  .pf-i {
    flex: 1 1 140px;
  }
}

@media (max-width: 900px) {
  .pf-row {
    flex-wrap: wrap;
  }
  .pf-i {
    flex: 1 1 calc(33.333% - 1px);
    max-width: calc(33.333% - 1px);
    border-right: 1px solid var(--pf-border);
  }
  .pf-i:nth-child(3n) {
    border-right: none;
  }
}

/* === HIGHLIGHT wenn Filter aktiv === */
.pf-i.active-filter {
  background: #fff8f8;
}

.pf-i.active-filter label {
  color: var(--pf-primary) !important;
}

.pf-i.active-filter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--pf-primary);
  border-radius: 0;
}

/* === PREISANZEIGE UNTERHALB SLIDER === */
.pf-price-vals {
  display: flex;
  justify-content: space-between;
  padding: 0 16px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pf-primary);
}

/* === ERGEBNIS COUNTER PULSIEREN (bei neuem Laden) === */
@keyframes pfCounterPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pf-cnt.loading {
  animation: pfCounterPulse 0.8s ease infinite;
}

/* === STICKY FILTER === */
@media (min-width: 769px) {
  .proma-fb.sticky {
    position: sticky;
    top: 70px;
    z-index: 100;
  }
}

/* Kein oberer border-radius wenn kein Header sichtbar */
.proma-fb .pf-row:first-child {
  border-radius: 0;
}
