/* styles.css – CashCarHouston */

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #020617;
  color: #e5e7eb;
}

/* Layout */
.site-header {
  padding: 1rem 1.25rem 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #22c55e 0, #16a34a 40%, #022c22 100%);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.logo-letter {
  font-weight: 800;
  font-size: 1.2rem;
  color: #020617;
}

.logo-text h1 {
  font-size: 1.25rem;
  margin: 0;
}

.logo-text .tagline {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.page-main {
  max-width: 1200px;
  margin: 0.5rem auto 2rem;
  padding: 0 1.25rem;
}

/* Floating filter button */
.floating-filter-btn {
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 40;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.7);
  cursor: pointer;
}

/* Back to top */
.back-to-top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 1.1rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.back-to-top-btn.visible {
  display: flex;
}

/* Filter panel */
.filter-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(360px, 80vw);
  background: #020617;
  border-right: 1px solid #1f2937;
  transform: translateX(-100%);
  transition: transform 0.22s ease-out;
  z-index: 50;
  padding-bottom: 1.5rem;
}

.filter-panel.open {
  transform: translateX(0);
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.4rem;
  border-bottom: 1px solid #111827;
}

.filter-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.close-filter-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
}

.filters-form {
  padding: 0.75rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
}

.filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.filter-group label {
  color: #9ca3af;
}

.filter-group input,
.filter-group select {
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.85rem;
}

/* Buttons */
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.primary-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.secondary-btn {
  background: transparent;
  color: #9ca3af;
  border: 1px solid #374151;
}

/* Results header */
.results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.results-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.results-summary {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Cards grid */
.cars-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .cars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .cars-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.car-card {
  background: radial-gradient(circle at top left, #0b1120 0, #020617 60%, #000 100%);
  border-radius: 0.9rem;
  padding: 0.55rem 0.55rem 0.7rem;
  border: 1px solid #111827;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.car-photo-wrap {
  border-radius: 0.7rem;
  overflow: hidden;
  background: #020617;
}

.car-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .car-photo {
    height: 200px;
  }
}

.card-badges {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
}

.badge-source {
  border: 1px solid #16a34a;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.12);
}

.car-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.2rem;
}

.car-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #bbf7d0;
}

.car-miles {
  font-size: 0.75rem;
  color: #9ca3af;
}

.car-title {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.car-trim {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

.car-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: #9ca3af;
}

.car-actions {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-start;
}

/* Loading / no results */
.loading-more {
  text-align: center;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.no-results {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.modal-content {
  position: relative;
  max-width: 960px;
  margin: 3.5rem auto;
  background: #020617;
  border-radius: 1rem;
  border: 1px solid #111827;
  padding: 0.75rem 0.75rem 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
}

.modal-close-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  margin-top: 0.5rem;
}

.modal-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1rem;
  }
}

.modal-main-photo-wrap {
  border-radius: 0.8rem;
  overflow: hidden;
  background: #020617;
}

.modal-main-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .modal-main-photo {
    height: 320px;
  }
}

.thumbs-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  overflow-x: auto;
}

.thumb-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid #111827;
}

.modal-details h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.modal-price {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #bbf7d0;
}

.modal-miles {
  margin: 0.1rem 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.modal-meta-line {
  margin: 0.1rem 0 0.3rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.modal-description {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.85rem;
  color: #d1d5db;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-note {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Footer */
.site-footer {
  border-top: 1px solid #111827;
  padding: 1.1rem 1.25rem 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  color: #6b7280;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: #9ca3af;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-note {
  margin: 0;
}

/* Generic content pages (privacy, terms, sms) */
body.content-page {
  background: #020617;
  color: #e5e7eb;
}

.content-wrap {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

.content-wrap h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.content-wrap h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.35rem;
}

.content-wrap p,
.content-wrap li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.content-wrap a {
  color: #22c55e;
  text-decoration: none;
}

.content-wrap a:hover {
  text-decoration: underline;
}
