/* kamcars.org refinements: loaded after app.css. Smoother, more polished, mobile-first. */
:root { --shadow-sm: 0 1px 2px rgba(16,24,28,.06), 0 1px 3px rgba(16,24,28,.08); --shadow-md: 0 6px 18px rgba(16,24,28,.12); --wa: #1fa855; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, iframe { max-width: 100%; }
a { text-underline-offset: 2px; }

/* Navigation */
.site-nav { position: sticky; top: 0; z-index: 1020; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.site-nav .nav-link { padding: .6rem .8rem; transition: color .15s; }
@media (max-width: 991.98px) {
  .site-nav .navbar-collapse { padding: .5rem 0 1rem; }
  .site-nav .nav-link { padding: .75rem .25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .site-nav .btn { margin-top: .5rem; }
}

/* Buttons and forms */
.btn { border-radius: 8px; font-weight: 600; transition: transform .12s ease, box-shadow .12s ease, background-color .15s; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn-warning { --bs-btn-bg: var(--kerb); --bs-btn-border-color: var(--kerb); --bs-btn-hover-bg: var(--kerb-hover); --bs-btn-hover-border-color: var(--kerb-hover); --bs-btn-color: var(--on-kerb); }
.btn-success { --bs-btn-bg: var(--wa); --bs-btn-border-color: var(--wa); --bs-btn-hover-bg: #178a45; --bs-btn-hover-border-color: #178a45; }
.btn-outline-success { --bs-btn-color: #178a45; --bs-btn-border-color: var(--wa); --bs-btn-hover-bg: var(--wa); --bs-btn-hover-border-color: var(--wa); }
.form-control, .form-select { border-radius: 8px; border-color: #cfd6da; min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--teal-2); box-shadow: 0 0 0 .2rem rgba(15,118,110,.18); }
.form-label { font-weight: 600; font-size: .9rem; }
textarea.form-control { min-height: 96px; }

/* Cards and panels */
.vcard, .tile, .panel, .stat { box-shadow: var(--shadow-sm); transition: box-shadow .18s ease, transform .18s ease, border-color .18s; }
.vcard:hover, .tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vcard .ph img { transition: transform .35s ease; }
.vcard:hover .ph img { transform: scale(1.04); }
.vcard h3 { line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { letter-spacing: -.02em; }
.panel { border-radius: 12px; }

/* Hero and search */
.search-panel { border-radius: 12px; }
@media (max-width: 575.98px) { .hero { padding: 2.25rem 0 4.25rem; } .search-panel { padding: 1rem; margin-top: 1.25rem; } .section { padding: 1.75rem 0; } }

/* Vehicle detail */
.gallery-main { box-shadow: var(--shadow-sm); }
.thumbs { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.thumbs button { scroll-snap-align: start; transition: border-color .15s, opacity .15s; opacity: .85; }
.thumbs button:hover, .thumbs button.active { opacity: 1; }
.spec-table th, .spec-table td { padding: .6rem .5rem; }
@media (max-width: 575.98px) { .spec-table th { width: 45%; } .price { font-size: 1.15rem; } }

/* Google map on showroom pages */
.map-frame { position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 240px; border-radius: 10px; overflow: hidden; background: #e9edef; }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 575.98px) { .map-frame { aspect-ratio: 4 / 3; } }

/* Dashboards collapse cleanly on tablets and phones */
@media (max-width: 991.98px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem; }
  .dash-side .nav { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; gap: .25rem; -webkit-overflow-scrolling: touch; }
  .dash-side .nav-link { white-space: nowrap; }
  .dash-main { padding: 1rem; }
}
.table-responsive, .dash-main table { -webkit-overflow-scrolling: touch; }

/* Auth pages */
.auth-card { padding: 0 .75rem; }
.auth-card .btn-outline-dark { border-color: #cfd6da; background: #fff; }

/* Footer */
footer.site-footer a { text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }

/* Accessibility and motion */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-nav, footer.site-footer, .btn { display: none !important; } }

/* Smaller showroom map and the click-to-pick map */
.map-frame { aspect-ratio: auto; height: 220px; min-height: 0; max-width: 560px; }
@media (max-width: 575.98px) { .map-frame { aspect-ratio: auto; height: 190px; } }
.map-pick { height: 260px; max-width: 560px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }

/* Showroom cover photo and profile picture */
.showroom-cover { height: 170px; background: #c9d3d8 linear-gradient(135deg, var(--teal) 0%, var(--asphalt) 100%) center / cover no-repeat; }
.showroom-head { align-items: flex-start; }
.showroom-avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; margin-top: -48px; background: #fff; box-shadow: var(--shadow-md); flex: 0 0 auto; }
.showroom-avatar-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--teal); }
.map-pin i + i { margin-left: 2px; font-size: .7em; vertical-align: middle; }
.near-me .input-group-text { background: #fff; }
.near-msg { color: #d5dbde; min-height: 1.2em; }
@media (max-width: 575.98px) { .showroom-cover { height: 110px; } .showroom-avatar { width: 80px; height: 80px; margin-top: -40px; } }

/* Description suggestion chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1.5px solid #5b8fc9; color: #3d78b8; background: #fff; border-radius: 999px; padding: .35rem .9rem; font-size: .9rem; line-height: 1.3; cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { background: #eef5fc; }
.chip.active { background: #3d78b8; color: #fff; border-color: #3d78b8; }
.chip:focus-visible { outline: 3px solid var(--kerb); outline-offset: 2px; }

/* ===== Mobile-first responsive polish ===== */
html, body { max-width: 100%; }
body { -webkit-tap-highlight-color: rgba(15,118,110,.15); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
@media (max-width: 767.98px) {
  .container, .container-fluid { padding-left: 14px; padding-right: 14px; }
  /* 16px inputs stop iOS from zooming on focus; bigger touch targets */
  .form-control, .form-select, textarea.form-control { font-size: 16px; min-height: 46px; }
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
  .btn-sm { min-height: 38px; }
  .form-check-input { width: 1.3em; height: 1.3em; }
  h1, .h1 { font-size: 1.55rem; } h2, .h2 { font-size: 1.3rem; } .section-title { font-size: 1.25rem; margin-bottom: .9rem; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.3rem); max-width: none; }
  .hero p.lead { font-size: 1rem; }
  .panel { padding: .9rem 1rem; border-radius: 12px; }
  .dash-main { padding: .85rem; }
  .stat .v { font-size: 1.5rem; }
  .alert { font-size: .95rem; }
  /* wide tables scroll sideways instead of breaking the page */
  .panel table:not(.spec-table), .dash-main table:not(.spec-table) { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .d-flex.justify-content-between.flex-wrap { gap: .5rem; }
  .btn-group, .d-flex.gap-1.flex-wrap { flex-wrap: wrap; }
  footer.site-footer { text-align: left; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .map-pick { height: 230px; max-width: 100%; }
  .chips { gap: .4rem; } .chip { font-size: .85rem; padding: .3rem .75rem; }
  .msg { max-width: 92%; }
}
@media (max-width: 575.98px) {
  /* Compact horizontal car cards: photo left, details right */
  .vcard { flex-direction: row; }
  .vcard .ph { flex: 0 0 42%; aspect-ratio: auto; min-height: 148px; }
  .vcard .body { padding: .65rem .75rem; gap: .2rem; min-width: 0; }
  .vcard h3 { font-size: .98rem; }
  .vcard .price { font-size: 1.05rem; }
  .vcard .specs { font-size: .8rem; }
  .vcard .actions { flex-wrap: wrap; }
  .vcard:hover { transform: none; }
  .vcard .badges { left: .3rem; top: .3rem; }
  /* Showroom header centred on phones */
  .showroom-head { flex-direction: column; align-items: center; text-align: center; }
  .showroom-head .d-flex { justify-content: center; }
  .search-panel .btn { width: 100%; }
  .thumbs button { flex: 0 0 72px; } .thumbs img { width: 72px; height: 54px; }
  .auth-card { margin: 1.25rem auto; }
  .tile { padding: .75rem; }
}
/* Landscape phones and small tablets */
@media (max-height: 480px) and (orientation: landscape) { .hero { padding: 1.5rem 0 3rem; } .site-nav { position: static; } }
/* Large screens: keep line lengths comfortable */
@media (min-width: 1400px) { .container { max-width: 1320px; } }
