/* Search/Listings Page - Restored Original Styling + Phase 4-10 Features */

/* Page-specific styles for listing list */
.container {
    max-width: none;
    padding: 0;
}

.full-width-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-lg) 0 var(--space-lg);
}

.full-width-header header {
    margin-top: 0;
}

/* ========== ANIMATIONS ========== */

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutToTop {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-30px);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
  }
  50% {
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.7);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ========== PAGE TRANSITIONS ========== */

.cards-container-wrapper {
  position: relative;
  min-height: 600px;
}

.cards-container-wrapper.page-transitioning .cards {
  animation: fadeOutToTop 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.cards-container-wrapper.page-loaded .card {
  animation: fadeInFromBottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cards-container-wrapper.page-loaded .card:nth-child(1) { animation-delay: 0s; }
.cards-container-wrapper.page-loaded .card:nth-child(2) { animation-delay: 0.05s; }
.cards-container-wrapper.page-loaded .card:nth-child(3) { animation-delay: 0.1s; }
.cards-container-wrapper.page-loaded .card:nth-child(4) { animation-delay: 0.15s; }
.cards-container-wrapper.page-loaded .card:nth-child(5) { animation-delay: 0.2s; }
.cards-container-wrapper.page-loaded .card:nth-child(6) { animation-delay: 0.25s; }
.cards-container-wrapper.page-loaded .card:nth-child(7) { animation-delay: 0.3s; }
.cards-container-wrapper.page-loaded .card:nth-child(8) { animation-delay: 0.35s; }
.cards-container-wrapper.page-loaded .card:nth-child(9) { animation-delay: 0.4s; }
.cards-container-wrapper.page-loaded .card:nth-child(10) { animation-delay: 0.45s; }
.cards-container-wrapper.page-loaded .card:nth-child(11) { animation-delay: 0.5s; }
.cards-container-wrapper.page-loaded .card:nth-child(12) { animation-delay: 0.55s; }

.cards-container-wrapper.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== MAIN CONTAINER ========== */

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px);
}

/* ========== SIDEBAR ========== */

