/* ============================================
   DEALS PAGE STYLES - Premium Sidebar Layout
   ============================================ */

/* Header */
.deals-header {
  padding: 140px 0 60px;
  text-align: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.deals-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 12px;
}

.deals-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.deals-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.deals-count span {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1rem;
}

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

.deals-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px;
  align-items: start;
}

/* ============================================
   SIDEBAR - Floating Card Style
   ============================================ */

.filters-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

[data-theme="dark"] .filters-sidebar {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.filters-sidebar:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .filters-sidebar:hover {
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(144, 172, 50, 0.08);
}

.sidebar-inner {
  padding: 24px 20px 28px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-title svg {
  color: var(--accent-gold);
}

/* Filter blocks */
.filter-block {
  margin-bottom: 18px;
}

.filter-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filter-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-base);
  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='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
}

.filter-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(144, 172, 50, 0.1);
}

.filter-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.filter-reset {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.filter-reset:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(144, 172, 50, 0.05);
}

/* Quick Filters (Popular Makes) */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-filter {
  padding: 5px 11px;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-filter:hover {
  border-color: rgba(144, 172, 50, 0.5);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.quick-filter.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(144, 172, 50, 0.3);
}

/* ============================================
   MODEL QUICK ACCESS — Top Panel
   ============================================ */

.model-quick-access {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .model-quick-access {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(144, 172, 50, 0.06);
}

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

.model-qa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.model-qa-brand {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.model-qa-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-chip {
  padding: 7px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.model-chip:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(144, 172, 50, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(144, 172, 50, 0.1);
}

.model-chip.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(144, 172, 50, 0.3);
}

.model-chip .model-count {
  display: inline-block;
  font-size: 0.625rem;
  opacity: 0.7;
  margin-left: 3px;
}

/* ============================================
   DEALS CONTENT (RIGHT SIDE)
   ============================================ */

.deals-content {
  min-height: 50vh;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Card animation */
.deals-content .car-card {
  animation: cardFadeIn 0.5s ease forwards;
  opacity: 0;
}

.deals-content .car-card:nth-child(1) { animation-delay: 0.05s; }
.deals-content .car-card:nth-child(2) { animation-delay: 0.1s; }
.deals-content .car-card:nth-child(3) { animation-delay: 0.15s; }
.deals-content .car-card:nth-child(4) { animation-delay: 0.2s; }
.deals-content .car-card:nth-child(5) { animation-delay: 0.25s; }
.deals-content .car-card:nth-child(6) { animation-delay: 0.3s; }
.deals-content .car-card:nth-child(7) { animation-delay: 0.35s; }
.deals-content .car-card:nth-child(8) { animation-delay: 0.4s; }
.deals-content .car-card:nth-child(9) { animation-delay: 0.45s; }

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

/* No Results */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.no-results svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.no-results p {
  margin-bottom: 24px;
}

/* Load More */
.load-more-wrap {
  text-align: center;
  margin-top: 48px;
}

/* ============================================
   MOBILE FILTER TOGGLE
   ============================================ */

.mobile-filter-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--accent-gold);
  border: none;
  border-radius: 100px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(144, 172, 50, 0.4);
  gap: 8px;
  align-items: center;
  transition: var(--transition-base);
}

.mobile-filter-toggle:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 28px rgba(144, 172, 50, 0.5);
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 560px;
  width: 100%;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.modal-content > p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

.quote-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quote-form input,
.quote-form textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-base);
}

.quote-form input::placeholder,
.quote-form textarea::placeholder {
  color: var(--text-muted);
}

.quote-form input:focus,
.quote-form textarea:focus {
  border-color: var(--accent-gold);
}

.quote-form textarea {
  resize: vertical;
  min-height: 80px;
}

/* Car Features Tags */
.car-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.car-card-features .tag {
  font-size: 0.6875rem;
  padding: 3px 8px;
  background: rgba(144, 172, 50, 0.08);
  border: 1px solid rgba(144, 172, 50, 0.15);
  border-radius: 4px;
  color: var(--accent-gold-light);
}

/* Call for price */
.call-price {
  font-size: 1.125rem !important;
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

/* Model filter indication */
#filterModel:not([disabled]) {
  border-color: rgba(144, 172, 50, 0.3);
}

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

@media (max-width: 1024px) {
  .deals-layout {
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 24px;
  }

  .cars-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .deals-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    z-index: 1000;
    border-radius: 0 16px 16px 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  .filters-sidebar.open {
    left: 0;
  }

  .sidebar-inner {
    padding-top: 80px;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  .cars-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 32px 24px;
  }

  .quote-form .form-row {
    grid-template-columns: 1fr;
  }

  .deals-header {
    padding: 120px 0 40px;
  }

  .model-quick-access {
    padding: 14px 16px;
  }

  .model-grid {
    gap: 6px;
  }

  .model-chip {
    padding: 6px 10px;
    font-size: 0.6875rem;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}
