:root {
  --bg: #0c0d0f;
  --bg-2: #131518;
  --card: #17191d;
  --card-2: #1d2025;
  --line: #262a30;
  --text: #f2f3f5;
  --muted: #8c929c;
  --accent: #ff5a1f;
  --accent-2: #ff8a3d;
  --green: #3ecf8e;
  --radius: 16px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }

/* Topbar */
.topbar { background: var(--accent); color: #140700; font-size: 13px; font-weight: 600; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 7px; padding-bottom: 7px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 13, 15, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__in { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo__mark { width: 34px; height: 34px; color: var(--accent); display: grid; place-items: center; }
.logo__mark svg { width: 100%; height: 100%; }
.logo__text { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 0.06em; }

.search {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px; height: 44px; max-width: 520px;
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
.search input::placeholder { color: #5d636d; }

.nav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--text); }

.cart-btn {
  position: relative; width: 46px; height: 46px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; transition: border-color .2s;
}
.cart-btn:hover { border-color: var(--accent); }
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-btn__count {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--accent); color: #140700;
  font-size: 12px; font-weight: 800; display: grid; place-items: center;
  transform: scale(0); transition: transform .25s cubic-bezier(.3,1.6,.6,1);
}
.cart-btn__count.is-on { transform: scale(1); }
.cart-btn.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.15); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 26px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; transition: transform .15s, background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #140700; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.btn--block { width: 100%; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(800px 400px at 85% 30%, rgba(255, 90, 31, .18), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
}
.hero__in { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-top: 80px; padding-bottom: 90px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(255, 90, 31, .35); border-radius: 999px; padding: 6px 14px;
}
.hero h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.05; margin: 0 0 18px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0 0 32px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__stats { list-style: none; padding: 0; margin: 48px 0 0; display: flex; gap: 40px; flex-wrap: wrap; }
.hero__stats b { display: block; font-family: var(--display); font-size: 24px; }
.hero__stats span { color: var(--muted); font-size: 14px; }

