/* K & M Towing - public site
   Palette: logo navy, safety amber, snow, asphalt. Type: Barlow (highway-signage family). */
:root {
  --navy: #172a5c;
  --navy-deep: #0e1b3d;
  --amber: #f5b301;
  --amber-hover: #ffc629;
  --snow: #f3f5f7;
  --white: #ffffff;
  --asphalt: #22262b;
  --steel: #59636f;
  --line: #d8dde4;
  --sold: #a3241a;
  --pending: #8a5a00;
  --ok: #1d6b3a;
  --radius: 6px;
  --wrap: 1180px;
  --head-font: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body-font: "Barlow", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body-font); font-size: 18px; line-height: 1.6; color: var(--asphalt); background: var(--snow); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--navy-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head-font); line-height: 1.1; color: var(--navy-deep); margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.4rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.muted { color: var(--steel); }
.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: #000; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; font-family: var(--head-font); font-weight: 700; font-size: 1.15rem;
       padding: .6em 1.1em; border-radius: var(--radius); border: 2px solid transparent; text-decoration: none; cursor: pointer; line-height: 1.1; }
.btn-call { background: var(--amber); color: #1a1400; }
.btn-call:hover { background: var(--amber-hover); color: #1a1400; }
.btn-outline { border-color: currentColor; color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-light { border-color: #fff; color: #fff; background: transparent; }
.btn-light:hover { background: #fff; color: var(--navy-deep); }
.btn svg { width: 1em; height: 1em; flex: none; }

/* ---------- Header ---------- */
.site-header { background: var(--white); position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 92px; }
.site-header .wrap { max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.brand img { height: 84px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 0 2px; justify-content: flex-end; }
.main-nav a { display: block; font-family: var(--head-font); font-weight: 600; font-size: 1.1rem; color: var(--asphalt); text-decoration: none; padding: 8px 8px; border-bottom: 3px solid transparent; white-space: nowrap; }
.main-nav a:hover { color: var(--navy); border-bottom-color: var(--line); }
.main-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--amber); }
.header-call { flex: none; }
.menu-toggle { display: none; margin-left: auto; background: var(--navy); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 14px; font: 600 1.05rem var(--head-font); cursor: pointer; }
/* Tow-truck livery stripe under the header */
.livery { height: 8px; background: repeating-linear-gradient(-45deg, var(--amber) 0 14px, var(--navy) 14px 28px); }

@media (max-width: 1300px) {
  .header-row { flex-wrap: wrap; min-height: 72px; gap: 12px; padding: 8px 0; }
  .brand img { height: 60px; }
  .menu-toggle { display: inline-block; }
  .header-call { order: 3; width: 100%; justify-content: center; }
  .main-nav { order: 4; width: 100%; display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; flex-wrap: wrap; padding-bottom: 8px; }
  .main-nav a { padding: 12px 6px; border-bottom: 1px solid var(--line); }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 4px 0 0 var(--amber); padding-left: 14px; }
}

/* ---------- Home hero: the phone number is the headline act ---------- */
.hero { position: relative; color: #fff; background: var(--navy-deep); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,27,61,.94) 0%, rgba(14,27,61,.78) 45%, rgba(14,27,61,.15) 100%); }
.hero-inner { position: relative; z-index: 1; padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 7vw, 96px); max-width: 680px; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero-lead { font-size: 1.2rem; color: #dfe6f3; max-width: 34em; }
.hero-phone { display: inline-block; white-space: nowrap; font-family: var(--head-font); font-weight: 800; font-size: clamp(2.5rem, 8.2vw, 5.8rem); line-height: .95;
              color: var(--amber); text-decoration: none; letter-spacing: -.01em; margin: .15em 0 .2em; }
.hero-phone:hover { color: var(--amber-hover); }
.hero-phone-label { display: block; white-space: normal; font-family: var(--head-font); font-size: 1.25rem; color: #fff; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* Inner page hero */
.page-hero { position: relative; background: var(--navy-deep); color: #fff; overflow: hidden; }
.page-hero .hero-media img { object-position: center 55%; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,27,61,.92), rgba(14,27,61,.55)); }
.page-hero .wrap { position: relative; z-index: 1; padding-top: clamp(40px, 7vw, 84px); padding-bottom: clamp(32px, 6vw, 64px); }
.page-hero h1 { color: #fff; max-width: 18em; }
.page-hero p { color: #dfe6f3; font-size: 1.15rem; max-width: 36em; margin: 0; }
.page-hero.plain { background: var(--navy); }
.page-hero.plain::after { display: none; }
.crumbs { font-size: .95rem; margin-bottom: 10px; }
.crumbs a { color: var(--navy); }
.page-hero .crumbs a { color: #c9d4ea; }

/* ---------- Sections ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section + .section { padding-top: 0; }
.section.band { background: var(--white); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.band + .section { padding-top: clamp(40px, 6vw, 72px); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.split.media-right .split-media { order: 2; }
.split-media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split.media-right .split-media { order: 0; } }

/* Service links: photo tiles with a label bar */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.service { position: relative; display: block; text-decoration: none; color: #fff; border-radius: var(--radius); overflow: hidden; background: var(--navy); min-height: 300px; }
.service img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.service:hover img { transform: scale(1.04); }
.service-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 16px 16px; background: linear-gradient(transparent, rgba(14,27,61,.95) 55%); }
.service-label h3 { color: #fff; margin: 0 0 4px; font-size: 1.55rem; }
.service-label p { margin: 0; font-size: .98rem; color: #dfe6f3; line-height: 1.4; }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } .service { min-height: 220px; } }
@media (prefers-reduced-motion: reduce) { .service img { transition: none; } }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }
.gallery button { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #dfe5ec; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(5,10,25,.9); }
.lightbox img { max-width: 96vw; max-height: 86vh; width: auto; margin: 0 auto; }
.lightbox form { text-align: right; }
.lightbox button { background: var(--amber); border: 0; font: 700 1rem var(--head-font); padding: 8px 14px; border-radius: var(--radius); cursor: pointer; margin-bottom: 8px; }

/* Call-to-action band */
.cta-band { background: var(--navy); color: #fff; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding-top: 40px; padding-bottom: 40px; }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { margin: 6px 0 0; color: #dfe6f3; }
.cta-phone { font-family: var(--head-font); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--amber); text-decoration: none; line-height: 1; }
.cta-phone:hover { color: var(--amber-hover); }

/* Map */
.map-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.map-canvas { height: 440px; border-radius: var(--radius); border: 1px solid var(--line); background: #dfe5ec; }
.map-canvas iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.areas { columns: 2; padding-left: 1.1em; margin: 0 0 1em; }
@media (max-width: 820px) { .map-wrap { grid-template-columns: 1fr; } .map-canvas { height: 340px; } }

/* FAQ */
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-family: var(--head-font); font-size: 1.25rem; font-weight: 600; color: var(--navy-deep); }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .answer { padding: 14px 18px 4px; }

/* ---------- Forms ---------- */
.form-card { background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--amber); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: .98rem; margin-bottom: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 11px 12px; border: 1px solid #b9c1cc; border-radius: var(--radius); background: #fff; color: var(--asphalt); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgba(245,179,1,.45); outline-offset: 0; }
.field-error { color: var(--sold); font-size: .92rem; margin-top: 4px; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; border-left: 5px solid; background: var(--white); }
.notice.ok { border-color: var(--ok); }
.notice.error { border-color: var(--sold); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------- Parts & equipment ---------- */
.catalog { display: grid; grid-template-columns: 270px 1fr; gap: 32px; align-items: start; }
.filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 112px; }
.filters h2 { font-size: 1.35rem; }
.filters label.field { margin-bottom: 12px; }
.cat-list { list-style: none; margin: 0 0 16px; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 4px; text-decoration: none; color: var(--asphalt); }
.cat-list a:hover { background: var(--snow); }
.cat-list a[aria-current="true"] { background: var(--navy); color: #fff; }
.cat-list ul { list-style: none; padding-left: 14px; margin: 0; }
.cat-list .count { color: var(--steel); font-size: .9rem; }
.cat-list a[aria-current="true"] .count { color: #c9d4ea; }
.filters-toggle { display: none; }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; margin-bottom: 14px; }
}
.result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.result-bar form { display: flex; gap: 8px; align-items: center; }
.result-bar select { width: auto; }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.listing-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--asphalt); }
.listing-card:hover { border-color: var(--navy); }
.listing-card .thumb { position: relative; aspect-ratio: 4 / 3; background: #e6eaef; overflow: hidden; }
.listing-card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.listing-card .thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--steel); font-family: var(--head-font); }
.listing-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.listing-card h3 { font-size: 1.25rem; margin: 0; color: var(--navy-deep); }
.listing-card .meta { font-size: .92rem; color: var(--steel); }
.listing-card .price { margin-top: auto; padding-top: 6px; font-family: var(--head-font); font-weight: 700; font-size: 1.35rem; color: var(--asphalt); }
.status { position: absolute; top: 10px; left: 10px; font: 700 .9rem var(--head-font); padding: 3px 9px; border-radius: 3px; color: #fff; }
.status.pending { background: var(--pending); }
.status.sold { background: var(--sold); }
.status.featured { background: var(--navy); }
.empty { background: var(--white); border: 1px dashed #b9c1cc; border-radius: var(--radius); padding: 32px; text-align: center; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; text-decoration: none; }
.pager span { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Listing detail */
.item { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .item { grid-template-columns: 1fr; } }
.photos .main { position: relative; aspect-ratio: 4 / 3; background: #e6eaef; border-radius: var(--radius); overflow: hidden; }
.photos .main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #10182d; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 8px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 1; }
.thumbs button[aria-pressed="true"] { border-color: var(--amber); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.item-price { font-family: var(--head-font); font-weight: 800; font-size: 2.4rem; color: var(--navy-deep); line-height: 1; margin: 6px 0 14px; }
.facts { width: 100%; border-collapse: collapse; margin: 0 0 18px; }
.facts th, .facts td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 38%; color: var(--steel); font-weight: 600; }
.badge-status { display: inline-block; font: 700 1rem var(--head-font); padding: 3px 10px; border-radius: 3px; color: #fff; background: var(--ok); }
.badge-status.pending { background: var(--pending); }
.badge-status.sold { background: var(--sold); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #c9d4ea; margin-top: 0; font-size: .98rem; }
.site-footer a { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding-top: 48px; padding-bottom: 36px; }
.footer-top h2 { color: #fff; font-size: 1.35rem; margin-bottom: 10px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { height: 92px; width: auto; flex: none; }
.footer-phone { font-family: var(--head-font); font-weight: 700; font-size: 1.7rem; color: var(--amber) !important; text-decoration: none; }
.footer-links { list-style: none; padding: 0; margin: 0; columns: 2; }
.footer-links li { margin-bottom: 6px; }
.social { display: flex; gap: 10px; flex-wrap: wrap; }
.social img { width: 36px; height: 36px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; padding-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: .9rem; }
.credits { display: flex; align-items: center; gap: 16px; }
.credits span { color: #9fb0cf; }
.credits img { height: 30px; width: auto; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; align-items: flex-start; } }

/* Mobile call bar: always one tap away from calling */
.callbar { display: none; }
@media (max-width: 700px) {
  .header-call { display: none; }
  .callbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--amber); }
  .callbar a { flex: 1; text-align: center; padding: 14px; font: 800 1.3rem var(--head-font); color: #1a1400; text-decoration: none; }
  body { padding-bottom: 58px; }
}

/* Phones: bigger tap targets for the footer links (mobile-friendly rule, 2026-10-24). Desktop unchanged. */
@media (max-width: 700px) {
  .footer-links li { margin-bottom: 0; }
  .footer-links a { display: inline-block; padding: 11px 0; }
}
