/* ============================================================
   Filter Redesign — appended to storefront.css
   Cleaner shopping-focused sidebar + mobile drawer
   ============================================================ */

/* --- Sidebar header row --- */
.cf-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 14px;
  margin-bottom: 2px;
}
.cf-sidebar-title {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}
.cf-sidebar-reset {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}
.cf-sidebar-reset:hover { text-decoration: underline; }

/* --- Collapsible section (replaces .filter-section) --- */
.cf-section {
  border-top: 1px solid #edf0f2;
}
.cf-section + .cf-section { margin-top: 0; }
/* override existing margin rule for cf-section elements */
.cf-section.filter-section + .cf-section.filter-section { margin-top: 0; }

.cf-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 2px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.cf-section-toggle::-webkit-details-marker { display: none; }
.cf-section-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #111;
}
.cf-chevron {
  font-size: 13px;
  color: #6c757d;
  transition: transform 0.2s;
}

.cf-section-body {
  padding: 0 2px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Category items (clean, no folder icons) --- */
.cf-cat-item {
  display: block;
  padding: 7px 10px;
  font-size: 13.5px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
  line-height: 1.3;
}
.cf-cat-item:hover {
  color: var(--primary-color);
  background: #fff1f1;
}
.cf-cat-active {
  background: #fff1f1;
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 700;
}
.cf-cat-child {
  padding-left: 22px;
  font-size: 13px;
}

/* --- Price layout: labelled fields + full-width Apply --- */
.cf-price-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cf-price-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #6c757d;
}
/* override existing price-inputs grid to work with cf-price-field wrappers */
.cf-section-body .price-inputs {
  grid-template-columns: 1fr 22px 1fr;
  align-items: flex-end;
  margin-bottom: 12px;
}
.cf-apply-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: var(--primary-color);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.cf-apply-btn:hover { background: #cc0000; }

/* Hide the old floating apply button in filter-heading-row */
.filter-heading-row { display: none; }

/* --- Active filter chips (above product grid) --- */
.cf-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 8px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 4px;
}
.cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff1f1;
  color: var(--primary-color);
  border: 1px solid #fad0d0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.cf-chip:hover { background: #ffe0e0; }
.cf-chip-clear {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 12.5px;
  color: #6c757d;
  text-decoration: none;
  cursor: pointer;
}
.cf-chip-clear:hover { color: var(--primary-color); }

/* --- Mobile filter bar --- */
.cf-mobile-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: var(--mobile-header-height, 110px);
  z-index: 90;
}
@media (max-width: 991.98px) {
  .cf-mobile-bar { display: flex; }
}
.cf-mobile-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f5f5f5;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
}
.cf-chip-badge {
  background: var(--primary-color);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 16px;
}
.cf-mobile-sort {
  margin-left: auto;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111;
}

/* --- Mobile drawer overlay --- */
.cf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
}
.cf-overlay.open { display: block; }

.cf-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 201;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.cf-drawer.open { transform: translateY(0); }

.cf-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #edf0f2;
  flex-shrink: 0;
}
.cf-drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: #111;
}
.cf-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #6c757d;
  display: flex;
  align-items: center;
  padding: 4px;
}
.cf-drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 16px;
}
.cf-drawer-foot {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #edf0f2;
  flex-shrink: 0;
}
.cf-drawer-reset {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #6c757d;
  text-decoration: none;
}
.cf-drawer-apply {
  flex: 2;
  padding: 12px;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.cf-drawer-apply:hover { background: #cc0000; }

/* --- Hide sidebar on mobile (drawer replaces it) --- */
@media (max-width: 991.98px) {
  .catalog-filter-card { display: none; }
}