.sidebar {
  background: var(--card-bg);
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  animation: slideInLeft 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.sidebar h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.sidebar h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* Filter Summary Banner */
.filter-summary {
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 2px solid rgba(14, 165, 233, 0.15);
  border-radius: 16px;
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.filter-count-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.filter-count-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.filter-count-number {
  font-size: 32px;
  font-weight: 900;
  line-height: 1; color: var(--accent); }

.filter-actions-quick {
  display: flex;
  gap: 8px;
}

.btn-clear-all,
.btn-save-search {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-all {
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-clear-all:hover {
  border-color: #ef4444;
  color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-save-search {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-save-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.btn-clear-all svg,
.btn-save-search svg {
  width: 16px;
  height: 16px;
}

/* Quick Preset Chips */
.filter-presets {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

.presets-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.preset-chip:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: white;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.preset-chip:hover svg {
  stroke: white;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  background: var(--card-bg);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.2);
  background: linear-gradient(135deg, var(--accent-strong) 0%, #075985 100%);
  color: white;
}

.chips a.chip {
  text-decoration: none;
}

/* ========== SIDEBAR ACCORDION ========== */

.sidebar-acc {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-acc:nth-child(1) { animation-delay: 0.05s; }
.sidebar-acc:nth-child(2) { animation-delay: 0.1s; }
.sidebar-acc:nth-child(3) { animation-delay: 0.15s; }
.sidebar-acc:nth-child(4) { animation-delay: 0.2s; }
.sidebar-acc:nth-child(5) { animation-delay: 0.25s; }
.sidebar-acc:nth-child(6) { animation-delay: 0.3s; }
.sidebar-acc:nth-child(7) { animation-delay: 0.35s; }
.sidebar-acc:nth-child(8) { animation-delay: 0.4s; }

.sidebar-acc:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.sidebar-acc-section {
  border-top: 1px solid var(--border);
}

.sidebar-acc-section:first-child {
  border-top: none;
}

.sidebar-acc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--card-bg);
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar-acc-header:hover {
  background: var(--hover);
}

.sidebar-acc-header:active {
  transform: scale(0.99);
}

.sidebar-acc-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.sidebar-acc-header:hover .sidebar-acc-title {
  color: var(--accent);
  transform: translateX(2px);
}

.sidebar-acc .chev {
  width: 20px;
  height: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-acc-section.open .chev {
  transform: rotate(180deg);
}

.sidebar-acc-header:hover .chev {
  transform: scale(1.1);
}

.sidebar-acc-section.open .sidebar-acc-header:hover .chev {
  transform: rotate(180deg) scale(1.1);
}

.sidebar-acc-panel {
  display: none;
  padding: 16px 18px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  overflow-x: hidden;
}

.sidebar-acc-section.open .sidebar-acc-panel {
  display: block;
  animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide scrollbars from sidebar elements */
.sidebar,
.sidebar-acc-panel,
.sidebar-acc-panel select,
.sidebar-acc-panel input {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar,
.sidebar-acc-panel::-webkit-scrollbar,
.sidebar-acc-panel select::-webkit-scrollbar,
.sidebar-acc-panel input::-webkit-scrollbar {
  display: none;
}

/* Always-open sections */
.sidebar-acc-section.open .sidebar-acc-header {
  border-bottom: 1px solid var(--border);
}

.sidebar-acc-section.open .sidebar-acc-header + .sidebar-acc-panel {
  border-top: none;
}

/* Filter notification badge */
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 4px;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.filter-badge:empty {
  display: none;
}

.sidebar-acc-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Range input pairs */
.range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.range-inputs > div label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: block;
  transition: color 0.2s ease;
}

.range-inputs > div:focus-within label {
  color: var(--accent);
}

.range-inputs select,
.range-inputs input[type="text"],
.range-inputs input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1), outline-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-bg);
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.range-inputs select:hover,
.range-inputs input:hover {
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.range-inputs select:focus,
.range-inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

.full-width-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.full-width-select:hover {
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.full-width-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

/* Sidebar select and input styling */
.sidebar-acc-panel select,
.sidebar-acc-panel input[type="text"],
.sidebar-acc-panel input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1), outline-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-bg);
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.sidebar-acc-panel select:hover,
.sidebar-acc-panel input[type="text"]:hover,
.sidebar-acc-panel input[type="number"]:hover {
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.sidebar-acc-panel select:focus,
.sidebar-acc-panel input[type="text"]:focus,
.sidebar-acc-panel input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

.filters {
  display: none;
}

/* Action buttons */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: 0.3px;
}

.btn.primary {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.45);
}

.btn.primary:active {
  transform: translateY(0) scale(0.98);
}

.btn.secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.btn.secondary:active {
  transform: translateY(0) scale(0.98);
}

/* ========== CONTENT AREA ========== */

.content {
  padding: 36px;
  background: var(--card-bg);
  animation: slideInRight 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
  /* Reset base.html .content overrides */
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  border: none;
  position: static;
  z-index: auto;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.results-count {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
}

.results-count strong { color: var(--accent); }

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sort-wrapper label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.sort-wrapper select {
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sort-wrapper select:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pagination a:hover,
.pagination-link:hover {
  background: rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

/* ========== CARDS GRID ========== */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 28px;
}

.card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  transition: color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.card:nth-child(1) { animation-delay: 0.3s; }
.card:nth-child(2) { animation-delay: 0.35s; }
.card:nth-child(3) { animation-delay: 0.4s; }
.card:nth-child(4) { animation-delay: 0.45s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.55s; }
.card:nth-child(n+7) { animation-delay: 0.6s; }

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(14, 165, 233, 0.35);
  border-color: var(--accent);
}

.card:hover::before {
  opacity: 1;
}

.card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1c2333;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover .card-preview {
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
  border-radius: 24px;
}

.card-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.card-preview img.active {
  display: block;
}

.card:hover .card-preview img.active {
  transform: scale(1.12);
}

.card-prevbtn,
.card-nextbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  font-size: 22px;
  font-weight: 700;
}

.card:hover .card-prevbtn,
.card:hover .card-nextbtn {
  opacity: 1;
}

.card-prevbtn:hover,
.card-nextbtn:hover {
  background: rgba(14, 165, 233, 0.95);
  transform: translateY(-50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.card-prevbtn {
  left: 14px;
}

.card-nextbtn {
  right: 14px;
}

.favorite-form,
.favorite-btn-link {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

.favorite-btn,
.favorite-btn-link {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.favorite-btn:hover,
.favorite-btn-link:hover {
  background: rgba(255, 64, 129, 0.95);
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 6px 16px rgba(255, 64, 129, 0.4);
}

.card h3 {
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text);
  transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
  letter-spacing: -0.01em;
}

.card:hover h3 {
  color: #0ea5e9;
  transform: translateX(4px);
}

.card h3 a {
  text-decoration: none;
  color: inherit;
}

.card .meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}

.card .price {
  font-size: 28px;
  font-weight: 900;
  margin-top: 14px;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: -0.02em; color: var(--text); }

.card:hover .price {
  transform: scale(1.03);
  transform-origin: left center;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.card-chips .chip {
  font-size: 12px;
  padding: 8px 14px;
}

/* Preference Match Badges */
.preference-match-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(14, 165, 233, 0.98);
  backdrop-filter: blur(12px);
  color: white;
  padding: 8px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s both;
}

.preference-match-badge.negative {
  background: rgba(14, 165, 233, 0.98);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.preference-match-badge svg {
  width: 16px;
  height: 16px;
}

/* ========== FEATURED/PROMOTED LISTINGS ========== */

.listing-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  z-index: 6;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
  pointer-events: none;
}

.listing-badge.featured-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.listing-badge.premium-badge {
  background: linear-gradient(135deg, #075985 0%, #075985 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
}

.listing-badge.standard-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #0369a1 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}

.listing-badge.certified-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  pointer-events: none;
  z-index: 2;
}

.card.featured {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04) 0%, rgba(239, 68, 68, 0.02) 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12), 0 12px 40px -10px rgba(245, 158, 11, 0.25);
}

.card.premium-tier:not(.featured) {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04) 0%, rgba(14, 165, 233, 0.02) 100%);
  border: 2px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1), 0 10px 32px -8px rgba(139, 92, 246, 0.2);
}

.card.standard-tier:not(.featured):not(.premium-tier) {
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08), 0 6px 24px -6px rgba(59, 130, 246, 0.15);
}

.card.featured.premium-tier {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(239, 68, 68, 0.02) 50%, rgba(139, 92, 246, 0.03) 100%);
  border: 2px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15), 0 0 0 8px rgba(139, 92, 246, 0.08), 0 16px 50px -12px rgba(245, 158, 11, 0.35);
}