.hero__art { display: grid; place-items: center; }
.gauge { position: relative; width: min(380px, 100%); aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; }
.gauge__track { fill: none; stroke: var(--line); stroke-width: 14; stroke-dasharray: 377 503; transform: rotate(135deg); transform-origin: center; stroke-linecap: round; }
.gauge__fill { fill: none; stroke-width: 14; stroke-linecap: round; stroke-dasharray: 0 503; transform: rotate(135deg); transform-origin: center; animation: fill 2.2s .3s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes fill { to { stroke-dasharray: 320 503; } }
.gauge__ticks line { stroke: #3a3f47; stroke-width: 2; }
.gauge__needle { stroke: var(--text); stroke-width: 4; stroke-linecap: round; transform-origin: 100px 100px; transform: rotate(-135deg); animation: needle 2.2s .3s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes needle { to { transform: rotate(94deg); } }
.gauge__label { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; }
.gauge__label b { display: block; font-family: var(--display); font-size: 34px; }
.gauge__label span { color: var(--muted); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }

/* Sections */
.section { padding: 80px 0 0; }
.section:last-of-type { padding-bottom: 80px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(26px, 3vw, 36px); }
.section__head p { color: var(--muted); margin: 0; }

/* Categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.cat {
  position: relative; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; min-height: 150px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s, border-color .2s, background .2s;
}
.cat:hover { transform: translateY(-3px); border-color: rgba(255, 90, 31, .5); background: var(--card-2); }
.cat.is-active { border-color: var(--accent); background: linear-gradient(160deg, rgba(255,90,31,.14), var(--card) 60%); }
.cat svg { width: 44px; height: 44px; color: var(--accent); }
.cat__name { font-weight: 700; font-size: 16px; }
.cat__count { color: var(--muted); font-size: 13px; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: 14px; font-weight: 600; color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #444a53; }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.toolbar__right { display: flex; gap: 8px; flex-wrap: wrap; }
select {
  height: 40px; padding: 0 36px 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238c929c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; font-size: 14px; font-weight: 600; cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent); }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: transform .2s, border-color .2s;
  animation: rise .35s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card:hover { transform: translateY(-3px); border-color: #3a3f47; }
.ph {
  position: relative; aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 70% 30%, rgba(255,90,31,.12), transparent 55%),
    repeating-linear-gradient(135deg, #1a1d21 0 12px, #181a1e 12px 24px);
  display: grid; place-items: center; color: #4a505a;
}
.ph svg { width: 34%; height: auto; color: #565d68; }
.ph__note { position: absolute; bottom: 10px; right: 12px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #535963; }
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: #2a2e35; color: var(--text); }
.badge--new { background: var(--green); color: #04150c; }
.badge--contract { background: #3b82f6; color: #fff; }
.badge--rebuilt { background: #a855f7; color: #fff; }
.badge--sale { background: var(--accent); color: #140700; }

.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { font-size: 13px; color: var(--muted); font-weight: 600; }
.card__title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.card__meta { font-size: 13px; color: var(--muted); }
.card__foot { margin-top: auto; padding-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.price { font-family: var(--display); font-size: 20px; font-weight: 700; white-space: nowrap; }
.price s { display: block; font-family: var(--font); font-size: 13px; color: var(--muted); font-weight: 500; }
.add {
  width: 44px; height: 44px; border-radius: 12px; border: 0; flex: none;
  background: var(--accent); color: #140700; font-size: 22px; font-weight: 800;
  display: grid; place-items: center; transition: background .2s, transform .15s;
}
.add:hover { background: var(--accent-2); }
.add.is-in { background: var(--green); }
.add--ask { background: var(--card-2); color: var(--text); border: 1px solid var(--line); font-size: 18px; }
.add--ask:hover { background: var(--accent); color: #140700; border-color: var(--accent); }
.price--req { font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--accent); white-space: normal; line-height: 1.2; min-width: 0; }
.pm__price .price--req { font-size: 22px; }

.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { font-size: 18px; }
.empty span { color: var(--muted); max-width: 420px; }

/* Perks */
.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.perk { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.perk__n { font-family: var(--display); color: var(--accent); font-size: 14px; }
.perk h3 { font-size: 18px; margin: 14px 0 8px; }
.perk p { color: var(--muted); margin: 0; font-size: 15px; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px 0 28px; }
.footer__in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer h4 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.footer__in > div { display: flex; flex-direction: column; gap: 8px; }
.footer__in a:hover { color: var(--accent); }
.footer__bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); animation: fade .2s; }
.modal__box {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal__box--wide { max-width: 920px; padding: 0; }
.modal__box h3 { font-size: 22px; margin-bottom: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } }
.modal__x {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); font-size: 22px; line-height: 1;
}
.modal__x:hover { border-color: var(--text); }

.pm { display: grid; grid-template-columns: 1fr 1fr; }
.pm .ph { aspect-ratio: auto; min-height: 100%; border-radius: 20px 0 0 20px; }
.pm__info { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.pm__info h3 { font-size: 24px; line-height: 1.2; margin: 0; padding-right: 40px; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; margin: 4px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.pm__desc { color: var(--muted); font-size: 15px; margin: 0; }
.pm__price { display: flex; align-items: baseline; gap: 12px; }
.pm__price .price { font-size: 30px; }
.pm__price s { color: var(--muted); }
.stock { font-size: 13px; color: var(--green); font-weight: 700; }
.pm__actions { display: flex; gap: 10px; margin-top: 6px; }
.pm__actions .btn { flex: 1; }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input, .form textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  color: var(--text); font-size: 15px; outline: none; resize: vertical;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px 0 0; }
.success__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #04150c; display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.success .btn { margin-top: 12px; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { position: relative; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 20px; }
.drawer__list { flex: 1; overflow: auto; padding: 12px 24px; }
.drawer__foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; }
.drawer__total b { font-family: var(--display); font-size: 24px; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ci .ph { aspect-ratio: 1; border-radius: 10px; }
.ci .ph svg { width: 60%; }
.ci__title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.ci__sub { font-size: 12px; color: var(--muted); }
.ci__price { font-weight: 700; margin-top: 4px; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.qty button:hover { border-color: var(--text); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); font-weight: 700; padding: 12px 20px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

body.no-scroll { overflow: hidden; }

/* Responsive */
@media (max-width: 980px) {
  .nav { display: none; }
  .hero__in { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; }
  .hero__art { display: none; }
  .pm { grid-template-columns: 1fr; }
  .pm .ph { aspect-ratio: 16/10; border-radius: 20px 20px 0 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar__info { display: none; }
  .topbar__in { justify-content: center; }
  .header__in { gap: 12px; height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .logo { margin-right: auto; }
  .hero__stats { gap: 24px; }
  .section { padding-top: 56px; }
  .cats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat { min-height: 120px; padding: 16px; }
  .toolbar__right { width: 100%; }
  .toolbar__right select { flex: 1; min-width: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card__body { padding: 12px; }
  .card__title { font-size: 14px; }
  .price { font-size: 16px; }
  .add { width: 38px; height: 38px; }
  .footer__in { grid-template-columns: 1fr; }
  .pm__info { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gauge__fill { stroke-dasharray: 320 503; }
  .gauge__needle { transform: rotate(94deg); }
}
