/* ============================================================================
   LOKAWHEELS — public site
   A dark, high-contrast garage look. Every effect here is CSS: no images, no
   JavaScript, nothing that delays the first paint. The pages stay fully
   server-rendered, because WhatsApp's scraper never runs a line of script.
   ============================================================================ */

@font-face {
    font-family: "Chakra Petch";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/chakrapetch-600.woff2") format("woff2");
}

@font-face {
    font-family: "Chakra Petch";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/chakrapetch-700.woff2") format("woff2");
}

:root {
    color-scheme: dark;

    --bg: #07080c;
    --bg-2: #0c0e14;
    --surface: #12151d;
    --surface-2: #171b25;
    --line: #232936;
    --line-bright: #313949;

    --text: #f2f5fa;
    --muted: #8d97ab;
    --dim: #6b7488;

    /* Cyan is the interface. Green belongs to WhatsApp alone, so the one action
       that matters never competes with decoration. */
    --accent: #22e0ff;
    --accent-dim: #0d94b0;
    --accent-glow: rgba(34, 224, 255, 0.35);
    --whatsapp: #25d366;
    --danger: #ff4d5e;
    --gold: #ffc247;

    --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
    --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --wrap: 1100px;
    --bar-h: 68px;
    --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
    margin: 0;
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    /* Two soft pools of light so the near-black never looks like a dead screen. */
    background-image:
        radial-gradient(1100px 620px at 12% -8%, rgba(34, 224, 255, 0.11), transparent 60%),
        radial-gradient(900px 520px at 92% 4%, rgba(124, 77, 255, 0.10), transparent 62%);
    background-attachment: fixed;
    overflow-x: clip;
}

h1, h2, h3, .display {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin: 0 0 0.5rem;
}

h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h2 {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
h1:focus { outline: none; }
p { margin: 0 0 0.85rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.1rem; }
.wrap.narrow { max-width: 520px; padding-top: 2.5rem; padding-bottom: 4rem; }

/* ---------------------------------------------------------------- header --- */
.site-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    max-width: var(--wrap); margin: 0 auto; padding: 1.1rem;
}

.wordmark {
    font-family: var(--display);
    font-weight: 700; font-size: clamp(0.9rem, 3.2vw, 1.05rem); letter-spacing: 0.16em;
    text-decoration: none; color: var(--text); white-space: nowrap;
    text-shadow: 0 0 22px var(--accent-glow);
}
.wordmark span { color: var(--accent); }

.site-header nav { display: flex; align-items: center; gap: clamp(0.7rem, 3vw, 1.4rem); }
.site-header nav a {
    text-decoration: none; color: var(--muted);
    font-family: var(--display); font-weight: 600; font-size: clamp(0.7rem, 2.6vw, 0.82rem);
    text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}
.site-header nav a:hover { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 4rem;
    padding: 2rem 1.1rem calc(2rem + var(--bar-h));
    color: var(--dim); font-size: 0.82rem; text-align: center;
}

/* --------------------------------------------------------------- buttons --- */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 50px; padding: 0.75rem 1.5rem;
    font-family: var(--display); font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text); text-decoration: none; cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--line-bright);
    /* The clipped corner is what makes a plain rectangle read as a game panel. */
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 26px -6px var(--accent-glow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%); color: #04212a; border-color: transparent; }
.btn-primary:hover { box-shadow: 0 0 34px -4px var(--accent-glow); }

