/* Scooter Finder & Comparison Dashboard */

.sf-dashboard {
  min-height: calc(100vh - 4rem);
}

.sf-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1023px) {
  .sf-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Filter sidebar (desktop) ── */
.sf-filters {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 5.5rem;
}

.sf-filters__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.sf-filters__subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 1.25rem;
}

.sf-filter-group {
  margin-bottom: 1.25rem;
}

.sf-filter-group:last-of-type {
  margin-bottom: 0;
}

.sf-filter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.5rem;
}

.sf-filter-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ea580c;
  font-variant-numeric: tabular-nums;
}

.sf-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.sf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.45);
  cursor: pointer;
}

.sf-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.45);
  cursor: pointer;
}

.sf-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
  min-height: 44px;
}

.sf-select:focus {
  outline: 2px solid #fed7aa;
  border-color: #f97316;
}

.sf-reset-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.625rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.2s, color 0.2s;
}

.sf-reset-btn:hover {
  border-color: #f97316;
  color: #ea580c;
}

/* ── Mobile filter drawer ── */
.sf-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sf-drawer-backdrop.is-open {
  display: block;
  opacity: 1;
}

.sf-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #fff;
  z-index: 70;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
  box-shadow: 4px 0 32px rgba(15, 23, 42, 0.12);
}

.sf-drawer.is-open {
  transform: translateX(0);
}

.sf-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.sf-drawer__close {
  width: 44px;
  height: 44px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  font-size: 1.25rem;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

@media (max-width: 1023px) {
  .sf-filters--desktop {
    display: none;
  }

  .sf-mobile-filter-btn {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  .sf-drawer,
  .sf-drawer-backdrop {
    display: none !important;
  }
}

/* ── Results header ── */
.sf-results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sf-results-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
}

.sf-results-count strong {
  color: #0f172a;
}

/* ── Product grid ── */
.sf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.sf-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.sf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
  border-color: #fed7aa;
}

.sf-card__image-wrap {
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}

.sf-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sf-card__body {
  padding: 1.125rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sf-card__brand {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ea580c;
  margin-bottom: 0.25rem;
}

.sf-card__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.sf-card__price {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.sf-card__price span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

.sf-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.sf-badge i {
  font-size: 0.65rem;
  color: #94a3b8;
}

.sf-card__actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sf-btn-direct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.sf-btn-direct:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.45);
  color: #fff !important;
}

.sf-btn-amazon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #fff;
  color: #334155 !important;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none !important;
  text-align: center;
  border: 2px solid #e2e8f0;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
}

.sf-btn-amazon:hover {
  border-color: #f97316;
  color: #ea580c !important;
  transform: translateY(-1px);
}

/* ── Empty & loading states ── */
.sf-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}

.sf-empty__icon {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.sf-empty__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #334155;
  margin: 0 0 0.5rem;
}

.sf-empty__text {
  font-size: 0.925rem;
  color: #64748b;
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.6;
}

.sf-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #64748b;
  font-weight: 600;
}

.sf-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: sf-spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes sf-spin {
  to { transform: rotate(360deg); }
}
