/* House of Motors LLC — hand-written, build-free CSS. Brand: navy + red (from logo). */

:root {
  --navy: #0f2a52;
  --navy-dark: #0a1c38;
  --navy-light: #1c3f73;
  --red: #d81f2a;
  --red-dark: #a8151e;
  --white: #ffffff;
  --gray-50: #f7f8fa;
  --gray-100: #eef0f4;
  --gray-200: #dde1e8;
  --gray-400: #98a0ad;
  --gray-600: #5b6472;
  --gray-800: #2b3240;
  --ink: #14181f;
  --available: #1f8a4c;
  --pending: #c98a12;
  --sold: #8a2a2a;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(15, 42, 82, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 42, 82, 0.16);
  --max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--gray-600); }
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy-dark); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn-outline-navy { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: var(--white); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--sold); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--navy);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 10px 20px; }
.brand { flex-shrink: 0; }
.brand-logo { height: 56px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.main-nav a { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--red); border-color: var(--red); }
.nav-admin-link { color: var(--gray-600) !important; font-size: 0.78rem !important; }
.header-cta { flex-shrink: 0; background: var(--navy); color: var(--white); font-weight: 700; padding: 10px 18px; border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.header-cta:hover { background: var(--navy-dark); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 34px; height: 34px; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; height: 3px; background: var(--navy); border-radius: 2px; }

@media (max-width: 900px) {
  .main-nav { position: fixed; top: 76px; left: 0; right: 0; bottom: 0; background: var(--white); flex-direction: column; align-items: flex-start; padding: 24px; gap: 18px; transform: translateX(100%); transition: transform 0.2s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ---- Flash messages ---- */
.flash { padding: 12px 0; font-weight: 600; }
.flash-success { background: #e6f7ec; color: var(--available); }
.flash-error { background: #fbeaea; color: var(--sold); }

/* ---- Hero / Slider ---- */
.hero-slider { position: relative; height: 62vh; min-height: 420px; max-height: 640px; overflow: hidden; background: var(--navy-dark); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide > a { position: absolute; inset: 0; display: block; }
.hero-slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide-fallback { position: absolute; inset: 0; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%); }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,28,56,0.35) 0%, rgba(10,28,56,0.75) 100%); }
.hero-content { position: relative; z-index: 2; width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 18px; color: var(--white); max-width: 720px; padding-top: 90px; padding-bottom: 64px; }
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--white); }
.hero-content .tagline { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; width: 100%; }
.hero-dots { position: absolute; bottom: 20px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; cursor: pointer; padding: 0; }
.hero-dot.active { background: var(--red); }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: rgba(255,255,255,0.15); border: none; color: var(--white); width: 44px; height: 44px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hero-arrow:hover { background: rgba(255,255,255,0.3); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

/* ---- Hero search box ---- */
.hero-search { position: relative; z-index: 2; background: rgba(255,255,255,0.97); border-radius: var(--radius); padding: 18px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; box-shadow: var(--shadow-lg); width: 100%; box-sizing: border-box; }
.hero-search input, .hero-search select { flex: 1; min-width: 140px; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.95rem; }

@media (max-width: 520px) {
  /* Stack hero buttons/search vertically rather than relying on flex-wrap at very
     narrow widths, so full-width buttons never risk crowding on one line. */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
}

/* ---- Sections ---- */
.section { padding: 64px 0; }
.section-alt { background: var(--gray-50); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 2rem; color: var(--navy); }
.eyebrow { color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; margin-bottom: 8px; display: block; }

/* ---- Body-type shop cards ---- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.type-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 26px 16px; text-align: center; font-weight: 700; color: var(--navy); transition: all 0.15s ease; }
.type-card:hover { border-color: var(--red); color: var(--red); box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---- Vehicle cards ---- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.vehicle-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s ease, transform 0.15s ease; display: flex; flex-direction: column; }
.vehicle-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.vehicle-card-img { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vehicle-card-img img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card-img .placeholder-text { color: rgba(255,255,255,0.85); font-weight: 800; text-align: center; padding: 0 16px; }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--white); }
.badge-available { background: var(--available); }
.badge-pending { background: var(--pending); }
.badge-sold { background: var(--sold); }
.badge-featured { position: absolute; top: 10px; right: 10px; background: var(--red); }
.vehicle-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vehicle-card-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.vehicle-card-trim { color: var(--gray-600); font-size: 0.85rem; margin: -6px 0 0; }
.vehicle-card-price { font-size: 1.3rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.vehicle-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.vehicle-card-cta { margin-top: auto; }

/* ---- Why-buy / features strip ---- */
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-item { text-align: center; padding: 20px; }
.feature-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--navy); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; }

