:root {
  --ink: #102032;
  --muted: #667085;
  --line: #d9e1ea;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --navy: #143a5a;
  --red: #b4232d;
  --red-dark: #8d1821;
  --green: #1f7a4d;
  --gold: #a06300;
  --radius: 8px;
  --shadow: 0 20px 60px rgba(16, 32, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--ink);
  color: white;
  padding: .5rem .75rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--red);
  color: white;
  font-weight: 900;
  letter-spacing: 0;
}

.brand small,
.muted {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .94rem;
}

.site-nav a {
  padding: .65rem .75rem;
  border-radius: 6px;
  text-decoration: none;
  color: #26384b;
  font-weight: 650;
}

.site-nav a:hover,
.site-nav .active {
  background: var(--soft);
  color: var(--navy);
}

.nav-cta {
  background: var(--navy);
  color: white !important;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: white;
  padding: .6rem .75rem;
  border-radius: 6px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 5vw, 5rem);
  background:
    linear-gradient(120deg, #fff 0%, #fff 54%, #eef4f8 54%, #eef4f8 100%);
}

.hero h1,
.page-title h1,
.detail-panel h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(2.5rem, 6vw, 5.7rem);
  line-height: .96;
  letter-spacing: 0;
}

.tagline {
  margin: 1.25rem 0 .5rem;
  color: var(--red);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 850;
}

.hero-copy p:not(.tagline),
.page-title p {
  max-width: 680px;
  color: #41556a;
  font-size: 1.12rem;
}

.hero-actions,
.admin-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1rem;
  border: 1px solid var(--red);
  border-radius: 7px;
  background: var(--red);
  color: white;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.button.ghost {
  background: white;
  color: var(--red);
}

.button.quiet {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}

.button.small {
  min-height: 36px;
  padding: .5rem .7rem;
  font-size: .9rem;
}

.button.danger {
  background: #6f141b;
  border-color: #6f141b;
}

.hero-media {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: white;
}

.section,
.page-title,
.admin-top,
.admin-section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 5vw, 5rem);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

h2 {
  margin: 0 0 .8rem;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.05;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.listing-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 30px rgba(16, 32, 50, .06);
}

.listing-photo {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--soft);
}

.listing-photo img,
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .32rem .55rem;
  background: var(--navy);
  color: white;
  font-size: .78rem;
  font-weight: 850;
}

.listing-photo .status {
  position: absolute;
  top: .7rem;
  left: .7rem;
}

.status-available { background: var(--green); }
.status-pending { background: var(--gold); }
.status-sold { background: #536170; }
.status-coming-soon { background: var(--navy); }
.status-as-is { background: var(--red-dark); }

.listing-body {
  display: grid;
  gap: .8rem;
  padding: 1rem;
}

.listing-body h3 {
  margin: 0;
  font-size: 1.2rem;
}

.listing-body h3 a {
  text-decoration: none;
}

.price,
.detail-price {
  color: var(--red);
  font-size: 1.3rem;
}

.trust-band {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 5vw, 5rem);
  background: var(--navy);
  color: white;
}

.trust-band p {
  color: #d7e2ec;
  max-width: 720px;
}

.trust-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.trust-points span {
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  padding: 1rem;
  font-weight: 800;
}

.page-title {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.page-title.centered {
  text-align: center;
}

.page-title.centered p {
  margin-left: auto;
  margin-right: auto;
}

.inventory-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 2rem clamp(1rem, 5vw, 5rem) 5rem;
}

.filters,
.form-panel {
  display: grid;
  gap: 1rem;
  align-self: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.filters {
  position: sticky;
  top: 98px;
}

label {
  display: grid;
  gap: .35rem;
  color: #34465a;
  font-size: .92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .8rem;
  color: var(--ink);
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

.inventory-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 1.5rem;
  padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 5vw, 5rem);
  background: var(--soft);
}

.gallery {
  display: grid;
  gap: 1rem;
}

.gallery img {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 12px 30px rgba(16, 32, 50, .08);
}

.detail-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.detail-panel h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
}

