/* Shared elements for all directions (04-structure/shared-elements.md). Tokens: brandbook.css */

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.hdr.is-scrolled { border-color: var(--line); }
.hdr__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.hdr__nav { display: none; gap: 4px; margin-left: 12px; }
.hdr__nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; transition: background .2s; }
.hdr__nav a:hover { background: var(--mist); }
.hdr__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.hdr__loc { display: none; position: relative; }
.hdr__phone { display: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hdr__phone small { display: block; font-size: 12px; font-weight: 500; color: var(--steel); }
.hdr .btn { height: 44px; padding: 0 18px; font-size: 15px; }
.hdr__burger { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--mist); display: grid; place-items: center; cursor: pointer; }
@media (min-width: 1100px) { .hdr__nav { display: flex; } .hdr__burger { display: none; } .hdr__phone, .hdr__loc { display: block; } }
@media (max-width: 479px) { .hdr .btn { display: none; } }

.loc-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--mist); }
.loc-switch button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--steel); cursor: pointer; transition: background .2s, color .2s; }
.loc-switch button.is-on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Mobile bottom bar */
.mbar { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 8px; border-radius: 14px; background: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.mbar .btn { height: 48px; }
@media (min-width: 1100px) { .mbar { display: none; } }

/* Shared blocks */
.why { display: grid; gap: 16px; }
@media (min-width: 768px) { .why { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .why { grid-template-columns: repeat(4, 1fr); } }
.why__item { padding: 28px; display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.why__big { font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.why__item p { color: var(--steel); margin-top: auto; }

.steps { display: grid; gap: 16px; counter-reset: s; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding-top: 28px; border-top: 2px solid var(--line); }
.step::before { counter-increment: s; content: "0" counter(s); position: absolute; top: -2px; left: 0; height: 2px; width: 0; background: var(--ink); transition: width 1s var(--ease); }
.step.is-in::before { width: 100%; }
.step__n { font-size: 14px; font-weight: 600; color: var(--steel); margin-bottom: 16px; }
.step p { color: var(--steel); margin-top: 8px; }

.brands { display: flex; flex-wrap: wrap; gap: 8px; }
.brands a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 15px; transition: border-color .2s, background .2s; }
.brands a:hover { border-color: var(--ink); }
.brands a.is-main { background: var(--ink); color: var(--white); border-color: var(--ink); }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding: 24px 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 28px; line-height: 1; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; max-width: 760px; color: var(--steel); }

.locs { display: grid; gap: 16px; }
@media (min-width: 900px) { .locs { grid-template-columns: 1fr 1fr; } }
.loc { overflow: hidden; display: flex; flex-direction: column; }
.loc__map { aspect-ratio: 16/8; background: var(--mist) center/cover; position: relative; overflow: hidden; }
.loc__map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.loc__body { padding: 24px 28px 28px; display: grid; gap: 6px; }
.loc__row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.cta-form { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1000px) { .cta-form { grid-template-columns: 1.1fr 1fr; gap: 64px; } }
.form { display: grid; gap: 12px; }
@media (min-width: 600px) { .form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
.form__row { display: grid; gap: 12px; }
.section--dark .field { background: var(--graphite); border-color: var(--on-dark-line); color: var(--white); }
.section--dark .field::placeholder { color: var(--on-dark-muted); }
.section--dark .field:focus { border-color: var(--white); }
.section--dark .check { color: var(--on-dark-muted); }

/* Reviews placeholder (Q-006: real reviews from Yandex Maps / 2GIS) */
.rating { display: flex; align-items: center; gap: 20px; }
.rating__n { font-size: 96px; line-height: .9; font-weight: 600; letter-spacing: -.05em; }
.stars { display: flex; gap: 4px; }
.stars i { width: 20px; height: 20px; background: var(--signal); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.todo { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #FFF4CC; color: #7A5B00; font-size: 12px; font-weight: 600; }

/* Footer */
.ftr { background: var(--ink); color: var(--white); padding: 72px 0 120px; font-size: 15px; }
@media (min-width: 1100px) { .ftr { padding-bottom: 40px; } }
.ftr__grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .ftr__grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.ftr h4 { margin: 0 0 16px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 600; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ftr a:hover { color: var(--signal); }
.ftr__addr { display: grid; gap: 20px; }
.ftr__addr b { display: block; font-size: 18px; }
.ftr__bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--on-dark-line); display: flex; flex-wrap: wrap; gap: 12px 32px; color: var(--on-dark-muted); font-size: 13px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; visibility: hidden; }
.modal.is-open { visibility: visible; }
.modal__bg { position: absolute; inset: 0; background: rgba(18,20,23,.55); opacity: 0; transition: opacity .3s; }
.modal.is-open .modal__bg { opacity: 1; }
.modal__box { position: relative; width: 100%; max-width: 480px; background: var(--white); border-radius: 20px; padding: 32px; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.modal.is-open .modal__box { transform: none; opacity: 1; }
.modal__x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--mist); cursor: pointer; font-size: 20px; }
.modal__ctx { margin: 12px 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Direction switcher (mockup only) */
.dirbar { position: fixed; z-index: 60; left: 16px; bottom: 16px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.dirbar a { padding: 6px 10px; border-radius: 8px; color: var(--on-dark-muted); font-size: 12px; font-weight: 600; }
.dirbar a.is-on { background: var(--signal); color: var(--ink); }
@media (max-width: 1099px) { .dirbar { bottom: 88px; } }

/* ===== Series 2 additions ===== */
/* Motion drives modal and reveal: drop CSS transitions that would fight it */
.mo .modal__box { transition: none; opacity: 1; transform: none; }
.mo .modal__bg { transition: none; opacity: 1; }
.modal__ok { text-align: left; padding: 8px 0; }
.okmark { width: 64px; height: 64px; }
.dirbar__s { padding: 6px 8px; color: var(--signal); font-size: 12px; font-weight: 700; }

/* Facts strip (shared by all directions, home-structure #2) */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts > div { font-size: 40px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.facts b { font-weight: 600; }
.facts span { display: block; margin-top: 6px; color: var(--steel); font-size: 15px; font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.section--dark .facts span, .hero--dark .facts span { color: var(--on-dark-muted); }

/* Reviews: rating + wall (SEC-TRUST-03 + SEC-TRUST-01) */
.revs { display: grid; gap: 32px; }
@media (min-width: 1100px) { .revs { grid-template-columns: 320px 1fr; align-items: start; } .revs > .todo { grid-column: 2; justify-self: start; } }
.revs__wall { display: grid; gap: 12px; }
@media (min-width: 760px) { .revs__wall { grid-template-columns: repeat(3, 1fr); } }
.rev { margin: 0; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.rev blockquote { margin: 0; font-size: 17px; line-height: 1.5; }
.rev figcaption { margin-top: auto; display: grid; gap: 2px; font-size: 14px; }
.rev figcaption span { color: var(--steel); }
.stars--s i { width: 14px; height: 14px; }

/* Guarantee (home-structure #9) */
.guar { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .guar { grid-template-columns: 200px 1fr; gap: 56px; } }
.guar__seal { width: 160px; color: var(--ink); }
.guar__seal svg { width: 100%; height: auto; overflow: visible; }
.guar__items { display: grid; gap: 28px; }
@media (min-width: 900px) { .guar__items { grid-template-columns: repeat(3, 1fr); } }
.guar__items p { margin-top: 8px; }
.section--dark .guar__seal { color: var(--signal); }

/* Header fit: longer CTA copy in series 2 — no wrapping; location switch only where it fits (also on contacts) */
.hdr__nav a, .loc-switch button, .hdr .btn { white-space: nowrap; }
.hdr__in { gap: 20px; }
@media (min-width: 1100px) and (max-width: 1399px) { .hdr__loc { display: none; } }
@media (min-width: 1100px) and (max-width: 1199px) { .hdr__phone small { display: none; } .hdr__nav a { padding: 8px 9px; } }

/* Mockup switcher: one line, scrolls on narrow screens */
.dirbar { max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.dirbar::-webkit-scrollbar { display: none; }
.dirbar a, .dirbar span { flex: none; white-space: nowrap; }