.card.featured:hover {
  transform: translateY(-14px) scale(1.03);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3), 0 30px 80px -15px rgba(245, 158, 11, 0.5);
  border-color: rgba(245, 158, 11, 0.7);
}

.card.premium-tier:not(.featured):hover {
  transform: translateY(-14px) scale(1.02);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), 0 25px 60px -12px rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.6);
}

.card.featured .card-preview {
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
  border: 2px solid rgba(245, 158, 11, 0.2);
}

.card.featured:hover .card-preview {
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.4);
}

.card.premium-tier:not(.featured) .card-preview {
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.12);
  border: 2px solid rgba(139, 92, 246, 0.15);
}

.card.premium-tier:not(.featured):hover .card-preview {
  box-shadow: 0 10px 32px rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.35);
}

.card.featured .price {
  color: #ef4444;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.card.premium-tier:not(.featured) .price {
  color: #0284c7;
  font-weight: 700;
}

.card.featured h3 a {
  font-weight: 800; color: #f59e0b; }

.card.premium-tier:not(.featured) h3 a {
  font-weight: 700; color: var(--accent); }

@media (min-width: 1200px) {
  .card.featured { grid-column: span 1; padding: 24px; }
  .card.featured .card-preview { aspect-ratio: 4 / 2.8; }
}

.listing-badge.featured-badge {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both, shimmer 3s ease-in-out infinite 1s;
}

/* ========== PRICE SLIDER ========== */

.price-range { display: grid; gap: 10px; }

.price-values { display: flex; gap: 14px; }
.price-values .pv { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.price-values .pv label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }

.price-values input[type="number"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; background: var(--card-bg); font-weight: 500;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); font-family: 'Inter', sans-serif;
}
.price-values input[type="number"]:hover { border-color: var(--border); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.price-values input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.15); transform: translateY(-2px); }

.slider-wrap { position: relative; height: 32px; }
.slider-wrap input[type="range"] { position: absolute; width: 100%; height: 32px; margin: 0; background: none; pointer-events: auto; -webkit-appearance: none; appearance: none; }
.slider-track { position: absolute; top: 50%; left: 0; right: 0; height: 5px; transform: translateY(-50%); background: var(--border); border-radius: 5px; }
.slider-track::before { content: ""; position: absolute; height: 100%; background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%); left: var(--start, 0%); right: var(--right, 0%); border-radius: 5px; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3); }
.slider-wrap input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; background: var(--card-bg); border: 4px solid #0ea5e9; border-radius: 50%; cursor: pointer; box-shadow: 0 3px 10px rgba(14, 165, 233, 0.4); transition: color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.slider-wrap input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); box-shadow: 0 6px 16px rgba(14, 165, 233, 0.6); }

/* ========== MODAL STYLES ========== */

