/* ═══════════════════════════════════════════════════════════════════
   TorqFix Layout v4 — Standardized 2026-06-24:
     - LOGO LEFT + BURGER RIGHT in topbar (same on every page)
     - Burger opens right-side drawer (nav + theme + lang + account)
     - No permanent sidebar
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #0a0a0a;
  --bg-1: #141414;
  --bg-2: #1c1c1c;
  --bg-3: #262626;
  --bg-elev: #1f1f1f;

  --ink: #ededed;
  --ink-dim: #a3a3a3;
  --ink-faint: #6b6b6b;
  --ink-mute: #4a4a4a;

  --line: #2a2a2a;
  --line-strong: #3a3a3a;

  --acc: #f97316;
  --acc-2: #fb923c;
  --acc-glow: rgba(249,115,22,.4);
  --acc-bg: rgba(249,115,22,.1);
  --acc-hover: #fb923c;

  --user-bg: #2a2a2a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  --content-max: 760px;
  --topbar-h: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif Pro", "Iowan Old Style", Charter, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, "Cascadia Code", monospace;
}

[data-theme="light"] {
  --bg-0: #ffffff;
  --bg-1: #faf9f5;
  --bg-2: #ffffff;
  --bg-3: #f0eee6;
  --bg-elev: #ffffff;
  --ink: #1a1a1a;
  --ink-dim: #555555;
  --ink-faint: #888888;
  --ink-mute: #bbbbbb;
  --line: #e6e3da;
  --line-strong: #d4d1c7;
  --user-bg: #f0eee6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body.tf4 {
  font-family: var(--font-sans);
  background: var(--bg-1);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ═══════ TOPBAR (logo left + burger right) ═══════ */
.tf4-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  position: sticky;
  top: 0;
  z-index: 50;
}
@media (max-width: 720px) { .tf4-bar { padding: 0 12px; } }

.tf4-bar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.tf4-bar-brand img {
  height: 24px;
  width: auto;
  display: block;
}
[data-theme="dark"]  .tf4-bar-brand img,
[data-theme="dark"]  .tf4-drawer-head img { filter: invert(1) brightness(1.1); }
[data-theme="light"] .tf4-bar-brand img,
[data-theme="light"] .tf4-drawer-head img { filter: none; }

.tf4-bar-burger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s;
}
.tf4-bar-burger:hover { background: var(--bg-2); border-color: var(--acc); }
.tf4-bar-burger svg { color: var(--ink); }
.tf4-bar-burger-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ═══════ DRAWER (right-side, all nav + actions) ═══════ */
.tf4-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 100;
  opacity: 0;
  transition: opacity .2s;
}
.tf4-drawer-overlay.show { display: block; opacity: 1; }

.tf4-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 100vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 32px rgba(0,0,0,.4);
}
.tf4-drawer.open { transform: translateX(0); }

.tf4-drawer-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  min-height: 64px;
}

.tf4-drawer-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.tf4-drawer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.tf4-drawer-account-info { flex: 1; min-width: 0; }
.tf4-drawer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf4-drawer-email {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf4-drawer-guest {
  display: flex;
  gap: 8px;
  flex: 1;
}
.tf4-drawer-cta-ghost {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.tf4-drawer-cta-ghost:hover { background: var(--bg-3); color: var(--ink); }
.tf4-drawer-cta-primary {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--acc);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.tf4-drawer-cta-primary:hover { background: var(--acc-hover); color: white; }

.tf4-drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.tf4-drawer-close:hover { background: var(--bg-3); color: var(--ink); }

.tf4-drawer-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 2px;
  overflow-y: auto;
}
.tf4-drawer-nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background .12s;
}
.tf4-drawer-nav a:hover { background: var(--bg-3); color: var(--ink); }
.tf4-drawer-nav a.active { background: var(--bg-3); font-weight: 700; }

.tf4-drawer-foot {
  border-top: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tf4-drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
}
.tf4-drawer-row-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tf4-drawer-lang {
  display: flex;
  gap: 2px;
  background: var(--bg-3);
  border-radius: 8px;
  padding: 2px;
}
.tf4-drawer-lang a, .tf4-drawer-lang span {
  padding: 5px 10px;
  text-decoration: none;
  color: var(--ink-dim);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: all .12s;
}
.tf4-drawer-lang a:hover { color: var(--ink); }
.tf4-drawer-lang .active { background: var(--bg-1); color: var(--ink); }

