/* Кодкраски — главная страница (корень домена). Стили в духе магазина /newprice1/shop.css */
:root {
  --bg: #e9edee;
  --surface: #ffffff;
  --ink: #12181b;
  --muted: #59656b;
  --line: #cfd7da;
  --accent: #1d4ed8;
  --on-accent: #ffffff;
  --tint: #dbe4f7;
  --ok: #0f7a4d;
  --logo-red: #d93025; --logo-green: #188038; --logo-blue: #1d4ed8; --logo-yellow: #e8a200;
  --shadow: 0 18px 40px rgba(18, 24, 27, .18);
  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1316; --surface: #171e22; --ink: #edf2f4; --muted: #93a1a8; --line: #2a353b;
    --accent: #7ea0ff; --on-accent: #0b1220; --tint: #1d2a4d; --ok: #4cd39a;
    --logo-red: #ff7b6e; --logo-green: #4cd39a; --logo-blue: #7ea0ff; --logo-yellow: #ffd54d;
    --shadow: 0 18px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1316; --surface: #171e22; --ink: #edf2f4; --muted: #93a1a8; --line: #2a353b;
  --accent: #7ea0ff; --on-accent: #0b1220; --tint: #1d2a4d; --ok: #4cd39a;
  --logo-red: #ff7b6e; --logo-green: #4cd39a; --logo-blue: #7ea0ff; --logo-yellow: #ffd54d;
  --shadow: 0 18px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Шапка */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.logo { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; }
.logo svg { width: 32px; height: 32px; }
.b1 { stroke: var(--logo-red); }
.b2 { stroke: var(--logo-green); }
.b3 { stroke: var(--logo-blue); }
.b4 { stroke: var(--logo-yellow); }
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  border: 0; border-radius: 999px; padding: 9px 14px 9px 16px; font-weight: 600;
  transition: transform .15s ease;
}
.cta-btn:active { transform: scale(.97); }
.cta-btn svg { width: 20px; height: 20px; }

/* Заголовок страницы */
.head { padding-block: clamp(24px, 5vw, 44px) 4px; display: grid; gap: 8px; }
h1 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.15; }
.meta { margin: 0; color: var(--muted); }

/* Контактная лента под заголовком */
.contacts { display: grid; grid-template-columns: 1.9fr 1fr 1.1fr 1.2fr; gap: 10px; padding-block: 16px 4px; }
.contact {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: inherit; text-decoration: none; font-size: .92rem; line-height: 1.35;
  transition: border-color .15s ease, transform .12s ease;
}
.contact:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.contact > span { display: block; min-width: 0; }
.contact b { font-variant-numeric: tabular-nums; white-space: nowrap; display: block; }
.contact .sm { display: block; color: var(--muted); font-size: .8rem; }

/* Меню-чипы */
.menu { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 14px 6px; }
.menu a {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.menu a svg { width: 15px; height: 15px; color: var(--muted); transition: color .15s ease; }
.menu a:hover { border-color: var(--accent); color: var(--accent); }
.menu a:hover svg { color: var(--accent); }
.menu a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.menu a[aria-current="page"] svg { color: var(--on-accent); }
.menu a.osago { border-color: color-mix(in srgb, var(--logo-yellow) 60%, transparent); }
.menu a.osago svg { color: var(--logo-yellow); }
.menu a.osago:hover { background: color-mix(in srgb, var(--logo-yellow) 14%, var(--surface)); color: var(--ink); }

/* Контент: статья */
.sect-title {
  margin: 0; font-family: var(--f-display); font-weight: 500; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.doc { max-width: 78ch; display: grid; gap: 12px; padding-block: 14px 8px; }
.doc p { margin: 0; line-height: 1.65; }
.doc h2 {
  margin: 22px 0 2px; scroll-margin-top: 76px;
  font-family: var(--f-display); font-weight: 500; font-size: 1.06rem; line-height: 1.3;
}
.doc a { color: var(--accent); }
.doc a:hover { color: var(--ink); }
.doc .lead { color: var(--muted); }
.pic { margin: 6px 0; }
.pic img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 10px 6px; }
.cta-row .primary {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  border-radius: 12px; padding: 12px 18px; font-weight: 600; transition: filter .2s ease, transform .12s ease;
}
.cta-row .primary:hover { filter: brightness(1.08); }
.cta-row .primary:active { transform: scale(.98); }
.cta-row .ghost {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 18px;
  color: var(--ink); text-decoration: none; font-weight: 600; transition: background .15s ease, color .15s ease;
}
.cta-row .ghost:hover { background: var(--ink); color: var(--bg); }
.cta-row svg { width: 18px; height: 18px; }

/* Наши товары: карточки брендов */
.brands-section { padding-block: 26px 8px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding-block: 14px 10px; }
.bcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 14px 14px; text-decoration: none; color: inherit;
  display: grid; gap: 6px; justify-items: center; text-align: center; align-content: start;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.bcard:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18, 24, 27, .10); }