.adv-modal { position: fixed; inset: 0; display: none; z-index: 10000; overflow: hidden; }
.adv-modal.open { display: flex; align-items: center; justify-content: center; animation: fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.adv-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); animation: fadeIn 0.3s ease; }
.adv-content-wrapper { position: relative; width: 100%; max-width: 1020px; padding: 20px; display: flex; align-items: stretch; justify-content: center; z-index: 1; }
.adv-content-wrapper > form { width: 100%; height: calc(100vh - 40px); height: calc(100dvh - 40px); max-height: 900px; display: flex; flex-direction: column; }
.adv-content { position: relative; background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border); box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(14, 165, 233, 0.08); width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.adv-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 28px 32px 20px; border-bottom: 1px solid var(--border); }
.adv-header h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; color: var(--text); }
.adv-close { background: var(--hover); border: 1px solid var(--border); width: 40px; height: 40px; border-radius: 12px; font-size: 22px; cursor: pointer; transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 400; line-height: 1; }
.adv-close:hover { background: #450a0a; border-color: #fca5a5; color: #ef4444; transform: rotate(90deg); }
.adv-body { flex: 1; height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 24px 32px; }
.adv-body::-webkit-scrollbar { width: 6px; }
.adv-body::-webkit-scrollbar-track { background: transparent; }
.adv-body::-webkit-scrollbar-thumb { background: rgba(14, 165, 233, 0.2); border-radius: 3px; }
.adv-body::-webkit-scrollbar-thumb:hover { background: rgba(14, 165, 233, 0.4); }
.adv-body .full { width: 100%; }
.adv-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .adv-row.two-col { grid-template-columns: 1fr 1fr; } }
.adv-row .acc { margin-bottom: 0; }
.adv-row .full-width { grid-column: 1 / -1; }
.adv-body label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; display: block; }
.adv-body select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card-bg); font-size: 0.875rem; font-weight: 500; color: var(--text); font-family: var(--font-primary, inherit); transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease, outline-color 0.2s ease; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.adv-body select:hover { border-color: var(--accent); }
.adv-body select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); }
.adv-actions { flex-shrink: 0; display: flex; justify-content: flex-end; gap: 12px; padding: 20px 32px; border-top: 1px solid var(--border); }
.adv-actions .btn.primary { background: linear-gradient(135deg, #0369a1 0%, #075985 100%); color: #fff; border: none; padding: 12px 28px; border-radius: 12px; font-weight: 700; font-size: 0.9375rem; cursor: pointer; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); font-family: var(--font-primary, inherit); }
.adv-actions .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4); }
.adv-actions .btn.secondary { background: var(--card-bg); color: var(--muted); border: 1.5px solid var(--border); padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 0.9375rem; cursor: pointer; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; font-family: var(--font-primary, inherit); }
.adv-actions .btn.secondary:hover { background: var(--hover); color: var(--text); border-color: var(--accent); }

/* Enhanced Accordion (Advanced Modal) */
.acc { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease; }
.acc:hover { border-color: rgba(14, 165, 233, 0.3); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.acc:nth-child(1) { animation-delay: 0.05s; }
.acc:nth-child(2) { animation-delay: 0.1s; }
.acc:nth-child(3) { animation-delay: 0.15s; }
.acc:nth-child(4) { animation-delay: 0.2s; }
.acc:nth-child(5) { animation-delay: 0.25s; }
.acc-section { border-top: 1px solid var(--border); }
.acc-section:first-child { border-top: none; }
.acc-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; cursor: pointer; background: var(--card-bg); transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; position: relative; overflow: hidden; }
.acc-header::before { content: ''; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%); opacity: 0; transition: opacity 0.2s ease; }
.acc-header:hover { background: var(--hover); }
.acc-header:hover::before { opacity: 1; }
.acc-section.open .acc-header { background: rgba(14, 165, 233, 0.04); }
.acc-section.open .acc-header::before { opacity: 1; }
.acc-title { font-size: 0.9375rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.chev { width: 20px; height: 20px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); color: var(--muted); flex-shrink: 0; }
.acc-section.open .chev { transform: rotate(180deg); color: var(--accent); }
.acc-panel { display: none; padding: 16px 18px; background: var(--card-bg); border-top: 1px solid rgba(14, 165, 233, 0.08); }
.acc-section.open .acc-panel { display: block; }