.btn-whatsapp { background: linear-gradient(135deg, #2ce972 0%, #17a94f 100%); color: #052b13; border-color: transparent; }
.btn-whatsapp:hover { box-shadow: 0 0 34px -4px rgba(37, 211, 102, 0.5); }

.btn-block { width: 100%; }

/* ------------------------------------------------------------------ home --- */
.hero { padding: 2.5rem 0 1.5rem; position: relative; }
.hero::before {
    /* A speed streak, drawn rather than downloaded. */
    content: ""; position: absolute; inset: 0 -50vw;
    background: repeating-linear-gradient(115deg, transparent 0 42px, rgba(34, 224, 255, 0.05) 42px 43px);
    mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
    pointer-events: none;
}
.hero h1 {
    font-size: clamp(2rem, 7vw, 3.4rem);
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(34, 224, 255, 0.22);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 34rem; }

/* --------------------------------------------------------------- filters --- */
.search-form { margin: 1.5rem 0 2rem; }
.search { display: flex; gap: 0.6rem; margin-bottom: 0.7rem; }
.search input[type=search] {
    flex: 1; min-width: 0; font: inherit; font-size: 16px;
    padding: 0.85rem 1rem; min-height: 50px;
    color: var(--text); background: var(--surface);
    border: 1px solid var(--line-bright); border-radius: 0;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search input[type=search]::placeholder { color: var(--dim); }
.search input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 22px -6px var(--accent-glow); }
.search button {
    min-height: 50px; padding: 0 1.6rem; cursor: pointer;
    font-family: var(--display); font-weight: 700; font-size: 0.88rem;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: #04212a; background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    border: 0;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.filter-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }
.filter-row select, .filter-row input {
    width: 100%; font: inherit; font-size: 16px; min-height: 46px;
    padding: 0.6rem 0.7rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--line); border-radius: 8px;
}
.filter-row select:focus, .filter-row input:focus { outline: none; border-color: var(--accent); }

.filters { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 1.6rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters a {
    flex: 0 0 auto; text-decoration: none; white-space: nowrap;
    font-family: var(--display); font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.09em;
    padding: 0.45rem 0.95rem; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.filters a:hover { color: var(--text); border-color: var(--line-bright); }
.filters a.on { color: #04212a; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 20px -6px var(--accent-glow); }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1.2rem; }
.results-head h1 { font-size: 1.3rem; margin: 0; text-transform: uppercase; }
.empty { color: var(--muted); padding: 3rem 0; text-align: center; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 2.5rem 0; font-family: var(--display); font-weight: 600; }
.pager a { color: var(--accent); text-decoration: none; }

/* ----------------------------------------------------------------- cards --- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 0.9rem; }

.card {
    display: block; text-decoration: none; position: relative;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 14px 40px -18px #000, 0 0 30px -12px var(--accent-glow);
}
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); background-size: cover; background-position: center; }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-media::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(7, 8, 12, 0.92) 0%, rgba(7, 8, 12, 0.15) 42%, transparent 70%);
}
.card-body { padding: 0.75rem 0.85rem 0.9rem; position: relative; margin-top: -2.6rem; }
.card-price {
    font-family: var(--display); font-weight: 700; font-size: clamp(1rem, 3.4vw, 1.2rem);
    white-space: nowrap; color: var(--text); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}
.card-title { font-size: 0.92rem; line-height: 1.35; color: var(--text); margin-top: 0.15rem; }
.card-meta { color: var(--muted); font-size: 0.78rem; display: flex; flex-wrap: wrap; gap: 0 0.45rem; margin-top: 0.3rem; }
.card-meta span + span::before { content: "·"; margin-right: 0.45rem; color: var(--dim); }

.flag {
    position: absolute; left: 0.6rem; top: 0.6rem; z-index: 1;
    font-family: var(--display); font-weight: 700; font-size: 0.66rem;
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.22rem 0.6rem; color: #04212a; background: var(--gold);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.flag-sold { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------- car page --- */
.car { padding-bottom: calc(var(--bar-h) + 1.5rem); }

/* Mobile keeps the photo edge to edge; desktop puts it beside the details. */
.car-layout { display: grid; gap: 1.6rem; padding-top: 0.5rem; }
.car-visual { min-width: 0; }
.car-info { min-width: 0; }

.gallery { position: relative; margin: 0 -1.1rem; background: #000; }
.strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.slide {
    flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always;
    aspect-ratio: 4 / 3; max-height: 68vh; background-color: #000;
    background-size: cover; background-position: center;
}
.slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--dim); }

.counter {
    position: absolute; right: 0.9rem; bottom: 0.9rem; pointer-events: none;
    font-family: var(--display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em;
    background: rgba(7, 8, 12, 0.78); color: var(--text);
    border: 1px solid var(--line-bright); padding: 0.2rem 0.65rem; border-radius: 999px;
}
.gallery:has(.thumbs) .counter { bottom: calc(66px + 0.9rem); }

.gallery-flag {
    position: absolute; left: 0.9rem; top: 0.9rem; pointer-events: none;
    font-family: var(--display); font-weight: 700; font-size: 0.82rem;
    letter-spacing: 0.16em; padding: 0.3rem 0.8rem;
    background: var(--gold); color: #04212a;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.gallery-flag-sold { background: var(--danger); color: #fff; }

.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px; background: var(--bg-2); scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button {
    flex: 0 0 auto; width: 76px; height: 56px; padding: 0; cursor: pointer;
    background: var(--surface); border: 2px solid transparent; border-radius: 8px;
    overflow: hidden; opacity: 0.5; transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.thumbs button.on { opacity: 1; border-color: var(--accent); box-shadow: 0 0 18px -5px var(--accent-glow); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.headline { padding: 1.6rem 0 0.6rem; }
.headline h1 { text-transform: uppercase; }
.price {
    white-space: nowrap;
    font-family: var(--display); font-weight: 700;
    font-size: clamp(2rem, 8vw, 3rem); line-height: 1;
    margin: 0.4rem 0 0.5rem;
    color: var(--accent);
    text-shadow: 0 0 38px var(--accent-glow);
}
.meta { color: var(--muted); font-size: 0.92rem; margin: 0; }

.notice {
    background: var(--surface); border: 1px solid var(--line-bright);
    border-left: 3px solid var(--accent);
    border-radius: 10px; padding: 0.85rem 1.1rem; margin: 1.2rem 0;
}

/* Trust markers: a tight instrument panel, not badges */
.specs { margin: 1.8rem 0 2rem; }
.specs dl {
    margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.specs dl > div { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.85rem 1rem; background: var(--surface); }
.specs dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.specs dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--text); }

.description p { white-space: pre-line; color: var(--muted); }

.seller { margin: 2rem 0; }
.seller-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.seller-name a { text-decoration: none; }
.seller-name a:hover { color: var(--accent); }
.tag {
    display: inline-block; vertical-align: middle; margin-left: 0.5rem;
    font-family: var(--display); font-weight: 700; font-size: 0.64rem;
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.15rem 0.5rem; color: var(--accent);
    background: rgba(34, 224, 255, 0.1); border: 1px solid rgba(34, 224, 255, 0.35); border-radius: 4px;
}
.contact { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }
.contact .btn { flex: 1 1 auto; }

.more { margin-top: 3rem; }

.sticky-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom));
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: rgba(7, 8, 12, 0.9);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-bright);
}
.sticky-price { font-family: var(--display); font-weight: 700; font-size: 1.25rem; white-space: nowrap; color: var(--accent); }
.sticky-bar .btn { min-height: 46px; padding: 0.6rem 1rem; font-size: 0.78rem; letter-spacing: 0.07em; }

/* ------------------------------------------------------------ my garage --- */
.my-cars { display: grid; gap: 0.9rem; }
.my-car {
    display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: center;
    padding: 0.7rem; text-decoration: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.my-car:hover { border-color: var(--accent); transform: translateX(3px); box-shadow: 0 0 30px -14px var(--accent-glow); }
.my-car-media { width: 110px; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--bg-2); }
.my-car-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-car-title { font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.my-car-price { font-family: var(--display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; color: var(--accent); }
.my-car-meta { font-size: 0.8rem; color: var(--muted); }
.my-car-hero { width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 1.5rem; border: 1px solid var(--line); }

.card-plain { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 2rem; }
.signout { margin-top: 3.5rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 0.9rem; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.05; color: var(--accent); }
.stat span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }

/* ----------------------------------------------------------------- forms --- */
.field { margin-bottom: 1.1rem; }
.field label {
    display: block; margin-bottom: 0.4rem;
    font-family: var(--display); font-weight: 600; font-size: 0.76rem;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.field .hint { text-transform: none; letter-spacing: 0; color: var(--dim); font-weight: 400; }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; font-size: 16px; min-height: 50px;
    padding: 0.75rem 0.9rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--line-bright); border-radius: 9px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 22px -8px var(--accent-glow);
}
.field .validation-message { display: block; margin-top: 0.35rem; font-size: 0.84rem; color: var(--danger); }
.check { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0 1.2rem; color: var(--muted); }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

.code-input {
    font-family: var(--display) !important;
    font-size: 1.5rem !important; font-weight: 700;
    letter-spacing: 0.22em; text-align: center; text-transform: uppercase;
    color: var(--accent) !important;
}

.notice-error { background: rgba(255, 77, 94, 0.08); border: 1px solid rgba(255, 77, 94, 0.4); border-left-width: 3px; border-left-color: var(--danger); color: #ffc4ca; }
.notice-ok { background: rgba(37, 211, 102, 0.08); border: 1px solid rgba(37, 211, 102, 0.35); border-left-width: 3px; border-left-color: var(--whatsapp); color: #b6f5cf; }

.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ------------------------------------------------------------ responsive --- */
@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    .specs dl { grid-template-columns: repeat(3, 1fr); }
    .my-cars { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .car-layout { grid-template-columns: minmax(0, 1.4fr) minmax(330px, 1fr); gap: 2.2rem; align-items: start; }
    /* The price and the action follow you down the page instead of scrolling away. */
    .car-info { position: sticky; top: 1.5rem; }
    .gallery { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
    .headline { padding-top: 0; }
    .sticky-bar { display: none; }
    .car { padding-bottom: 2rem; }
    .site-footer { padding-bottom: 2rem; }
    .contact .btn { flex: 0 1 auto; }
    .my-cars { grid-template-columns: repeat(3, 1fr); }
}

/* Respect a request for less motion: the glow stays, the movement goes. */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .card:hover, .my-car:hover { transform: none; }
}
