@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #161224;
  --muted: #656078;
  --brand: #1b1528;
  --brand2: #2d2244;
  --accent: #c850c0;
  --accent-d: #a6369f;
  --paper: #f6f4fa;
  --line: #e6e2ee;
  --white: #fff;
  --ok: #15803d;
  --warn: #b45309;
  --sold: #991b1b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
h1, h2, h3 { letter-spacing: -.02em; }

/* Header */
.topbar {
  height: 76px;
  padding: 0 max(calc((100% - 1180px)/2), 5%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid #ffffff12;
}
.brand img { height: 42px; width: auto; display: block; mix-blend-mode: lighten; }
.topbar nav { display: flex; gap: 32px; font-size: 14px; font-weight: 500; color: #d9d3e6; }
.topbar nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle { border: 0; font: 700 13px 'Plus Jakarta Sans', sans-serif; background: var(--accent); padding: 9px 16px; border-radius: 999px; color: #fff; cursor: pointer; transition: background .2s; }
.lang-toggle:hover { background: var(--accent-d); }
.menu-toggle { display: none; background: none; border: 0; font-size: 24px; color: #fff; cursor: pointer; }

/* Hero & Overlapping Search Card (Flow-based so it never clips) */
.hero {
  background: radial-gradient(circle at 85% 20%, #c850c028 0%, transparent 45%), linear-gradient(180deg, var(--brand) 0%, var(--brand2) 100%);
  color: #fff;
  padding: 64px max(calc((100% - 1180px)/2), 5%) 96px;
}
.hero-copy { max-width: 650px; }
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #ffffff14;
  border: 1px solid #ffffff24;
  color: #f3c6f0;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.07; font-weight: 800; margin: 0 0 16px; }
.hero-copy p { font-size: 17px; color: #d9d3e6; max-width: 540px; margin: 0; }

.search-wrapper { max-width: 1180px; margin: -52px auto 0; padding: 0 5%; position: relative; z-index: 5; }
.search-card {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  box-shadow: 0 18px 45px #1b152822;
}
.search-card label, .sort { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.search-card input, .search-card select, .sort select {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: 500 14px inherit;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  width: 100%;
}

/* Buttons */
.button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 10px; font: 700 14px 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: background .2s, transform .1s; }
.button:active { transform: scale(.99); }
.button-accent { background: var(--accent); color: #fff; height: 46px; }
.button-accent:hover { background: var(--accent-d); }
.button-dark { background: var(--brand); color: #fff; }
.button-dark:hover { background: var(--brand2); }
.button-outline { border: 1px solid #d5cfe2; background: #fff; color: var(--ink); }
.button-outline:hover { background: var(--paper); }

/* Trust Strip */
.trust { max-width: 1180px; margin: 44px auto 0; padding: 0 5%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.trust div { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--paper); border-radius: 12px; border-left: 3px solid var(--accent); }
.trust strong { font-size: 15px; }
.trust span { font-size: 13px; color: var(--muted); }

/* Inventory */
.section { max-width: 1180px; margin: 0 auto; padding: 64px 5%; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section h2, .how h2 { font-size: 32px; font-weight: 800; margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.inventory-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.checkbox-inline input { accent-color: var(--accent); width: 16px; height: 16px; }
.sort { grid-auto-flow: column; align-items: center; gap: 10px; }
.sort select { width: auto; height: 42px; }

.car-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.car-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.car-card:hover { box-shadow: 0 16px 38px #1b15281c; transform: translateY(-4px); }
.car-card.is-sold { opacity: .82; }
.car-image { aspect-ratio: 3/2; background: var(--paper); position: relative; overflow: hidden; cursor: pointer; }
.car-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.car-card:hover .car-image img { transform: scale(1.04); }
.no-photo { height: 100%; display: grid; place-items: center; color: #a9a3b8; font-size: 14px; font-weight: 600; }
.car-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.car-year { background: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px #0002; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff; }
.status-reserved { background: var(--warn); }
.status-sold { background: var(--sold); }

.car-info { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.car-info h3 { font-size: 18px; font-weight: 800; margin: 0; }
.car-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.car-specs { display: flex; gap: 6px; flex-wrap: wrap; }
.car-specs span { background: var(--paper); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: #433d58; }
.car-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--paper); }
.car-price { font-size: 21px; font-weight: 800; color: var(--brand); }
.details-link { font: 700 13px 'Plus Jakarta Sans', sans-serif; color: #fff; background: var(--brand); border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: background .2s; }
.details-link:hover { background: var(--accent-d); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent-d); cursor: pointer; text-decoration: underline; }

/* How it works */
.how { background: var(--paper); padding: 72px max(calc((100% - 1180px)/2), 5%); }
.how ol { list-style: none; counter-reset: s; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how li { counter-increment: s; display: flex; flex-direction: column; gap: 6px; background: #fff; padding: 24px; border-radius: 14px; border: 1px solid var(--line); }
.how li:before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 8px; }
.how li span { color: var(--muted); font-size: 14px; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.contact-card { border: 1px solid var(--line); padding: 26px 30px; border-radius: 16px; box-shadow: 0 12px 35px #1b15280f; }
.contact-row { display: flex; gap: 15px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.contact-icon { width: 38px; height: 38px; border-radius: 10px; background: #f3e4f2; display: grid; place-items: center; color: var(--accent-d); flex-shrink: 0; }
.contact-row div { display: flex; flex-direction: column; }
.contact-row small { font-size: 12px; color: var(--muted); font-weight: 600; }
.contact-row a, .contact-row div > span { font-size: 15px; font-weight: 700; }
.contact-button { margin-top: 20px; width: 100%; }

/* Footer */
footer { background: var(--brand); color: #b9b2cc; padding: 26px max(calc((100% - 1180px)/2), 5%); display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; font-size: 12px; }
footer .brand img { height: 32px; }
.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a, footer .link-btn { color: #fff; font-weight: 600; text-decoration: none; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: #120d1fb8; z-index: 30; display: grid; place-items: center; padding: 20px; overflow: auto; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; background: #fff; border-radius: 16px; padding: 28px; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 70px #0005; }
.modal-close { position: sticky; float: right; top: 0; border: 0; background: var(--paper); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; color: #59526d; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.modal h2 { font-size: 24px; margin: 0 0 14px; }

/* Gallery & Car Details */
.gallery-main { width: 100%; height: 310px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block; background: var(--paper); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.gallery-thumbs img { width: 72px; height: 50px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .65; border: 2px solid transparent; transition: opacity .2s, border-color .2s; }
.gallery-thumbs img.active, .gallery-thumbs img:hover { opacity: 1; border-color: var(--accent); }
.car-modal .meta { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.detail-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.detail-spec { background: var(--paper); padding: 12px; border-radius: 10px; }
.detail-spec small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.detail-spec strong { font-size: 14px; }
.detail-description { font-size: 14px; line-height: 1.7; color: #464059; margin-bottom: 20px; white-space: pre-line; }

.inquiry-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 16px; }
.inquiry-box h3 { font-size: 16px; margin: 0 0 12px; }
.inquiry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.inquiry-box input, .inquiry-box textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 14px 'Plus Jakarta Sans', sans-serif; background: #fff; }
.inquiry-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Admin */
.admin-tabs { display: flex; gap: 7px; border-bottom: 1px solid var(--line); margin: 16px 0; }
.admin-tabs button { padding: 12px 15px; background: none; border: 0; border-bottom: 2px solid transparent; color: #756f88; cursor: pointer; font: 600 13px 'Plus Jakarta Sans'; }
.admin-tabs button.active { border-color: var(--accent); color: var(--brand); }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.admin-car-list { display: grid; gap: 9px; margin-top: 15px; }
.admin-car { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.admin-car strong { font-size: 14px; }
.admin-car small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.admin-actions { display: flex; gap: 6px; }
.small-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.small-btn.delete { color: #a33; border-color: #eedddd; }
.admin-tip { font-size: 12px; color: #8a849b; margin: 20px 0 10px; }
.backup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-row .button { font-size: 12px; padding: 10px 13px; }
.import-label { cursor: pointer; }
.admin-form { display: grid; gap: 13px; }
.admin-form label, .photo-field label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #59526d; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; font: 14px 'Plus Jakarta Sans'; color: var(--ink); background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.photo-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb-item { position: relative; width: 84px; height: 60px; }
.photo-thumb-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.photo-thumb-item button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--sold); color: #fff; font-size: 12px; cursor: pointer; line-height: 1; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px #0004; z-index: 50; }

/* Responsive */
@media (max-width: 1000px) {
  .search-card { grid-template-columns: 1fr 1fr; }
  .search-card .button { grid-column: 1 / -1; }
  .car-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .topbar { height: 66px; }
  .brand img { height: 36px; }
  .menu-toggle { display: block; }
  .topbar nav { display: none; }
  .topbar nav.open { display: flex; position: absolute; top: 66px; left: 0; right: 0; background: var(--brand); padding: 20px 5%; flex-direction: column; gap: 18px; border-top: 1px solid #4a3d66; }
  .hero { padding: 48px 5% 84px; }
  .trust, .how ol { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 52px 5%; }
}
@media (max-width: 560px) {
  .car-grid { grid-template-columns: 1fr; }
  .search-card { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; align-items: start; }
  .form-grid, .detail-specs, .inquiry-grid { grid-template-columns: 1fr; }
  .modal { padding: 22px 16px; }
  .gallery-main { height: 220px; }
}
/* Contact modal */
.contact-modal { width: min(560px, 100%); }
.contact-modal .muted { margin: -6px 0 16px; }
.contact-modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.contact-form-actions { flex-wrap: wrap; }
.contact-button { cursor: pointer; border: 0; font-family: inherit; }
@media (max-width: 640px) { .contact-modal .form-grid { grid-template-columns: 1fr; } }

.inq-wide { grid-column: 1 / -1; }

#callButton + #emailButton { margin-top: 10px; }
.inquiry-actions .button-accent { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