/* Equipment section multi-column */
#advAccordion4 { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 768px) { #advAccordion4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { #advAccordion4 { grid-template-columns: repeat(3, 1fr); } }
#advAccordion4 .acc-section { border-top: 1px solid var(--border); border-left: none; }
@media (min-width: 768px) { #advAccordion4 .acc-section:nth-child(2n) { border-left: 1px solid var(--border); } #advAccordion4 .acc-section:nth-child(1), #advAccordion4 .acc-section:nth-child(2) { border-top: none; } }
@media (min-width: 1024px) { #advAccordion4 .acc-section:nth-child(2n) { border-left: none; } #advAccordion4 .acc-section:nth-child(3n+2), #advAccordion4 .acc-section:nth-child(3n) { border-left: 1px solid var(--border); } #advAccordion4 .acc-section:nth-child(1), #advAccordion4 .acc-section:nth-child(2), #advAccordion4 .acc-section:nth-child(3) { border-top: none; } }

/* Equipment filters */
.taxonomy-filters-list, .equipment-filters-list { display: flex; flex-direction: column; gap: 8px; }
.equipment-subsection-header { padding: 4px 0; margin-bottom: 2px; font-size: 0.6875rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.equipment-filter-row { position: relative; margin-bottom: 0; display: flex; align-items: center; gap: 10px; }
.equipment-filter-row > label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; position: relative; }
.equipment-filter-row > label::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%); border-radius: 3px 0 0 3px; opacity: 0; transition: opacity 0.2s ease; }
.equipment-filter-row:hover > label { border-color: rgba(14, 165, 233, 0.3); background: rgba(14, 165, 233, 0.03); }
.equipment-filter-row:hover > label::before { opacity: 1; }
.equipment-filter-row .checkbox { width: 18px; height: 18px; min-width: 18px; cursor: pointer; accent-color: var(--accent); }
.equipment-filter-row .checkbox-content { flex: 1; }
.equipment-filter-row .checkbox-label-text, .equipment-filter-name, .equipment-filter-label { font-weight: 600; color: var(--text); font-size: 0.8125rem; margin-bottom: 0; display: block; }
.equipment-filter-label { font-size: 0.8125rem; }
.equipment-filter-hint { font-size: 0.75rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.equipment-filter-states { display: flex; gap: 6px; flex-shrink: 0; }
.equipment-state-btn { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; position: relative; flex-shrink: 0; }
.equipment-state-btn svg { width: 16px; height: 16px; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; }
.equipment-state-btn:hover { border-color: var(--accent); background: rgba(14, 165, 233, 0.08); transform: scale(1.05); }
.equipment-state-btn.active-want { background: linear-gradient(135deg, #10b981 0%, #059669 100%); border-color: transparent; color: white; box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2); }
.equipment-state-btn.active-want:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); transform: scale(1.08); box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3); }
.equipment-state-btn.active-dont-want { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); border-color: transparent; color: white; box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2); }
.equipment-state-btn.active-dont-want:hover { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); transform: scale(1.08); box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3); }
.equipment-filter-row:not(:has(label)) { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; }
.equipment-filter-select { flex: 1; max-width: 280px; }
.equipment-filter-select select, .equipment-filter-select input[type="number"], .equipment-filter-select input[type="text"] { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--card-bg); font-size: 0.8125rem; font-weight: 500; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease, outline-color 0.2s ease; font-family: var(--font-primary, inherit); }
.equipment-filter-select input[type="number"] { -moz-appearance: textfield; }
.equipment-filter-select input[type="number"]::-webkit-inner-spin-button, .equipment-filter-select input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.equipment-filter-select select:hover, .equipment-filter-select input[type="number"]:hover, .equipment-filter-select input[type="text"]:hover { border-color: var(--accent); }
.equipment-filter-select select:focus, .equipment-filter-select input[type="number"]:focus, .equipment-filter-select input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); }

/* Feature Preferences */
.feature-preferences { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.feature-pref-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 0.8125rem; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease, border-radius 0.2s ease, margin 0.2s ease, padding 0.2s ease; }
.feature-pref-row:hover { background: rgba(14, 165, 233, 0.03); border-radius: 8px; padding: 0 6px; margin: 0 -6px 8px; }
.feature-pref-label { color: var(--muted); flex: 1; font-weight: 500; }
.feature-pref-buttons { display: flex; gap: 6px; }
.pref-btn { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; }
.pref-btn:hover { border-color: var(--accent); transform: scale(1.08); }
.pref-btn.want { background: linear-gradient(135deg, #10b981 0%, #059669 100%); border-color: transparent; color: white; box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2); }
.pref-btn.dont-want { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); border-color: transparent; color: white; box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2); }
.pref-btn svg { width: 16px; height: 16px; }

/* ========== FORM ERRORS ========== */
.form-errors { background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%); color: #991b1b; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-size: 13px; font-weight: 600; border-left: 4px solid #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15); animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.empty-state svg { animation: float 3s ease-in-out infinite; }
.empty-state p:first-of-type { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 10px; }

/* ========== MISC ========== */
.color-swatch { display: inline-block; flex-shrink: 0; }

/* Google autocomplete fixes */
gmp-place-autocomplete { display: none !important; visibility: hidden !important; opacity: 0 !important; position: absolute !important; left: -99999px !important; width: 0 !important; height: 0 !important; overflow: hidden !important; pointer-events: none !important; }
#location_search, #id_location { display: block !important; visibility: visible !important; opacity: 1 !important; position: relative !important; pointer-events: auto !important; }
.pac-container { display: block !important; visibility: visible !important; opacity: 1 !important; position: absolute !important; z-index: 10000 !important; pointer-events: auto !important; }

/* ========== PHASE 4: TREE SELECTOR ========== */

