/* =====================================================================
 * MotoPrime — estilos compartilhados (site público + admin)
 * Tema dark premium. Tokens de cor vêm do config.js via variáveis CSS
 * setadas em runtime (ver public.js/admin.js -> applyBrand()).
 * ===================================================================== */
:root {
  --primary: #c9a96e;
  --accent: #e8c87d;
  --bg: #0b0d17;
  --card: #12152a;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #e8eaf2;
  --muted: #8892b0;
  --good: #00b894;
  --warn: #fdcb6e;
  --bad: #ff7675;
  --grad: linear-gradient(135deg, var(--primary), var(--accent));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, .num { font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 10px; padding: 12px 22px;
  font-weight: 700; font-size: 0.92rem; color: #fff;
  background: var(--grad); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(201, 169, 110, .35); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.btn.ghost:hover { border-color: var(--primary); box-shadow: none; }
.btn.wa { background: #25d366; }
.btn.wa:hover { box-shadow: 0 10px 26px rgba(37, 211, 102, .35); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.badge.disponivel { background: rgba(0, 184, 148, .15); color: var(--good); }
.badge.reservada  { background: rgba(253, 203, 110, .15); color: var(--warn); }
.badge.vendida    { background: rgba(255, 118, 117, .15); color: var(--bad); }

/* spinner / vazio */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ===================== SITE PÚBLICO ===================== */
.pub-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.pub-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; font-family: 'Space Grotesk', sans-serif; }
.logo .dot { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #0a0a0a; flex: none; }
.logo .brand-suffix { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: .58em; letter-spacing: .14em; color: var(--accent); opacity: .85; }

.hero { position: relative; overflow: hidden; padding: 80px 0 60px; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 80% -10%, rgba(201, 169, 110, .28), transparent 60%),
              radial-gradient(50% 70% at 0% 10%, rgba(201, 169, 110, .18), transparent 60%);
  pointer-events: none;
}
.hero .eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 14px 0 18px; max-width: 18ch; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin-bottom: 28px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .stats { display: flex; gap: 36px; margin-top: 46px; flex-wrap: wrap; }
.hero .stats .num { font-size: 2rem; font-weight: 800; }
.hero .stats small { color: var(--muted); display: block; font-size: .82rem; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 10px 0 26px; }
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar .search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar input, .toolbar select {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 12px 14px; font-size: .9rem; font-family: inherit;
}
.toolbar .search input { padding-left: 40px; }
.toolbar select { width: auto; min-width: 150px; }

.section-head { display: flex; align-items: end; justify-content: space-between; margin: 40px 0 18px; }
.section-head h2 { font-size: 1.5rem; }
.section-head .count { color: var(--muted); font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.moto-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s; cursor: pointer; position: relative;
}
.moto-card:hover { transform: translateY(-4px); border-color: rgba(201, 169, 110, .5); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.moto-card .ph { position: relative; aspect-ratio: 16/10; background: #0e0e0e; overflow: hidden; }
.moto-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.moto-card .ph .fav { position: absolute; top: 10px; left: 10px; }
.moto-card .ph .st { position: absolute; top: 10px; right: 10px; }
.moto-card .body { padding: 16px; }
.moto-card .body .ttl { font-weight: 800; font-size: 1.05rem; font-family: 'Space Grotesk', sans-serif; }
.moto-card .body .sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.moto-card .specs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.moto-card .specs span { font-size: .74rem; color: var(--muted); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }
.moto-card .price { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.moto-card .price .v { font-size: 1.45rem; font-weight: 800; }
.moto-card .price small { color: var(--muted); font-size: .72rem; }

.pub-footer { border-top: 1px solid var(--line); margin-top: 70px; padding: 40px 0; color: var(--muted); }
.pub-footer .container { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; align-items: center; }

.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 10px 30px rgba(37, 211, 102, .45);
}

/* modal de detalhe (público) */
.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, .7); backdrop-filter: blur(4px); }
.modal .sheet {
  position: absolute; inset: 0; margin: auto; max-width: 880px; width: calc(100% - 24px); height: max-content;
  max-height: calc(100% - 48px); top: 24px; bottom: 24px; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.modal .sheet .x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); color: #fff; font-size: 1.1rem; }
.modal .gallery { aspect-ratio: 16/9; background: #0e0e0e; position: relative; }
.modal .gallery img { width: 100%; height: 100%; object-fit: cover; }
.modal .gallery .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); color: #fff; }
.modal .gallery .nav.prev { left: 12px; } .modal .gallery .nav.next { right: 12px; }
.modal .mbody { padding: 24px; }
.modal .mbody h2 { font-size: 1.8rem; }
.modal .mspecs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.modal .mspecs .it { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.modal .mspecs .it small { color: var(--muted); display: block; font-size: .72rem; }
.modal .mspecs .it b { font-size: 1.02rem; }
.modal .mprice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: rgba(201, 169, 110, .08); border: 1px solid rgba(201, 169, 110, .25); border-radius: 14px; padding: 18px 22px; margin-top: 8px; }
.modal .mprice .v { font-size: 2rem; font-weight: 800; }

@media (max-width: 640px) {
  .hero { padding: 50px 0 36px; }
  .hero .stats { gap: 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .moto-card .body { padding: 12px; }
  .moto-card .body .ttl { font-size: .92rem; }
  .moto-card .price .v { font-size: 1.1rem; }
  .moto-card .specs { display: none; }
}
