:root {
  --bg: #f5f6f8; --card: #fff; --text: #1c2230; --muted: #6b7385; --line: #e3e6ec;
  --accent: #ff6a00; --accent-d: #d95a00; --dark: #151a26; --ok: #1f9d55; --bad: #d64545;
  --radius: 14px; --shadow: 0 2px 10px rgba(20, 26, 40, .07);
  --hero-a: #151a26; --hero-b: #262f47; --skeleton: #dfe3ea; --soft: #f1f3f7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.muted { color: var(--muted); }
section { padding: 36px 0; }

/* header */
.site-header { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: .3px; }
.logo-name { color: #fff; }
.logo-name > span { color: var(--accent); }  /* «-БЫЛИ» — цветом темы, «ЖИЛИ» остаётся белым */
.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav a { opacity: .85; font-size: .95rem; }
.nav a:hover, .nav a.active { opacity: 1; color: var(--accent); }
.burger { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
@media (max-width: 820px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--dark); flex-direction: column; padding: 16px; gap: 14px; margin: 0; align-items: flex-start; }
  .nav.open { display: flex; }
}

/* buttons / forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 10px; border: 2px solid transparent; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: .15s; }
.btn:hover { background: var(--accent-d); }
.btn.ghost { background: transparent; border-color: currentColor; }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.light { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.light:hover { border-color: var(--accent); color: var(--accent); }
.btn.tg { background: #229ed9; }
.btn.sm { padding: 7px 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,106,0,.35); border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 12px 0; }
.alert.err { background: #fdecec; color: var(--bad); }
.alert.ok { background: #e7f6ed; color: var(--ok); }
.alert.info { background: #eaf3fc; color: #1b5c96; }

/* hero */
.hero { background: linear-gradient(120deg, var(--hero-a) 0%, var(--hero-b) 100%); color: #fff; padding: 64px 0 56px; }
.hero p { font-size: 1.15rem; opacity: .85; max-width: 640px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.usp { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.usp span { background: rgba(255,255,255,.1); padding: 6px 14px; border-radius: 99px; font-size: .9rem; }

/* quick search */
.quick { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: -34px; position: relative; }
.quick form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }

/* categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat { background: var(--card); border-radius: var(--radius); padding: 18px 10px; text-align: center; box-shadow: var(--shadow); font-weight: 600; transition: .15s; }
.cat:hover { transform: translateY(-3px); color: var(--accent); }
.cat .ico { font-size: 2rem; display: block; margin-bottom: 6px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(20,26,40,.12); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.05rem; margin: 0; }
.card .price { font-weight: 800; font-size: 1.15rem; margin-top: auto; }
.card .meta { color: var(--muted); font-size: .88rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eef0f4; color: var(--text); }
.badge.sale { background: #e1f3e8; color: #17703e; }
.badge.exchange { background: #e5eefb; color: #1d5fa8; }
.badge.parts { background: #fdeede; color: #b05200; }
.badge.contract, .badge.new { background: #e1f3e8; color: #17703e; }
.badge.draft, .badge.archived, .badge.rejected { background: #eceef2; color: #555; }
.badge.published, .badge.done { background: #e1f3e8; color: #17703e; }
.badge.in_progress { background: #fff1cc; color: #8a6200; }
.badge.new.app { background: #e5eefb; color: #1d5fa8; }

/* carousel */
.carousel { position: relative; aspect-ratio: 4/3; background: var(--skeleton); overflow: hidden; }
.carousel .track { display: flex; height: 100%; transition: transform .3s; }
.carousel .track img { min-width: 100%; height: 100%; object-fit: cover; }
.carousel button { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0; transition: .15s; }
.carousel:hover button { opacity: 1; }
@media (hover: none) { .carousel button { opacity: 1; } }
.carousel .prev { left: 8px; } .carousel .next { right: 8px; }
.carousel .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.carousel .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); }
.carousel .dots i.on { background: #fff; }
.carousel .badge { position: absolute; top: 10px; left: 10px; z-index: 2; }

/* gallery on detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.gallery .main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--skeleton); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery .thumbs img { width: 84px; height: 62px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .65; border: 2px solid transparent; }
.gallery .thumbs img.on, .gallery .thumbs img:hover { opacity: 1; border-color: var(--accent); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.specs { width: 100%; border-collapse: collapse; margin: 12px 0; }
.specs td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs td:first-child { color: var(--muted); width: 45%; }
.big-price { font-size: 1.9rem; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* catalog layout */
.catalog { display: grid; grid-template-columns: 270px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .catalog { grid-template-columns: 1fr; } }
.filters { display: grid; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs a { padding: 9px 18px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span { padding: 8px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.pager span.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; counter-reset: s; }
.step { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); counter-increment: s; }
.step::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 10px; }
.cta-block { background: var(--dark); color: #fff; border-radius: var(--radius); padding: 34px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-block h2 { margin: 0 0 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head a { color: var(--accent); font-weight: 600; }

/* previews for upload */
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.previews img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; }

/* footer */
.site-footer { background: var(--dark); color: #cbd0dc; padding: 36px 0 24px; margin-top: 40px; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.site-footer h4 { color: #fff; margin: 0 0 8px; }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy { margin-top: 24px; font-size: .85rem; opacity: .6; }

/* вход по коду */
.login-code { display: inline-block; font: 800 2.4rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .25em; padding: 14px 18px 14px 26px; background: var(--soft); border: 2px dashed var(--accent); border-radius: 12px; user-select: all; }
.muted-l { opacity: .65; font-size: .9em; }

/* переписка со специалистом */
.chat { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bubble { max-width: 85%; padding: 9px 14px; border-radius: 14px; white-space: pre-line; background: var(--soft); }
.bubble small { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 2px; }
.bubble.mine { align-self: flex-end; background: #e5eefb; }
.bubble.staff { align-self: flex-start; background: #e7f6ed; }
.reply-form .msg { align-self: center; font-size: .85rem; }

/* иконки Material Symbols (шрифт подключается в base.html; пока не загрузился — скрыты) */
.mi { font-family: "Material Symbols Rounded"; font-weight: 400; font-style: normal; font-size: 1.25em; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; display: inline-block; vertical-align: -.22em; width: 1em; overflow: hidden; visibility: hidden; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; }
.mi-ok .mi { visibility: visible; }
.btn .mi { font-size: 1.2em; }
.usp .mi { font-size: 1.1em; color: var(--accent); margin-right: 2px; }
.cat .ico { width: 56px; height: 56px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.cat .ico .mi { font-size: 2rem; }
.nav a .mi { font-size: 1.15em; margin-right: 3px; opacity: .9; }

/* новости */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.news-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: .15s; }
.news-card:hover { transform: translateY(-3px); }
.news-card .pic { aspect-ratio: 16/9; background: color-mix(in srgb, var(--accent) 14%, var(--skeleton)); display: grid; place-items: center; color: var(--accent); overflow: hidden; }
.news-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.news-card .pic .mi { font-size: 3rem; }
.news-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.news-card h3 { margin: 0; font-size: 1.08rem; }
.news-card .date { color: var(--muted); font-size: .8rem; }
.news-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.news-full { white-space: pre-line; font-size: 1.05rem; }
.news-full-img { border-radius: var(--radius); margin-bottom: 18px; max-height: 420px; width: 100%; object-fit: cover; }

/* услуги */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.service { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.service .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.service .ico .mi { font-size: 1.9rem; }
.service h3 { margin: 4px 0 0; }
.service p { margin: 0; color: var(--muted); white-space: pre-line; flex: 1; }
.service .price { font-weight: 800; font-size: 1.1rem; }

/* верхняя полоса с контактами */
.topbar { background: color-mix(in srgb, var(--dark) 82%, #000); color: #cbd0dc; font-size: .86rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; flex-wrap: wrap; padding-block: 4px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.topbar a { display: inline-flex; align-items: center; gap: 5px; opacity: .92; }
.topbar a:hover { color: var(--accent); opacity: 1; }
.topbar .tb-phone b { color: #fff; font-weight: 700; letter-spacing: .2px; }
.topbar .tb-label { opacity: .65; }
.topbar .tb-addr { display: inline-flex; align-items: center; gap: 4px; opacity: .8; }
.tb-right a { width: 28px; height: 28px; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.08); }
.tb-right a:hover { background: var(--accent); color: #fff; }
@media (max-width: 720px) {
  .tb-addr, .tb-label, .tb-phone:nth-child(n+3) { display: none; }
  .topbar .container { flex-wrap: nowrap; }
}

/* логотип с подписью */
.logo { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.05; }
.logo-sub { font-size: .62rem; font-weight: 500; letter-spacing: .5px; opacity: .72; margin-top: 2px; }
.site-footer h4 .logo-sub, .site-footer .tagline { font-size: .8rem; opacity: .7; }

/* несколько бейджей сделки на фото */
.carousel .badges { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 20px); }
.carousel .badges .badge { position: static; }

/* ---- соцсети: цвета брендов ---- */
.sk-telegram { --sk: #229ed9; }
.sk-tiktok { --sk: #111827; --sk2: #fe2c55; }
.sk-vk { --sk: #0077ff; }
.sk-instagram { --sk: #dc2743; --sk-bg: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); }

/* значки в верхней полосе — крупнее и цветные */
.tb-right a { width: 32px; height: 32px; background: var(--sk-bg, var(--sk, rgba(255,255,255,.12))); color: #fff; opacity: 1; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tb-right a .mi { font-size: 1.25rem; }
.tb-right a:hover { filter: brightness(1.15); transform: translateY(-1px); background: var(--sk-bg, var(--sk)); }

/* блок «Подписывайтесь» над подвалом */
.social-cta { padding: 34px 0 6px; }
.social-cta .container { background: var(--dark); color: #fff; border-radius: var(--radius); padding: 28px 30px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.social-cta .container::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .18; }
.social-cta h2 { margin: 0 0 4px; }
.social-cta p { margin: 0; opacity: .8; max-width: 460px; }
.sc-btns { display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
.sbtn { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px 12px 16px; border-radius: 14px; color: #fff; font-weight: 600; background: var(--sk-bg, var(--sk, var(--accent))); box-shadow: 0 4px 14px rgba(0,0,0,.28); transition: transform .15s, filter .15s; }
.sbtn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.sbtn .mi { font-size: 1.9rem; }
.sbtn span { display: grid; line-height: 1.15; }
.sbtn small { font-weight: 500; opacity: .85; font-size: .78rem; }
.sk-tiktok.sbtn { background: linear-gradient(120deg, #111827 55%, #fe2c55); }


/* соцсети в подвале — заметные кнопки-чипы */
.site-footer .foot-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.site-footer .foot-socials a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; color: #fff; background: var(--sk-bg, var(--sk, rgba(255,255,255,.14))); font-weight: 600; font-size: .9rem; }
.site-footer .foot-socials a:hover { filter: brightness(1.12); color: #fff; }

/* ---- галерея: свайп влево/вправо + полный экран ---- */
.gallery .gmain { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--skeleton); }
.gslides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.gslides::-webkit-scrollbar { display: none; }
.gslides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; cursor: zoom-in; user-select: none; }
.gcount { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; border-radius: 99px; padding: 3px 11px; font-size: .8rem; font-weight: 600; pointer-events: none; }
.gfs { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gfs .mi { font-size: 1.5rem; }
.gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.gmain:hover .gnav { opacity: 1; }
.gprev { left: 10px; } .gnext { right: 10px; }
@media (hover: none) { .gnav { display: none; } }
.gallery .thumbs { scroll-behavior: smooth; }
.gallery .thumbs img { flex: none; }

.lb { position: fixed; inset: 0; z-index: 3000; background: rgba(5, 8, 14, .97); display: flex; flex-direction: column; color: #fff; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
.lb-count { font-weight: 600; opacity: .85; }
.lb-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1.2rem; cursor: pointer; }
.lb-slides { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.lb-slides::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; touch-action: pan-x pinch-zoom; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 2rem; cursor: pointer; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
@media (hover: none) { .lb-nav { display: none; } }
.pager .dots { padding: 8px 4px; color: var(--muted); border: 0; background: none; }