/* ---- Testimonials ---- */
.testimonial-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.testimonial-card { flex: 0 0 320px; scroll-snap-align: start; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; }
.testimonial-stars { color: var(--red); letter-spacing: 2px; margin-bottom: 10px; }

/* ---- Inventory page layout ---- */
.inventory-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .inventory-layout { grid-template-columns: 1fr; } }
.filter-panel { position: sticky; top: 90px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.filter-group { margin-bottom: 18px; }
.filter-group label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-600); margin-bottom: 6px; }
.filter-group select, .filter-group input { width: 100%; padding: 9px 10px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 0.9rem; }
.filter-checkboxes { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.filter-checkboxes label { display: flex; align-items: center; gap: 8px; font-weight: 500; text-transform: none; font-size: 0.88rem; color: var(--ink); }
.filter-checkboxes input { width: auto; }
.filter-range { display: flex; gap: 8px; align-items: center; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.results-count { font-weight: 700; color: var(--navy); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-600); }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border-radius: 6px; border: 1px solid var(--gray-200); font-weight: 700; font-size: 0.9rem; }
.pagination a:hover { border-color: var(--navy); }
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ---- Vehicle detail page ---- */
.vehicle-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 960px) { .vehicle-detail { grid-template-columns: 1fr; } }
.gallery-main { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--navy-light)); cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.6; border: 2px solid transparent; }
.gallery-thumbs img.active { opacity: 1; border-color: var(--red); }
.detail-price-box { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; }
.detail-price { font-size: 2rem; font-weight: 800; color: var(--navy); }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.spec-table tr { border-bottom: 1px solid var(--gray-100); }
.spec-table td { padding: 10px 0; font-size: 0.92rem; }
.spec-table td:first-child { color: var(--gray-600); font-weight: 600; width: 44%; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.feature-tag { background: var(--gray-100); color: var(--navy); padding: 6px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; }

/* Lightbox */
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(10,20,40,0.92); z-index: 1000; align-items: center; justify-content: center; }
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 28px; color: var(--white); font-size: 2.2rem; background: none; border: none; cursor: pointer; line-height: 1; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); border: none; color: var(--white); width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

/* ---- Forms ---- */
.form-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; color: var(--ink); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.95rem; font-family: inherit; }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 4px; }
.field-error { color: var(--sold); font-size: 0.8rem; margin-top: 4px; }

/* ---- Financing calculator ---- */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 800px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-result { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 30px; }
.calc-monthly { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.calc-monthly small { font-size: 1rem; font-weight: 500; color: rgba(255,255,255,0.6); }
.calc-line { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.15); font-variant-numeric: tabular-nums; }

/* ---- About / partners ---- */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }
.partner-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; text-align: center; }

/* ---- Footer ---- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.7); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; padding: 50px 20px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-logo { height: 40px; margin-bottom: 12px; border-radius: 6px; background: var(--white); padding: 6px; }
.footer-heading { color: var(--white); font-weight: 800; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.footer-col a:hover { color: var(--white); }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; font-size: 0.8rem; text-align: center; }

/* ---- Admin ---- */
.admin-body { background: var(--gray-50); }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--navy-dark); color: var(--white); padding: 24px 0; }
.admin-sidebar .brand-logo { height: 40px; margin: 0 20px 24px; background: var(--white); padding: 4px; border-radius: 6px; }
.admin-sidebar a { display: block; padding: 12px 24px; color: rgba(255,255,255,0.7); font-weight: 600; font-size: 0.92rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: var(--white); border-left: 3px solid var(--red); }
.admin-main { padding: 32px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--navy); }
.stat-label { color: var(--gray-600); font-size: 0.82rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }
.admin-table-wrap { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
.admin-table th { background: var(--gray-50); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--gray-600); }
.status-select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--gray-200); font-size: 0.82rem; font-weight: 700; }
.row-actions { display: flex; gap: 10px; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-dark); padding: 20px; }
.login-card { background: var(--white); border-radius: var(--radius); padding: 36px; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg); text-align: center; }
.login-card .brand-logo { height: 60px; margin: 0 auto 20px; }
.photo-upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 10px; }
.photo-upload-grid img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }
.photo-thumb { position: relative; }
.photo-thumb .remove-photo { position: absolute; top: -8px; right: -8px; background: var(--sold); color: var(--white); border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-weight: 700; }

/* ---- Misc utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--gray-400); }
.icon { display: inline-block; width: 14px; }
