/* ============================================================
   layout.css — архетип «фіксований лівий сайдбар» (dashboard)
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Лівий сайдбар ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 30px;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 44px; height: 44px; border-radius: 13px;
  flex: 0 0 auto;
}
.brand__name {
  font-family: var(--ff-head);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -.02em;
  line-height: 1;
}
.brand__tag {
  display: block;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 3px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.side-nav__link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  color: var(--ink-soft);
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: .98rem;
  transition: background .18s, color .18s;
}
.side-nav__link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav__link svg { width: 19px; height: 19px; flex: 0 0 auto; stroke: currentColor; }
.side-nav__link.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.side-foot {
  margin-top: auto;
  padding-top: 24px;
}
.side-divider {
  height: 1px; background: var(--line); margin: 22px 0 18px;
}
.side-hours {
  font-size: .88rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.side-hours .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: 0 0 auto;
}
.side-call {
  display: block;
  font-family: var(--ff-head);
  font-weight: 800;
  font-size: 1.34rem;
  color: var(--ink);
  letter-spacing: -.01em;
}
.side-call:hover { text-decoration: none; color: var(--accent-deep); }
.side-call small {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.side-msgs {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}
.msg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  border-radius: var(--radius-s);
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: .82rem;
  color: #fff;
}
.msg-btn:hover { text-decoration: none; opacity: .92; }
.msg-btn svg { width: 15px; height: 15px; fill: currentColor; }
.msg-btn--viber { background: #7360f2; }
.msg-btn--tg    { background: #229ed9; }

/* ---------- Основна область ---------- */
.main {
  min-width: 0;
  padding: clamp(20px, 3.4vw, 46px);
  padding-bottom: 80px;
}
.main__inner { max-width: var(--maxw); }

.section { margin-top: clamp(46px, 6vw, 78px); }
.section--tight { margin-top: clamp(30px, 4vw, 48px); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.section__head p { margin: 0; max-width: 52ch; }

/* ---------- Верхній мобільний бар (приховано на десктопі) ---------- */
.topbar { display: none; }

/* ---------- Футер усередині main ---------- */
.foot {
  margin-top: clamp(50px, 7vw, 90px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 34px;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  color: var(--ink-soft);
}
.foot a { color: var(--ink-soft); }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
  }
  .topbar .brand { margin: 0; }
  .topbar .brand__mark { width: 38px; height: 38px; }
  .topbar .brand__name { font-size: 1.12rem; }
  .topbar .brand__tag { display: none; }

  .burger {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    width: 46px; height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .burger span,
  .burger span::before,
  .burger span::after {
    content: "";
    display: block;
    width: 20px; height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .22s, opacity .2s;
  }
  .burger span { position: relative; }
  .burger span::before { position: absolute; top: -6px; }
  .burger span::after  { position: absolute; top: 6px; }
  .burger[aria-expanded="true"] span { background: transparent; }
  .burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
  .burger[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(330px, 86vw);
    height: 100dvh;
    z-index: 60;
    transform: translateX(105%);
    transition: transform .28s ease;
    box-shadow: var(--shadow-m);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .brand { display: none; }

  .scrim {
    position: fixed; inset: 0;
    background: rgba(12, 28, 24, .42);
    opacity: 0; visibility: hidden;
    transition: opacity .25s;
    z-index: 55;
  }
  .scrim.is-open { opacity: 1; visibility: visible; }

  .main { padding: 18px 16px 90px; }
}

@media (min-width: 901px) {
  .topbar, .scrim { display: none; }
}

/* ---------- Мобільний липкий call-bar ---------- */
.callbar { display: none; }
@media (max-width: 900px) {
  .callbar {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 8px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15,40,35,.08);
  }
  .callbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 8px;
    border-radius: 12px;
    font-family: var(--ff-head);
    font-weight: 700;
    font-size: .92rem;
  }
  .callbar a:hover { text-decoration: none; }
  .callbar svg { width: 17px; height: 17px; }
  .callbar .cb-call { background: var(--accent); color: #fff; }
  .callbar .cb-call svg { fill: #fff; }
  .callbar .cb-viber { background: #ece8ff; color: #5b46d6; }
  .callbar .cb-tg    { background: #e3f3fb; color: #1782b6; }
  .callbar .cb-viber svg, .callbar .cb-tg svg { fill: currentColor; }
}
