:root{
  --bg:#f6f7f9;
  --text:#121417;
  --muted:#5b6470;
  --line:#e6e8ee;
  --radius:18px;
}

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
  position:relative;
}

a{ color:inherit; }

.container{
  max-width:1100px;
  margin:0 auto;
  padding:0 16px;
}

.muted{ color:var(--muted); }
.small{ font-size:12px; font-weight:800; }

/* ===== Header ===== */
.site-header{
  background:#fff;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:20;
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 0;
}

.brand{ text-decoration:none; }
.brand-name{ font-weight:900; }
.brand-sub{ font-size:12px; }

.nav{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.nav-link{
  font-weight:800;
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
}

.nav-link:hover{ background:#f0f2f6; }
.nav-link.active{ background:#eef2ff; }

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
  text-decoration:none;
  line-height:1;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.btn:hover{ transform:translateY(-1px); }
.btn.primary{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

/* ===== Hero ===== */
.hero{ padding:18px 0 6px; }

.hero-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 10px 22px rgba(0,0,0,.06);
  padding:18px;
}

.kicker{
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
}

.hero-sub{ margin:10px 0 0; }
.hero-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.hero-link{ color:inherit; text-decoration:underline; text-underline-offset:3px; }
.hero-meta{ margin-top:14px; display:flex; gap:10px; flex-wrap:wrap; }

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:800;
  font-size:12px;
  color:var(--muted);
}

/* ===== Sections ===== */
.section{ padding:18px 0 28px; }

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 12px;
}

.section-title{ margin:0; font-size:22px; font-weight:900; }

/* ===== Grid / Cards ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:14px;
}

@media (max-width:900px){
  .grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width:560px){
  .grid{ grid-template-columns:1fr; }
}

.card{
  display:block;
  text-decoration:none;
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 10px 22px rgba(0,0,0,.06);
  overflow:hidden;
  position:relative; /* safer stacking context */
}

.thumb{
  width:100%;
  height:180px;
  object-fit:cover;
  display:block;
  background:#f2f4f8;
}

.card .thumb:not(img){
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:var(--muted);
}

.pad{ padding:14px; }

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--line);
  font-weight:900;
  font-size:12px;
}

.price{ font-weight:900; }

.card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.card-title{
  margin:10px 0 8px;
  font-weight:900;
  font-size:16px;
}

.card-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}

/* Make sure action row always shows */
.card-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
  position:relative;
  z-index:2;
}

/* ===== Empty state ===== */
.empty{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 10px 22px rgba(0,0,0,.06);
}

.empty-title{ font-weight:900; font-size:16px; margin-bottom:4px; }

.clamp{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* ===== Page head ===== */
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.page-title{ margin:0; font-size:28px; line-height:1.1; font-weight:900; }
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ===== Breadcrumbs ===== */
.breadcrumbs{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}

.crumb{ color:var(--text); text-decoration:none; font-weight:800; }
.crumb:hover{ text-decoration:underline; text-underline-offset:3px; }
.crumb-sep{ color:var(--muted); font-weight:900; }
.crumb-current{ color:var(--muted); font-weight:900; }

/* ===== Vehicle page ===== */
.vehicle{
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap:16px;
  align-items:start;
}

@media (max-width:900px){
  .vehicle{ grid-template-columns:1fr; }
}

.vehicle-media{ background:transparent; }

.vehicle-img{
  width:100%;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background:#fff;
  display:block;
  object-fit:cover;
  max-height:520px;
}

.vehicle-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  height:420px;
  color:var(--muted);
  font-weight:900;
}

.vehicle-thumbs{
  display:flex;
  gap:10px;
  margin-top:10px;
  overflow:auto;
  padding-bottom:4px;
}

.vehicle-thumb{
  width:92px;
  height:68px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
}

.vehicle-info{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 10px 22px rgba(0,0,0,.06);
  padding:16px;
}

.vehicle-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.vehicle-title{
  margin:10px 0 10px;
  font-size:26px;
  line-height:1.15;
  font-weight:900;
}

.vehicle-stats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin:12px 0;
}

@media (max-width:520px){
  .vehicle-stats{ grid-template-columns:1fr; }
}

.stat{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:#fff;
}

.stat-label{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.stat-value{
  margin-top:6px;
  font-weight:900;
  font-size:16px;
}

.vehicle-desc{
  margin-top:10px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.vehicle-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

/* ===== Footer ===== */
.site-footer{
  margin-top:22px;
  padding:18px 0 28px;
  border-top:1px solid var(--line);
  background:#fff;
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.footer-title{ font-weight:900; }

.footer-links{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer-links a{
  text-decoration:none;
  font-weight:800;
}

.footer-links a:hover{
  text-decoration:underline;
  text-underline-offset:3px;
}

.footer-contact{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer-contact a{ text-decoration:none; font-weight:800; }

/* ===== CTA / filler cards ===== */
.card-cta{ border-style:dashed; }
.card-cta .pad,
.card-fill .pad{ min-height:180px; }
.card-fill{ background:#fff; }

/* ===== Inputs / filters ===== */
.input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:800;
  outline:none;
}

.input:focus{
  border-color:#c7d2fe;
  box-shadow:0 0 0 4px rgba(199,210,254,.45);
}

.filters{
  display:grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap:12px;
  align-items:end;
}

@media (max-width:900px){
  .filters{ grid-template-columns:1fr 1fr; }
}

@media (max-width:560px){
  .filters{ grid-template-columns:1fr; }
}

.field label{ display:block; margin-bottom:6px; }

/* ===== Icon buttons ===== */
.icon-btn{ gap:10px; }
.icon{ width:18px; height:18px; display:inline-flex; }
.icon svg{ width:18px; height:18px; display:block; }

/* ===== Featured slider ===== */
.featured{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:#fff;
}

.featured-slide{
  display:none; /* JS sets .active */
  text-decoration:none;
  color:inherit;
  grid-template-columns: 1.2fr .8fr;
}

@media (max-width:900px){
  .featured-slide{ grid-template-columns: 1fr; }
}

.featured-slide.active{ display:grid; }

.featured-media{ background:#f2f4f8; min-height:280px; }
.featured-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.featured-placeholder{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:var(--muted);
}

.featured-info{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.featured-title{ margin:0; font-weight:900; font-size:18px; }

.featured-meta{
  display:flex;
  gap:12px;
  align-items:baseline;
  flex-wrap:wrap;
}

.featured-dots{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-top:12px;
}

.dot{
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  padding:0;
}

.dot.active{
  background:#111827;
  border-color:#111827;
}

/* ===== Watermark background (safe) ===== */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1; /* SAFEST: never overlays content */
  background-image:url("/images/bg-cars.svg");
  background-repeat:repeat;
  background-size:520px 300px;
  opacity:0.08;            /* try 0.05–0.12 */
  transform:rotate(-8deg); /* optional */
  transform-origin:center;
}

/* Keep primary layout above watermark (optional now, but fine) */
.site-header,
main,
.site-footer{
  position:relative;
  z-index:1;
}