.specs div {
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.specs dt {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.specs dd {
  margin: 0;
  font-weight: 850;
}

.note {
  border-left: 4px solid var(--red);
  padding: .9rem;
  background: #fff4f4;
}

.narrow {
  max-width: 900px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.checkbox input {
  width: auto;
}

.admin-auth {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 2rem;
  background: var(--soft);
}

.login-card {
  width: min(100%, 440px);
  box-shadow: var(--shadow);
}

.error {
  color: var(--red);
  font-weight: 800;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--soft);
}

.admin-list,
.inquiry-list {
  display: grid;
  gap: .75rem;
}

.admin-list article,
.inquiry-list article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.admin-list img {
  width: 82px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.admin-list span,
.inquiry-list span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.photo-admin {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.photo-admin figure {
  margin: 0;
}

.photo-admin img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.danger-form {
  margin-top: 1rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  background: #0d1b2a;
  color: white;
}

.site-footer span {
  color: #c9d5df;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .hero,
  .trust-band,
  .detail-layout,
  .inventory-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    background: white;
  }

  .filters {
    position: static;
  }

  .card-grid,
  .inventory-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
  }

  .brand small {
    display: none;
  }

  .hero h1,
  .page-title h1 {
    font-size: 2.6rem;
  }

  .card-grid,
  .inventory-results,
  .form-grid,
  .trust-points,
  .specs,
  .photo-admin {
    grid-template-columns: 1fr;
  }

  .admin-top,
  .site-footer,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-list article,
  .inquiry-list article {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .admin-list article .button {
    grid-column: 1 / -1;
  }
}

/* Ontario Ambulance Sales logo bar - temporary real logo placement */
.oas-logo-bar {
  background: #ffffff;
  border-bottom: 1px solid rgba(11, 31, 58, 0.12);
  padding: 12px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 20;
}

.oas-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.oas-logo-link img {
  display: block;
  width: auto;
  max-width: min(420px, 86vw);
  max-height: 118px;
  object-fit: contain;
}

@media (max-width: 700px) {
  .oas-logo-bar {
    padding: 10px 12px;
  }

  .oas-logo-link img {
    max-height: 86px;
    max-width: 92vw;
  }
}

/* Real Ontario Ambulance Sales logo */
.brand-logo-img {
  display: block;
  width: auto;
  height: 54px;
  max-width: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

@media (max-width: 760px) {
  .brand-logo-img {
    height: 46px;
    max-width: 180px;
  }
}

/* Real Ontario Ambulance Sales header logo override */
.brand-logo-img {
  display: block !important;
  width: auto !important;
  height: 54px !important;
  max-width: 245px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  background: #fff !important;
}

/* Hide old red OAS placeholder if it still exists beside the real logo */
.brand-mark,
.logo-mark,
.brand-badge,
.logo-badge,
.brand-icon,
.logo-icon,
.brand-square,
.logo-square {
  overflow: hidden;
}

@media (max-width: 800px) {
  .brand-logo-img {
    height: 46px !important;
    max-width: 190px !important;
  }
}

/* Final real logo placement */
.brand {
  gap: 12px;
}

.brand-logo-img {
  display: block !important;
  width: auto !important;
  height: 58px !important;
  max-width: 210px !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  background: #ffffff !important;
}

.oas-logo-bar {
  display: none !important;
}

@media (max-width: 800px) {
  .brand-logo-img {
    height: 46px !important;
    max-width: 160px !important;
  }
}

/* Bigger cropped Ontario Ambulance Sales logo */
.brand-logo-img {
  display: block !important;
  height: 72px !important;
  width: auto !important;
  max-width: 96px !important;
  object-fit: contain !important;
  background: #ffffff !important;
  border-radius: 4px !important;
}

.brand {
  gap: 14px !important;
  align-items: center !important;
}

@media (max-width: 800px) {
  .brand-logo-img {
    height: 58px !important;
    max-width: 78px !important;
  }
}

/* Final temporary header logo size tweak */
.brand-logo-img {
  height: 86px !important;
  max-width: 110px !important;
}

@media (max-width: 800px) {
  .brand-logo-img {
    height: 66px !important;
    max-width: 86px !important;
  }
}
