:root {
  --primary: #0b1f3a;
  --primary-light: #16305a;
  --accent: #c9a227;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #667085;
  --border: #e6e8ec;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: #fff; }
.brand img { height: 40px; width: auto; border-radius: 6px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.85); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: #fff; }
.nav-cta {
  background: var(--accent);
  color: #1a1a1a !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 64px 0 90px;
}
.hero h1 { font-size: 2.4rem; margin: 0 0 12px; max-width: 640px; }
.hero p { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 560px; margin: 0 0 32px; }

/* ---------- Search / filter bar ---------- */
.filter-bar {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  margin-top: -56px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  position: relative;
  z-index: 5;
}
.filter-bar input, .filter-bar select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
}
.filter-bar button {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 600;
}
.filter-bar .field-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; display: block; }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { margin: 0 0 6px; font-size: 1.6rem; }
.section-head p { margin: 0; color: var(--text-muted); }
.result-count { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Car grid / cards ---------- */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.car-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.car-card .thumb-wrap { position: relative; aspect-ratio: 4/3; background: #eef0f3; overflow: hidden; }
.car-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-available { background: #dcfce7; color: var(--success); }
.badge-reserved { background: #fef3c7; color: var(--warn); }
.badge-sold { background: #fee2e2; color: var(--danger); }
.status-tag { position: absolute; top: 12px; left: 12px; }
.featured-tag {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #1a1a1a;
  font-size: 0.7rem; font-weight: 700; padding: 4px 9px; border-radius: 999px;
}
.car-card .card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.car-card h3 { margin: 0; font-size: 1.05rem; }
.car-card .price { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.car-card .meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--text-muted); }
.car-card .meta span { background: var(--bg); padding: 3px 9px; border-radius: 6px; }
.car-card .card-actions { margin-top: auto; padding-top: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent; width: 100%;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #1a1a1a; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 1.02rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- Car detail page ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin: 20px 0; }
.breadcrumb a { color: var(--primary); }
.car-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding-bottom: 60px; }
@media (max-width: 900px) { .car-detail { grid-template-columns: 1fr; } }

.gallery-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef0f3;
  aspect-ratio: 4/3;
  margin-bottom: 10px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.gallery-main.spin-enabled { cursor: grab; }
.gallery-main.spin-enabled.dragging { cursor: grabbing; }
.gallery-main.spin-enabled.dragging img { filter: brightness(0.97); }
.spin-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(11, 31, 58, 0.78); color: #fff; padding: 7px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 6px;
  pointer-events: none; transition: opacity 0.4s ease; backdrop-filter: blur(2px);
}
.spin-hint.hidden { opacity: 0; }
.spin-badge {
  position: absolute; top: 12px; right: 12px; background: rgba(11, 31, 58, 0.78); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 5px; pointer-events: none;
}
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 76px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; opacity: 0.75;
}
.gallery-thumbs img.active { border-color: var(--accent); opacity: 1; }

.detail-panel h1 { font-size: 1.7rem; margin: 6px 0 8px; }
.detail-price { font-size: 1.9rem; font-weight: 800; color: var(--primary); margin: 6px 0 16px; }
.detail-price small { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.detail-actions { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.status-note { padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 4px; }
.status-note.reserved { background: #fef3c7; color: #92400e; }
.status-note.sold { background: #fee2e2; color: #991b1b; }

.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 18px 0; }
.spec-item { padding: 12px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.spec-item:nth-child(2n) { border-right: none; }
.spec-item .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.spec-item .value { font-weight: 600; margin-top: 2px; }

.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.feature-chips span { background: var(--bg); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; }

.description-block { margin: 24px 0; }
.description-block h2 { font-size: 1.15rem; margin-bottom: 8px; }
.description-block p { color: #33383f; white-space: pre-line; }

/* ---------- Floating WhatsApp button ---------- */
.wa-float {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  background: #25d366; color: #fff; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  font-size: 1.6rem;
}
.wa-float:hover { transform: scale(1.06); }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.85); padding: 44px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; margin: 0 0 12px; font-size: 0.95rem; }
.footer-grid p, .footer-grid a { font-size: 0.88rem; color: rgba(255,255,255,0.7); display: block; margin-bottom: 6px; }
.footer-bottom { text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); }

/* ---------- Loaders / misc ---------- */
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 320px; }

@media (max-width: 720px) {
  .filter-bar { grid-template-columns: 1fr 1fr; margin-top: 20px; }
  .hero { padding: 40px 0 70px; }
  .navbar .nav-links { display: none; }
}

/* ---------- Motion: page fade-in, scroll reveal, WhatsApp pulse ---------- */
@media (prefers-reduced-motion: no-preference) {
  body { animation: pageFadeIn 0.5s ease both; }
  .hero h1, .hero p { animation: heroRise 0.7s cubic-bezier(0.16, 0.84, 0.44, 1) both; }
  .hero p { animation-delay: 0.08s; }
  .wa-float { animation: waPulse 2.6s ease-in-out infinite; }
}
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes waPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
  50% { box-shadow: 0 6px 24px rgba(37,211,102,0.6); }
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 0.84, 0.44, 1), transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1);
}
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .car-card, .post-card, .wa-float, body, .hero h1, .hero p { animation: none !important; transition: none !important; }
}
