:root {
  --bg: #dfe0e5;
  --panel: #f8f8f9;
  --ink: #111827;
  --muted: #596572;
  --primary: #0c2d68;
  --primary-strong: #081d43;
  --brand-red: #d91d2a;
  --brand-red-dark: #b8121d;
  --accent: #f4b942;
  --line: #d9d9dd;
  --shadow: 0 18px 40px rgba(12,45,104,0.14);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Inter", sans-serif; background: var(--bg); color: var(--ink);
}
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
.page-shell { max-width: 1280px; margin: 0 auto; padding: 20px; }
.site-header {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 22px; padding: 18px 22px;
  background-image: linear-gradient(90deg, rgba(8,17,32,0.7), rgba(8,17,32,0.22)), url('https://i.imgur.com/NWHbInu.png');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 30px 60px rgba(8,17,32,0.18);
}
.brand-wrap { display: flex; align-items: center; min-width: 0; position: relative; z-index: 1; }
.brand-logo { width: 150px; height: 52px; display: block; object-fit: contain; object-position: left center; }
.brand-wordmark {
  display: inline-block; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.96); font-size: 0.9rem; text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.brand-name { display: block; font-weight: 900; letter-spacing: -0.05em; color: var(--primary); font-size: 1.35rem; }
.brand-wrap small { color: var(--muted); }
.header-actions {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; flex: 1; position: relative; z-index: 1;
}
.nav-btn, .primary-btn, .secondary-btn, .close-btn, .tab, .chip {
  border: 0; border-radius: 12px; cursor: pointer; transition: .25s ease; font-weight: 600;
}
.nav-btn {
  background: rgba(255,255,255,0.12); color: #fff; padding: 10px 14px; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12); box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}
.nav-btn.active {
  background: rgba(255,255,255,0.22); color: #fff; border-color: rgba(255,255,255,0.18);
}
.primary-btn { background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark)); color: white; padding: 12px 18px; box-shadow: var(--shadow); }
.secondary-btn { background: rgba(255,255,255,0.9); color: var(--primary); padding: 12px 18px; }
.primary-btn.large, .secondary-btn.large { padding: 14px 24px; }
.auth-box { display: flex; gap: 8px; position: relative; z-index: 1; }
.hidden { display: none !important; }
.logged-user { color: var(--ink, #17202a); font-size: 0.9rem; font-weight: 700; }
main { padding-top: 20px; }
.view { display: none; }
.view.active { display: block; }
.hero-card {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 28px; box-shadow: var(--shadow);
}
.hero-copy h1 { font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.08; margin: 12px 0; color: var(--ink); }
.hero-copy p { color: var(--muted); font-size: 1.07rem; max-width: 620px; }
.tiny-tag { background: rgba(12,45,104,.12); color: var(--primary); display: inline-block; padding: 7px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.cta-row { display: flex; gap: 12px; margin-top: 20px; }
.hero-visual { display: grid; place-items:center; background: #fff; border: 0; border-radius: 0; }
.hero-visual img { width: min(100%, 420px); background: transparent; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 22px; }
.info-card, .form-card, .profile-card, .modal-card, .detail-panel, .comment-box {
  background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.info-card { padding: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.info-card p { color: var(--muted); }
.info-card h3 { margin-top: 0; }
.home-listing-section { margin-top: 30px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:14px; }
.section-heading h2 { margin: 10px 0 0; font-size: 1.7rem; }
.featured-section { padding-top: 4px; }
.featured-tag { background: rgba(217,29,42,.12); color: var(--brand-red-dark); }
.featured-empty { padding: 26px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.58); }
.featured-card { display:flex; gap:18px; align-items:center; padding:14px; background:#fff; border:1px solid var(--accent); border-radius:18px; box-shadow:var(--shadow); }
.featured-card img { width:180px; height:110px; object-fit:cover; border-radius:12px; }
.featured-card div { display:grid; gap:8px; }
.featured-card span { color:var(--primary); font-weight:800; }
.toolbar {
  display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar input, .toolbar select { flex: 1 1 180px; min-width: 150px; }
.toolbar input, .toolbar select, .form-card input, .form-card select, .form-card textarea, .auth-form input, .auth-form select {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 12px 14px; color: var(--ink);
}
.catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
}
.car-card { background: white; border-radius: 20px; overflow:hidden; border:1px solid var(--line); box-shadow: var(--shadow); }
.car-card img { height: 190px; width: 100%; object-fit: cover; }
.car-body { padding: 16px; }
.car-meta { display:flex; justify-content:space-between; gap: 8px; align-items:center; }
.price { color: var(--primary); font-weight: 800; font-size: 1.35rem; }
.car-card h3 { margin: 10px 0 5px; }
.car-card p { margin:0; color: var(--muted); }
.car-card button { margin-top: 14px; width:100%; }
.featured-request-btn { border-color: var(--accent); color: var(--primary); }
.detail-layout { display:grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.detail-panel { padding: 18px; }
.gallery { display:grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.gallery img { border-radius: 18px; object-fit: cover; height: 100%; cursor: zoom-in; }
.gallery > .gallery-image { min-height: 390px; object-fit: contain; background: #eef1f3; }
.thumb-grid { display:grid; gap:10px; }
.thumb-grid img { height: 120px; width:100%; object-fit:cover; }
.detail-panel h2 { margin: 8px 0 12px; font-size: 2rem; }
.whatsapp-btn { display: inline-block; margin: 4px 8px 0 0; padding: 12px 18px; border-radius: 12px; background: #16a05d; color: #fff; text-decoration: none; font-weight: 700; }
.whatsapp-btn:hover { background: #12824b; }
.detail-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; color: var(--muted); margin: 16px 0; }
.comment-box { padding: 18px; }
.comment-box textarea { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius:12px; padding:12px; }
.comment-box button { margin-top: 10px; }
.comment-list { list-style:none; padding: 0; margin: 16px 0 0; display:grid; gap:10px; }
.comment-list li { background: #f7f9fa; padding: 12px 14px; border-radius: 12px; border:1px solid var(--line); }
.comment-list small { display: block; color: var(--muted); margin-bottom: 6px; }
.form-card { padding: 22px; max-width: 920px; margin: 0 auto; }
.form-card h2 { margin-top: 0; }
.form-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:16px; }
.form-card label, .auth-form label { display:grid; gap:8px; font-weight:600; color: var(--ink); }
textarea { resize: vertical; }
.photo-upload { display:block; margin: 18px 0; }
.photo-preview { display:flex; gap:10px; flex-wrap:wrap; margin: 12px 0 18px; }
.photo-preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; border:1px solid var(--line); }
.profile-card { padding: 22px; margin-bottom: 18px; }
.profile-head { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.status-pill { display:inline-block; padding: 8px 12px; border-radius: 999px; background: rgba(12,45,104,.12); color: var(--primary); font-weight:700; }
.modal { position: fixed; inset: 0; background: rgba(7,18,26,.48); display: grid; place-items: center; z-index: 50; }
.modal.hidden { display:none; }
.modal-card { width: min(94vw, 520px); padding: 22px; position: relative; }
.paypal-card { text-align:center; }
.paypal-price { display:block; margin: 10px 0 18px; color:var(--primary); font-size:1.8rem; }
.payment-note { color:var(--muted); font-size:.85rem; }
.image-viewer { position: fixed; inset: 0; z-index: 100; display:grid; place-items:center; padding: 34px; background: rgba(3, 9, 18, .94); }
.image-viewer.hidden { display:none; }
.image-viewer img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; object-fit: contain; }
.image-viewer-close { position: fixed; top: 18px; right: 22px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: white; font-size: 2rem; line-height: 1; cursor: pointer; }
.close-btn { position:absolute; right: 16px; top: 14px; width: 32px; height: 32px; background: #eef3f4; }
.tabs { display:flex; gap:8px; margin-bottom: 18px; }
.tab { background: #edf3f5; color: var(--ink); padding: 10px 12px; }
.tab.active { background: rgba(12,45,104,.12); color: var(--primary); }
.auth-form { display:none; }
.auth-form.active { display:grid; gap: 14px; }
.empty-state { padding: 30px; border: 1px dashed var(--line); border-radius: 18px; text-align:center; color: var(--muted); background: #fbfbfb; }
@media (max-width: 900px) {
  .site-header { flex-direction: column; align-items: stretch; }
  .hero-card, .detail-layout, .form-grid, .info-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