.tf4-drawer-theme {
  background: var(--bg-3);
  border: 0;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.tf4-drawer-theme:hover { background: var(--line-strong); }
.tf4-drawer-theme .ico-moon,
.tf4-drawer-theme .ico-sun { display: none; }
[data-theme="dark"]  .tf4-drawer-theme .ico-sun  { display: inline; }
[data-theme="light"] .tf4-drawer-theme .ico-moon { display: inline; }

.tf4-drawer-signout {
  display: block;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-3);
  transition: all .12s;
}
.tf4-drawer-signout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

.tf4-drawer-upgrade {
  background: linear-gradient(135deg, var(--acc, #f97316), var(--acc-2, #fb923c));
  color: #fff !important;
  font-weight: 700 !important;
  text-align: center;
  margin-top: 6px;
  border-radius: 10px;
  padding: 12px 14px !important;
  font-size: 14px !important;
  transition: filter .12s;
}
.tf4-drawer-upgrade:hover { filter: brightness(1.1); }

/* ═══════ MAIN (page body) ═══════ */
.tf4-main-pg {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tf4-pg-head {
  padding: 32px 24px 20px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}
.tf4-pg-h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.tf4-pg-sub {
  font-size: 14.5px;
  color: var(--ink-dim);
  margin: 0;
}
.tf4-pg-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

/* ═══════ COMMON BUILDING BLOCKS (used by pages) ═══════ */
.tf4-col {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px;
}
.tf4-col-wide { max-width: 1100px; }

.tf4-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  color: var(--ink);
}
.tf4-card + .tf4-card { margin-top: 14px; }

.tf4-card-h {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tf4-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 0;
  text-decoration: none;
  transition: all .15s;
}
.tf4-btn-primary { background: var(--acc); color: white; }
.tf4-btn-primary:hover { background: var(--acc-hover); color: white; }
.tf4-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.tf4-btn-ghost:hover { background: var(--bg-3); color: var(--ink); }

.tf4-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tf4-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg); }
.tf4-input::placeholder { color: var(--ink-mute); }

.tf4-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.tf4-divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

.tf4-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-3);
  color: var(--ink-dim);
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}
.tf4-chip-accent { background: var(--acc-bg); color: var(--acc); }

/* ═══════ LEGACY CLASS COMPAT (for pages not fully v4-converted yet) ═══════ */
/* .card .btn .btn-blue — old layout.php classes used by obd/vin/promo/etc.
   These give a sane v4 look without rewriting page content. */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  color: var(--ink);
  margin-bottom: 14px;
}
.card h2, .card h3 { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 0;
  text-decoration: none;
  transition: all .15s;
  background: var(--bg-3);
  color: var(--ink);
}
.btn:hover { background: var(--line-strong); }
.btn-blue, .btn-primary {
  background: var(--acc);
  color: white;
}
.btn-blue:hover, .btn-primary:hover { background: var(--acc-hover); color: white; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--ink); }

/* Legacy var aliases — pages reference --orange, --blue, --green etc. */
:root {
  --orange: var(--acc);
  --blue: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --surface: var(--bg-2);
  --radius: var(--r-lg);
}

/* Inputs styled like v4 */
input[type="text"]:not(.tf4-input):not(.composer-input),
input[type="email"]:not(.tf4-input),
input[type="password"]:not(.tf4-input),
input[type="search"]:not(.tf4-input),
textarea:not(.tf4-input):not(.composer-input):not(.al-ctx-input) {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg); }

/* Search box (OBD page) */
.search-box {
  display: flex;
  gap: 8px;
}
.search-box input {
  flex: 1;
}
.search-box button {
  padding: 11px 22px;
  background: var(--acc);
  color: white;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.search-box button:hover { background: var(--acc-hover); }

/* Generic h1, h2 default colors */
h1, h2, h3, h4 { color: var(--ink); }
p { color: var(--ink); }
a { color: var(--acc); }
a:hover { color: var(--acc-hover); }

/* ── 2026-08-21 design-audit compat: класове, ползвани от страници, но недефинирани никъде ── */
.grid-makes{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.make-card{display:flex;flex-direction:column;align-items:center;gap:4px;background:var(--bg-2);border:1px solid var(--line);border-radius:12px;padding:16px 12px;color:var(--ink);text-decoration:none;transition:border-color .15s}
.make-card:hover{border-color:var(--acc)}
.btn-outline{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid var(--line);border-radius:10px;color:var(--ink);text-decoration:none;font-weight:600;background:transparent}
.btn-outline:hover{border-color:var(--acc);color:var(--acc)}