.blogo { height: 56px; display: grid; place-items: center; }
.blogo img { max-height: 56px; max-width: 140px; width: auto; object-fit: contain; }
.bname { font-family: var(--f-display); font-weight: 500; font-size: .95rem; letter-spacing: .02em; }

/* Футер */
.fcols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px;
  padding-block: 26px 18px; font-size: .9rem;
}
.fcols h3 {
  margin: 0 0 10px; font-family: var(--f-display); font-weight: 500;
  font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}
.fcols p, .fcols li { margin: 0; line-height: 1.6; }
.fcols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fcols a { color: var(--ink); text-decoration: none; }
.fcols a:hover { color: var(--accent); }
.fcols .addr { color: var(--muted); }
.fcols .cards { margin-top: 10px; width: 132px; }
.social { display: flex; align-items: center; gap: 12px; }
.vk { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #0077ff; color: #fff; transition: transform .15s ease, filter .2s ease; }
.vk:hover { transform: translateY(-2px); filter: brightness(1.1); }
.vk svg { width: 24px; height: 24px; }
.sprav iframe { border-radius: 8px; border: 0; }
.foot { border-top: 1px solid var(--line); padding-block: 20px 28px; color: var(--muted); font-size: .85rem; }
.foot a { color: inherit; }
.foot a:hover { color: var(--ink); }
.foot.has-counter { display: flex; flex-wrap: wrap; align-items: center; column-gap: .45em; row-gap: 6px; }
.ym-badge { margin-left: auto; line-height: 0; }
.ym-badge img { display: block; }
.li-counter { display: inline-block; line-height: 0; }

/* Кнопка «Наверх» */
.totop {
  position: fixed; z-index: 6;
  left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 0; color: var(--on-accent); background: var(--accent);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.totop.show { opacity: .7; visibility: visible; transform: none; }
.totop.show:hover, .totop.show:focus-visible { opacity: 1; }
.totop svg { width: 20px; height: 20px; }

/* Адаптив */
@media (max-width: 979px) {
  .contacts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 559px) {
  .contacts { grid-template-columns: 1fr; }
  /* Шапка: ужимаем лого и кнопку, чтобы строка гарантированно помещалась */
  .bar-in { padding-block: 10px; }
  .logo { font-size: .92rem; gap: 8px; }
  .logo svg { width: 26px; height: 26px; }
  .cta-btn { font-size: .9rem; padding: 8px 12px 8px 14px; gap: 7px; }
  .cta-btn svg { width: 17px; height: 17px; }
  .bgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bcard { padding: 14px 10px 12px; }
  .blogo img { max-height: 44px; max-width: 120px; }
  .cta-row .primary, .cta-row .ghost { flex: 1; justify-content: center; }
  .ym-badge { flex-basis: 100%; order: 10; margin-left: 0; margin-top: 14px; }
}
/* Совсем узкие экраны (320px): лого мельче, у кнопки прячем иконку */
@media (max-width: 379px) {
  .logo { font-size: .84rem; letter-spacing: 0; gap: 7px; }
  .logo svg { width: 24px; height: 24px; }
  .cta-btn { padding: 8px 12px; }
  .cta-btn svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
