/* ==========================================================================
   Powersports Marketplace — application stylesheet
   Single file, no build step: shared hosting deploys by FTP.
   ========================================================================== */

:root {
    --ink: #14181f;
    --ink-2: #3d4757;
    --muted: #6b7688;
    --line: #e2e6ec;
    --line-2: #f0f3f7;
    --bg: #f6f8fa;
    --panel: #ffffff;
    --brand: #d64000;
    --brand-dark: #ad3300;
    --brand-soft: #fff1ea;
    --accent: #0f5c8c;
    --ok: #1a7f4b;
    --ok-soft: #e8f6ee;
    --warn: #a86800;
    --warn-soft: #fdf4e3;
    --danger: #b3261e;
    --danger-soft: #fdeceb;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small, .small { font-size: .85rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.75rem; }

/* ------------------------------------------------------------------ header */
.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--brand); }
.site-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.site-nav a { color: var(--ink-2); font-weight: 550; font-size: .95rem; }
.site-nav a.active { color: var(--brand); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 860px) {
    .site-header .wrap { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
    .nav-toggle { display: block; margin-left: auto; }
    .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav.open { display: flex; }
    .site-nav a, .site-nav form { padding: 10px 2px; border-top: 1px solid var(--line-2); }
    .site-nav .btn { text-align: center; }
}

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 48px; padding: 32px 0; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.site-footer a { color: var(--ink-2); }

/* ----------------------------------------------------------------- buttons */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; padding-left: 4px; padding-right: 4px; }
.btn-ghost:hover { background: transparent; color: var(--accent); text-decoration: underline; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1e17; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #146239; }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush .panel-header { padding: 18px 22px 0; }

/* ------------------------------------------------------------------ alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-size: .95rem; }
.alert-success { background: var(--ok-soft); border-color: #b6e2c8; color: #10321f; }
.alert-error { background: var(--danger-soft); border-color: #f3c4c1; color: #61120d; }
.alert-info { background: #eaf2f8; border-color: #c3dcec; color: #123449; }
.alert-warn { background: var(--warn-soft); border-color: #edd9ac; color: #4c3000; }

/* ------------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=tel], input[type=url], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 92, 140, .35); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 130px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-error { font-size: .85rem; color: var(--danger); margin-top: 4px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.check input { margin-top: 4px; width: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 650; font-size: 1rem; padding: 0; margin-bottom: 10px; }
.inline-form { display: inline; }

/* ------------------------------------------------------------------ tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data th { background: #fafbfd; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fcfdfe; }

/* ------------------------------------------------------------------- badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: .76rem; font-weight: 700; letter-spacing: .02em; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: #12603a; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: #eaf2f8; color: var(--accent); }
.badge-featured { background: linear-gradient(100deg, #ffb020, #ff7a00); color: #331700; }
.badge-dealer { background: #ecebff; color: #3a2fa8; }
.badge-private { background: #e9f4ee; color: #1d6b45; }

/* ---------------------------------------------------------------- listings */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.listing-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.listing-card .thumb { position: relative; aspect-ratio: 4 / 3; background: var(--line-2); overflow: hidden; }
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .thumb .flags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.listing-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card .title { font-weight: 650; font-size: 1rem; color: var(--ink); line-height: 1.3; }
.listing-card .title:hover { color: var(--brand); text-decoration: none; }
.listing-card .price { font-size: 1.2rem; font-weight: 750; color: var(--ink); }
.listing-card .meta { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.listing-card .seller { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 34px 0 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--muted); font-size: .92rem; }

/* -------------------------------------------------------- browse & filters */
.browse-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .browse-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 84px; }
.filters .field { margin-bottom: 13px; }
.filters h3 { font-size: .95rem; margin-bottom: 12px; }
.filter-group { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 14px; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--ink-2); font-weight: 600; font-size: .93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; background: var(--line-2); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; background: var(--panel); border: 1px solid var(--line); font-size: .83rem; color: var(--ink-2); }
.chip a { color: var(--muted); font-weight: 700; }

/* ------------------------------------------------------------ listing page */
.listing-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .listing-layout { grid-template-columns: 1fr; } }
.gallery-main { background: #10131a; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: none; aspect-ratio: 4 / 3; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.spec { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fbfcfe; }
.spec dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.spec dd { margin: 2px 0 0; font-weight: 600; }
.price-tag { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.seller-box { position: sticky; top: 84px; }
.description { white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------- dashboards */
.dash-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 860px) { .dash-layout { grid-template-columns: 1fr; } }
.side-nav { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.side-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 550; font-size: .93rem; }
.side-nav a:hover { background: var(--line-2); text-decoration: none; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.side-nav .divider { border-top: 1px solid var(--line-2); margin: 8px 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: .84rem; color: var(--muted); }
.stat.attention { border-color: #f0c9a8; background: #fff8f2; }

/* ----------------------------------------------------------------- hero */
.hero { background: linear-gradient(160deg, #171d27 0%, #2b3646 55%, #3a2a20 100%); color: #fff; padding: 56px 0 64px; }
.hero h1 { font-size: 2.5rem; margin-bottom: 10px; color: #fff; }
.hero p.lede { font-size: 1.1rem; color: #cfd6e2; max-width: 620px; }
.search-bar { display: flex; gap: 10px; background: #fff; padding: 10px; border-radius: var(--radius); margin-top: 24px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.search-bar input, .search-bar select { border: 0; flex: 1 1 180px; min-width: 0; }
.search-bar input:focus, .search-bar select:focus { outline-offset: -2px; }
.search-bar .btn { flex: 0 0 auto; }
.category-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 26px; }
.category-strip a { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; font-size: .95rem; }
.category-strip a:hover { background: rgba(255, 255, 255, .18); text-decoration: none; }
.category-strip .count { display: block; font-size: .8rem; color: #b9c2d0; font-weight: 500; }

/* ------------------------------------------------------------------ misc */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 28px 0 8px; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { border: 0; background: none; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { color: var(--ink-2); }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.tier-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tier-card.highlight { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.tier-card .price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.tier-card ul { list-style: none; padding: 0; margin: 16px 0; }
.tier-card li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid var(--line-2); font-size: .93rem; }
.tier-card li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.tier-card .btn { margin-top: auto; }

.image-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.image-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.image-tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.image-tile .tools { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; gap: 6px; font-size: .82rem; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: #fbfcfe; }
.dropzone.dragging { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.flag-note { background: var(--warn-soft); border: 1px solid #edd9ac; border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; color: #4c3000; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .review-grid { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.timeline li { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.timeline li.is-approved::before { background: var(--ok); }
.timeline li.is-denied::before { background: var(--danger); }
.timeline li.is-flagged::before { background: var(--warn); }

.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; background: var(--line-2); padding: 2px 6px; border-radius: 4px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.8em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: .4em; }

@media print {
    .site-header, .site-footer, .btn, .filters { display: none; }
    body { background: #fff; }
}
