/* M & G AUTOMOTIVE GROUP — shared styles */
:root {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --surface: #17171a;
  --surface-2: #1f1f23;
  --line: #2a2a2f;
  --text: #f4f1ea;
  --muted: #a3a09a;
  --gold: #d4a24c;
  --gold-2: #e9c27a;
  --gold-dark: #a87c2f;
  --ok: #3fb67a;
  --warn: #e0a43a;
  --bad: #d9534f;
  --tesla-red: #e31937;
  --seal-green: #1f9d55;
  --radius: 14px;
  --max: 1200px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, .serif { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; font-weight: 600; color: var(--gold); margin-bottom: 12px; display: block; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .2s ease; font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); color: #141210; }
.btn-gold:hover { color: #141210; filter: brightness(1.08); transform: translateY(-1px); }
.btn-red { background: var(--tesla-red); color: #fff; }
.btn-red:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn-line { border-color: var(--gold); color: var(--gold-2); background: transparent; }
.btn-line:hover { background: var(--gold); color: #141210; }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--gold); color: var(--text); }
.btn-danger { border-color: #5a2a29; color: #f2b8b6; background: #2a1514; }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.center .btn-row { justify-content: center; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11,11,12,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--gold); display: grid; place-items: center; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--gold); font-size: .82rem; letter-spacing: -.03em; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; letter-spacing: .04em; }
.brand-text span { font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 420px) { .brand-text strong { font-size: .92rem; } .brand-mark { width: 38px; height: 38px; } }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: #d6d2ca; padding: 8px 14px; border-radius: 8px; font-size: .92rem; font-weight: 500; }
.nav a:hover { color: #fff; background: var(--surface); }
.nav a.active { color: var(--gold-2); }
.nav .btn { margin-left: 8px; padding: 10px 18px; }
.nav a.btn-gold, .nav a.btn-gold:hover { color: #141210; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; font-size: 1.2rem; }
@media (max-width: 960px) {
  .menu-btn { display: grid; place-items: center; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; }
  .nav .btn { margin: 8px 0 0; }
}

/* Hero */
.hero { position: relative; min-height: 84vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,11,12,.96) 0%, rgba(11,11,12,.82) 45%, rgba(11,11,12,.35) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 30%); }
.hero .wrap { position: relative; z-index: 2; padding-top: 60px; padding-bottom: 60px; }
.hero h1 { max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { margin-bottom: 32px; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--gold-2); }
.hero-stats div span { font-size: .85rem; color: var(--muted); }

.page-head { padding: 72px 0 40px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at top, rgba(212,162,76,.10), transparent 60%); }

/* Tesla lettering and the factory-trained badge */
.tesla-word { color: var(--tesla-red); letter-spacing: .04em; }
.seal { display: inline-flex; align-items: center; gap: 10px; background: var(--seal-green); color: #fff; border: 3px solid var(--tesla-red); border-radius: 999px; padding: 6px 16px 6px 7px; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-family: 'Inter', sans-serif; }
.seal-icon { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; border: 2px solid var(--tesla-red); flex-shrink: 0; }
.seal-icon svg { width: 15px; height: 15px; color: var(--seal-green); }

/* Cards & grids */
.grid { display: grid; gap: 24px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h3 { margin-bottom: .4em; }
.icon-chip { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: rgba(212,162,76,.12); color: var(--gold); margin-bottom: 18px; }
.icon-chip svg { width: 24px; height: 24px; }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.split > * { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--surface); max-width: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.checks { list-style: none; padding: 0; margin: 0 0 28px; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 12px; color: #dcd8d0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 9px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
.steps { counter-reset: s; display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 48px 1fr; gap: 18px; }
.step::before { counter-increment: s; content: counter(s); width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem; }
.step h3 { font-size: 1.15rem; margin-bottom: .3em; font-family: 'Inter', sans-serif; font-weight: 600; }
.step p { color: var(--muted); margin: 0; }

.cta-band { background: linear-gradient(135deg, #1d170c, #120f09); border-top: 1px solid #3a2e17; border-bottom: 1px solid #3a2e17; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 56px; padding-bottom: 56px; }
.cta-band h2 { margin: 0 0 .25em; }
.cta-band p { margin: 0; color: var(--muted); }

/* Vehicle cards */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: border-color .2s, transform .2s; text-align: left; color: inherit; font: inherit; padding: 0; }
.vcard:hover { border-color: var(--gold-dark); transform: translateY(-3px); }
.vcard-img { position: relative; aspect-ratio: 4/3; background: var(--surface-2); }
.vcard-img img { width: 100%; height: 100%; object-fit: cover; }
.vcard-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vcard-title { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 600; }
.vcard-meta { color: var(--muted); font-size: .88rem; }
.vcard-price { font-size: 1.4rem; font-weight: 700; color: var(--gold-2); margin-top: auto; padding-top: 10px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.vcard-img .badge { position: absolute; top: 12px; left: 12px; }
.badge-in-stock { background: rgba(63,182,122,.18); color: #7fe0ad; border: 1px solid rgba(63,182,122,.4); }
.badge-pending { background: rgba(224,164,58,.18); color: #f3c878; border: 1px solid rgba(224,164,58,.45); }
.badge-sold { background: rgba(217,83,79,.18); color: #f19a97; border: 1px solid rgba(217,83,79,.45); }
.badge-new { background: rgba(212,162,76,.15); color: var(--gold-2); border: 1px solid rgba(212,162,76,.4); }
.no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: #55534f; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; background: repeating-linear-gradient(135deg, #1a1a1d 0 12px, #1d1d20 12px 24px); }

/* Filters */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 12px; margin: 32px 0 28px; }
.filters > * { min-width: 0; }
@media (max-width: 960px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }
.result-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: .92rem; gap: 12px; flex-wrap: wrap; }

/* Forms */
label { display: block; font-size: .85rem; font-weight: 500; color: #cfcbc3; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; font-size: .95rem; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,162,76,.15); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a3a09a' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 120px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid > * { min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-section-title { grid-column: 1 / -1; font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--gold-2); margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.form-section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.check-row input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--gold); }
.notice { padding: 14px 16px; border-radius: 10px; font-size: .92rem; margin-top: 16px; }
.notice.ok { background: rgba(63,182,122,.12); border: 1px solid rgba(63,182,122,.35); color: #a6ebc6; }
.notice.err { background: rgba(217,83,79,.12); border: 1px solid rgba(217,83,79,.4); color: #f5b5b3; }
.notice.info { background: rgba(212,162,76,.10); border: 1px solid rgba(212,162,76,.35); color: #ecd3a3; }
.hidden { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Info list */
.info-list { display: grid; gap: 20px; }
.info-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.info-item .icon-chip { width: 44px; height: 44px; margin: 0; }
.info-item h4 { margin: 0 0 2px; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.info-item p, .info-item a { margin: 0; font-size: 1.02rem; }
.hours { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hours td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; color: var(--text); }
.hours td:first-child { color: var(--muted); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); height: 380px; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.4) invert(.9) hue-rotate(180deg) contrast(.9); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(4px); }
.modal-panel { position: relative; max-width: 1100px; margin: 4vh auto; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; }
@media (max-width: 640px) { .modal-panel { margin: 0; max-height: 100vh; height: 100vh; border-radius: 0; } }
.modal-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; padding: 28px; clear: both; }
.detail > * { min-width: 0; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; padding: 20px; } }
.gallery-main { aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--surface); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.2rem; cursor: pointer; }
.gallery-nav.prev { left: 10px; } .gallery-nav.next { right: 10px; }
.gallery-count { position: absolute; bottom: 10px; right: 12px; background: rgba(0,0,0,.65); padding: 3px 10px; border-radius: 999px; font-size: .8rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; cursor: pointer; background: none; }
.thumbs button.active { border-color: var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 20px 0; }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; }
@media (max-width: 480px) { .specs { grid-template-columns: 1fr; } }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 0; list-style: none; font-size: .9rem; }
.features li::before { content: "✓ "; color: var(--gold); font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #080809; padding: 56px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-grid > * { min-width: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.site-footer a { color: #cfcbc3; display: block; padding: 3px 0; font-size: .93rem; }
.site-footer a:hover { color: var(--gold-2); }
.site-footer p { color: var(--muted); font-size: .93rem; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #77746e; font-size: .82rem; }
.footer-bottom a { display: inline; color: #77746e; }

/* Loading */
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.state { text-align: center; padding: 70px 20px; color: var(--muted); }