.tree-container { border: 2px solid var(--border); border-radius: 10px; padding: 12px; max-height: 450px; overflow-y: auto; background: var(--card-bg); }
.tree-loading { color: var(--muted); padding: 16px; text-align: center; font-size: 13px; font-weight: 600; }
.tree-item { margin-bottom: 4px; }
.tree-brand, .tree-model, .tree-generation { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tree-brand:hover, .tree-model:hover, .tree-generation:hover { background: rgba(14, 165, 233, 0.1); transform: translateX(2px); }
.tree-expand-btn { width: 24px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; flex-shrink: 0; transition: color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); border-radius: 6px; }
.tree-expand-btn:hover { color: #0ea5e9; background: rgba(14, 165, 233, 0.1); transform: scale(1.1); }
.tree-checkbox { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; accent-color: #0ea5e9; }
.tree-checkbox + label { cursor: pointer; margin: 0; padding: 0; }
.tree-models-container, .tree-generations-container { margin-left: 28px; border-left: 2px solid rgba(14, 165, 233, 0.2); padding-left: 12px; margin-top: 4px; }

/* ========== PHASE 6: FILTER SUGGESTIONS & SAVED TEMPLATES ========== */

.filter-suggestions { background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%); border: 2px solid rgba(14, 165, 233, 0.15); border-radius: 16px; padding: 20px; margin-bottom: 24px; animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.suggestions-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; display: block; }
.suggestions-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--card-bg); border: 2px solid rgba(14, 165, 233, 0.2); border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); white-space: nowrap; }
.suggestion-chip:hover { border-color: #0ea5e9; background: linear-gradient(135deg, #0369a1 0%, #075985 100%); color: white; transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3); }
.suggestion-chip svg { width: 12px; height: 12px; flex-shrink: 0; }

.saved-templates-wrapper { margin-bottom: 24px; padding: 20px; background: rgba(14, 165, 233, 0.04); border: 2px solid rgba(14, 165, 233, 0.1); border-radius: 16px; }
.saved-templates-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; display: block; }
.saved-templates-select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--card-bg); color: var(--text); cursor: pointer; transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); font-family: 'Inter', sans-serif; }
.saved-templates-select:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.saved-templates-select:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); transform: translateY(-2px); }
.template-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-load-template, .btn-delete-template { flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; transition: color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); background: var(--card-bg); color: var(--text); }
.btn-load-template:hover { border-color: #0ea5e9; color: #0ea5e9; background: rgba(14, 165, 233, 0.08); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15); }
.btn-delete-template:hover { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.08); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15); }

.analytics-toast { position: fixed; bottom: 24px; right: 24px; background: var(--card-bg); border: 2px solid var(--border); border-radius: 16px; padding: 14px 20px; font-size: 13px; color: var(--muted); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); animation: slideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 1000; max-width: 300px; }

/* ========== PHASE 10: ACCESSIBILITY ========== */

.sidebar-acc-header:focus-visible { outline: 2px solid #0ea5e9; outline-offset: -2px; background-color: rgba(14, 165, 233, 0.08); }
.btn:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.chip:focus-visible, .preset-chip:focus-visible, .suggestion-chip:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.tree-expand-btn:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 1px; border-radius: 4px; }
.tree-checkbox:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.card:focus-within { border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3); }
.card a:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.pagination a:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.saved-templates-select:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 1px; }
.full-width-select:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 1px; }

.skip-link { position: absolute; top: -40px; left: 0; background: #0369a1; color: white; padding: 8px 16px; z-index: 1000; font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 0 0 8px 0; transition: top 0.3s; }
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .btn { border: 2px solid ButtonText; }
  .card { border: 2px solid CanvasText; }
  .sidebar-acc-header { border-bottom: 1px solid CanvasText; }
  .chip { border: 1px solid ButtonText; }
}

/* ========== HAMBURGER & MOBILE NAV ========== */

.hamburger-menu { display: none; flex-direction: column; gap: 5px; width: 32px; height: 32px; border: none; background: none; cursor: pointer; padding: 6px; border-radius: 6px; transition: background 0.2s ease; align-items: center; justify-content: center; }
.hamburger-menu:hover { background: var(--hover); }
.hamburger-line { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease; }
.hamburger-menu.active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-menu.active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-menu.active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-nav-drawer { display: none; position: fixed; top: 80px; right: 16px; background: rgba(28, 35, 51, 0.98); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15); backdrop-filter: blur(20px); min-width: 200px; z-index: 99; }
.mobile-nav-drawer.active { display: block; }
.mobile-nav-drawer a { display: block; padding: 12px 16px; text-decoration: none; color: var(--text); font-weight: 500; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.mobile-nav-drawer a:last-child { border-bottom: none; }
.mobile-nav-drawer a:hover { background: var(--hover); color: var(--accent); }

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
  .main-container { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 2px solid var(--border); }
}

@media (max-width: 768px) {
  .hamburger-menu { display: flex; }
  .nav { display: none; }
  .mobile-nav-drawer { right: 0; left: 0; top: auto; border-radius: 0; }
  .main-container { min-height: calc(100vh - 20px); min-height: calc(100dvh - 20px); border-radius: 16px; }
  .sidebar, .content { padding: 20px; }
  .sidebar { padding: 20px 16px; }
  .sidebar-acc { margin-bottom: 10px; }
  .sidebar-acc-header { padding: 12px 16px; }
  .sidebar-acc-panel { padding: 14px 16px; }
  .range-inputs { grid-template-columns: 1fr; gap: 10px; }
  .cards { grid-template-columns: 1fr; }
  .results-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .results-count { font-size: 20px; }
  .sort-wrapper { width: 100%; }
  .sort-wrapper label { display: none; }
  .sort-wrapper select { width: 100%; padding: 10px; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  .filter-summary { padding: 14px; margin-bottom: 16px; }
  .filter-count-number { font-size: 24px; }
  .filter-actions-quick { flex-direction: column; gap: 6px; }
  .btn-clear-all, .btn-save-search { padding: 8px 12px; font-size: 12px; }
  .filter-presets { margin-bottom: 16px; padding-bottom: 16px; }
  .chips { gap: 6px; margin-bottom: 16px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .sidebar-acc-panel select, .sidebar-acc-panel input[type="text"], .sidebar-acc-panel input[type="number"] { padding: 10px; font-size: 16px; border-radius: 10px; }
  .full-width-select { padding: 10px; font-size: 16px; }
  .btn { padding: 12px 18px; font-size: 14px; width: 100%; }
  .actions { flex-direction: column; gap: 10px; }
  .tree-container { max-height: 300px; }
  .filter-suggestions { padding: 14px; margin-bottom: 16px; }
  .suggestion-chip { padding: 8px 10px; font-size: 12px; }
  .saved-templates-select { padding: 10px; font-size: 14px; }
  .btn-load-template, .btn-delete-template { padding: 8px 10px; font-size: 12px; }
  .form-errors { padding: 10px 14px; font-size: 12px; margin-bottom: 12px; }
  .adv-body { gap: var(--space-md); }
  .adv-row { gap: var(--space-sm); }
  .adv-content-wrapper { padding: 10px var(--space-sm); }
  .equipment-filter-select { max-width: 100%; }
  .equipment-filter-row { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .equipment-filter-row > label { width: 100%; }
  .equipment-filter-states { justify-content: flex-end; width: 100%; }
}

@media (max-width: 480px) {
  .main-container { border-radius: 12px; }
  .sidebar, .content { padding: 14px 12px; }
  .sidebar-acc-header { padding: 10px 12px; font-size: 13px; }
  .sidebar-acc-panel { padding: 12px; }
  .card { padding: 14px; border-radius: 18px; }
  .results-count { font-size: 18px; }
  .pagination a, .pagination-link { padding: 8px 10px; font-size: 13px; min-height: 44px; }
  .filter-count-number { font-size: 20px; }
  .chip { padding: 5px 8px; font-size: 12px; }
}

/* ========== DARK MODE ========== */

[data-theme="dark"] .main-container { background: var(--card-bg); box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .full-width-header { background: transparent; border-color: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .content { background: #1a1a1a; }
[data-theme="dark"] .sidebar { background: #1a1a1a; border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .sidebar h2 { color: #e2e8f0; }
[data-theme="dark"] .sidebar-acc { border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .sidebar-acc-section { border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .sidebar-acc-header { background: #1a1a1a; color: #e2e8f0; }
[data-theme="dark"] .sidebar-acc-header:hover { background-color: rgba(14, 165, 233, 0.08); }
[data-theme="dark"] .sidebar-acc-title { color: #e2e8f0; }
[data-theme="dark"] .sidebar-acc-panel { background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .sidebar-acc-section.open .sidebar-acc-header { border-bottom-color: rgba(255, 255, 255, 0.1); }

[data-theme="dark"] .sidebar-acc-panel select,
[data-theme="dark"] .sidebar-acc-panel input[type="text"],
[data-theme="dark"] .sidebar-acc-panel input[type="number"] { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .sidebar-acc-panel select:hover,
[data-theme="dark"] .sidebar-acc-panel input[type="text"]:hover,
[data-theme="dark"] .sidebar-acc-panel input[type="number"]:hover { border-color: rgba(14, 165, 233, 0.3); background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .sidebar-acc-panel select:focus,
[data-theme="dark"] .sidebar-acc-panel input[type="text"]:focus,
[data-theme="dark"] .sidebar-acc-panel input[type="number"]:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
[data-theme="dark"] .sidebar-acc-panel label { color: #a0a0a0; }

[data-theme="dark"] .tree-container { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.02); }
[data-theme="dark"] .tree-loading { color: #a0a0a0; }
[data-theme="dark"] .tree-brand, [data-theme="dark"] .tree-model, [data-theme="dark"] .tree-generation { color: #e2e8f0; }
[data-theme="dark"] .tree-brand:hover, [data-theme="dark"] .tree-model:hover, [data-theme="dark"] .tree-generation:hover { background-color: rgba(14, 165, 233, 0.12); }
[data-theme="dark"] .tree-expand-btn { color: #e2e8f0; }
[data-theme="dark"] .tree-expand-btn:hover { color: #0ea5e9; }
[data-theme="dark"] .tree-checkbox { accent-color: #0ea5e9; }
[data-theme="dark"] .tree-models-container, [data-theme="dark"] .tree-generations-container { border-left-color: rgba(14, 165, 233, 0.2); }

[data-theme="dark"] .card { background: #1a1a1a; border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .card:hover { border-color: #0ea5e9; box-shadow: 0 25px 50px -12px rgba(14, 165, 233, 0.25); }
[data-theme="dark"] .card-preview { background: #0d0d0d; }
[data-theme="dark"] .card h3 { color: #e2e8f0; }
[data-theme="dark"] .card .meta { color: #a0a0a0; }

[data-theme="dark"] .results-head { border-bottom-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .results-count { color: #e2e8f0; }
[data-theme="dark"] .sort-wrapper label { color: #a0a0a0; }
[data-theme="dark"] .sort-wrapper select { background: rgba(255, 255, 255, 0.05); color: #e2e8f0; border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .sort-wrapper select:focus { border-color: #0ea5e9; }

[data-theme="dark"] .pagination { color: #a0a0a0; }
[data-theme="dark"] .pagination a { color: #82b1ff; }
[data-theme="dark"] .pagination a:hover { background-color: rgba(14, 165, 233, 0.1); }

[data-theme="dark"] .filter-summary { background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); border-color: rgba(14, 165, 233, 0.15); }
[data-theme="dark"] .filter-count-label { color: #a0a0a0; }

[data-theme="dark"] .btn-clear-all { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .btn-clear-all:hover { border-color: #ef4444; color: #ff6b6b; background-color: rgba(239, 68, 68, 0.1); }
[data-theme="dark"] .btn-save-search { background: linear-gradient(135deg, #0369a1 0%, #075985 100%); color: white; }
[data-theme="dark"] .btn-save-search:hover { box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3); }
[data-theme="dark"] .full-width-select { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .full-width-select:focus { border-color: #0ea5e9; outline: none; }

[data-theme="dark"] .chip { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .chip:hover { background-color: rgba(14, 165, 233, 0.12); border-color: #0ea5e9; color: #82b1ff; }
[data-theme="dark"] .preset-chip { border-color: rgba(14, 165, 233, 0.2); }
[data-theme="dark"] .preset-chip:hover { border-color: #0ea5e9; color: #82b1ff; }

[data-theme="dark"] .form-errors { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #ff6b6b; }

[data-theme="dark"] .filter-suggestions { background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%); border-color: rgba(14, 165, 233, 0.2); }
[data-theme="dark"] .suggestions-label { color: #a0a0a0; }
[data-theme="dark"] .suggestion-chip { background: rgba(255, 255, 255, 0.05); border-color: rgba(14, 165, 233, 0.2); color: #e2e8f0; }
[data-theme="dark"] .suggestion-chip:hover { background-color: rgba(14, 165, 233, 0.15); border-color: #0ea5e9; color: #c4b5fd; }

[data-theme="dark"] .slider-track { background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .price-values input { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .price-values input:focus { border-color: #0ea5e9; }
[data-theme="dark"] .price-values .pv label { color: #a0a0a0; }
[data-theme="dark"] .range-inputs input { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .range-inputs input:focus { border-color: #0ea5e9; }
[data-theme="dark"] .range-inputs label { color: #a0a0a0; }

[data-theme="dark"] .saved-templates-wrapper { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.1); }
[data-theme="dark"] .saved-templates-label { color: #a0a0a0; }
[data-theme="dark"] .saved-templates-select { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .saved-templates-select:hover, [data-theme="dark"] .saved-templates-select:focus { border-color: #0ea5e9; background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .btn-load-template, [data-theme="dark"] .btn-delete-template { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
[data-theme="dark"] .btn-load-template:hover { background-color: rgba(14, 165, 233, 0.12); border-color: #0ea5e9; color: #c4b5fd; }
[data-theme="dark"] .btn-delete-template:hover { background-color: rgba(239, 68, 68, 0.12); border-color: #ef4444; color: #ff6b6b; }

[data-theme="dark"] .mobile-nav-drawer { background: rgba(26, 26, 26, 0.95); border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .mobile-nav-drawer a { color: #e2e8f0; border-bottom-color: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .mobile-nav-drawer a:hover { background: rgba(14, 165, 233, 0.1); color: #82b1ff; }

[data-theme="dark"] .feature-preferences { border-top-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .feature-pref-label { color: #a0a0a0; }
[data-theme="dark"] .pref-btn { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #a0a0a0; }
[data-theme="dark"] .pref-btn:hover { border-color: #0ea5e9; }
[data-theme="dark"] .empty-state p:first-of-type { color: #e2e8f0; }

[data-theme="dark"] .adv-content { background: #1a1a1a; border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .adv-header { border-bottom-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .adv-close { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #a0a0a0; }
[data-theme="dark"] .adv-close:hover { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; color: #ff6b6b; }
[data-theme="dark"] .adv-actions { border-top-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .acc { border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .acc-header { background: #1a1a1a; color: #e2e8f0; }
[data-theme="dark"] .acc-header:hover { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .acc-panel { background: rgba(0, 0, 0, 0.2); }
[data-theme="dark"] .acc-section { border-top-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .analytics-toast { background: #1a1a1a; border-color: rgba(255, 255, 255, 0.1); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }

[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(14, 165, 233, 0.3); border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(14, 165, 233, 0.5); }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #94a3b8; }
[data-theme="dark"] select option { background: #1a1a1a; color: #e2e8f0; }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
