/* ==========================================================================
   custom.css — Стили блоков главной страницы и адаптивной шапки
   ========================================================================== */

/* ===== 1. Адаптивная шапка и бургер ===== */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 70px;
}

.burger-toggle {
    display: none;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    z-index: 1002;
}

.burger-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #1d2d47;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.mobile-menu-contacts {
    display: none;
}

/* ===== 2. Логотип с вензелем ===== */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-dark);
    text-decoration: none;
    background: transparent;
}

.logo-icon-wrap {
    width: 48px;
    height: 48px;
    overflow: hidden;
    background: #f5f2eb;
}

.logo-venzel {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.logo-text {
    color: inherit;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.logo:hover .logo-venzel,
.logo:focus-visible .logo-venzel {
    transform: rotate(4deg) scale(1.04);
}

.logo:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 5px;
}

/* ===== 3. Сетка "Что предоставить" (cases-grid) ===== */
.cases-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.cases-card {
    width: calc(33.333% - 16px);
    display: flex;
    flex-direction: column;
    padding: 36px;
    border: 1px solid rgba(201, 165, 82, 0.3);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.cases-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
}

.cases-label {
    color: var(--gold);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.cases-card h3 {
    color: #ffffff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 16px;
}

.cases-card p {
    color: rgba(255, 255, 255, 0.72);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.cases-card .cases-result {
    margin-top: auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.cases-card .cases-result strong {
    color: var(--gold);
}

/* ===== 4. Блок кейсов из практики ===== */
.cases-section {
    background: #1d2d47;
    padding: 84px 0;
    border-top: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
}

.cases-section .cards-2x2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .cases-section .cards-2x2 {
        grid-template-columns: 1fr;
        gap: 16px; /* Опционально: уменьшение отступа между карточками */
    }
}

.cases-section .card-case-dark {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 30px;
    border: 1px solid rgba(201, 165, 82, 0.28);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    border-radius: 0;
}

.cases-section .case-cat {
    color: var(--gold);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.cases-section .case-desc {
    color: #ffffff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 29px;
    font-weight: 500;
    line-height: 1.12;
    margin-bottom: 14px;
}

.cases-section .case-result {
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
}

.cases-section .case-result strong {
    color: var(--gold);
    font-weight: 600;
}

/* ===== 4.1 Карусель кейсов на главной ===== */
.cases-carousel {
    max-width: 1180px;
    margin: 0 auto;
}

.cases-carousel__viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.cases-carousel__track {
    display: flex;
    gap: 24px;
    transition: transform 0.45s ease;
}

.cases-carousel__track .cases-card {
    flex: 0 0 calc(50% - 12px);
    width: auto;
}

/* Подъём карточки при наведении обрезается вьюпортом — оставляем только подсветку рамки */
.cases-carousel__track .cases-card:hover {
    transform: none;
}

.cases-carousel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.cases-carousel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(201, 165, 82, 0.5);
    border-radius: 2px;
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

.cases-carousel__btn:hover:not(:disabled) {
    background: var(--gold);
    border-color: var(--gold);
    color: #1d2d47;
}

.cases-carousel__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.cases-carousel__counter {
    min-width: 72px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .cases-carousel__track {
        gap: 16px;
    }

    .cases-carousel__track .cases-card {
        flex: 0 0 100%;
    }

    .cases-carousel__btn {
        width: 44px;
        height: 44px;
    }

    .cases-carousel__nav {
        margin-top: 28px;
    }
}

/* ===== 5. Кнопка "Наверх" ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background: var(--gold);
    color: var(--dark-charcoal); /* Тёмная стрелка — как иконка телефона и текст «Задать вопрос» */
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, bottom 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollTopBtn:hover {
    background: #b89551; /* Как у .floating-cta-question:hover */
    color: var(--dark-charcoal);
}

#scrollTopBtn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor; /* Цвет стрелки берётся из color (тёмный), а не жёстко белый */
}

/* ===== 6. Компактный блок правовых ресурсов (в форме) ===== */
.resources-mini {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
    align-items: stretch;
}

.resources-mini-title {
    margin: 26px 0 6px;
    color: rgba(255, 255, 255, 0.72);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
    text-align: center;
}

.resource-mini-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #ffffff;
    text-decoration: none;
    text-align: left;
    border: 1px solid rgba(201, 165, 82, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.resource-mini-link:hover,
.resource-mini-link:focus-visible {
    border-color: var(--gold);
    background: rgba(201, 165, 82, 0.12);
    transform: translateY(-2px);
}

.resource-mini-link:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.resource-mini-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 165, 82, 0.25);
    border-radius: 8px;
}

.resource-mini-icon img {
    display: block;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.resource-mini-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.resource-mini-name {
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.resource-mini-description {
    color: rgba(255, 255, 255, 0.72);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

/* ===== 7. Медиа-запросы (Адаптивность) ===== */
@media (max-width: 1024px) {
    .cases-card { width: calc(50% - 12px); }
}

/* Мобильные устройства (1 колонка) */
@media (max-width: 768px) {
    /* Карточки кейсов занимают 100% ширины */
    .cases-card { 
        width: 100%; 
    }
}

@media (max-width: 860px) {
    /* Отображение мобильного меню */
    .burger-toggle {
        display: flex;
    }

    .burger-toggle.active span:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    .burger-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-toggle.active span:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }

    /* 1. Блокируем горизонтальный скролл страницы */
    html, body {
        overflow-x: hidden;
    }

    /* 2. Мобильная навигация */
    .header .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff;
        
        /* Убираем тень в закрытом состоянии, чтобы она не торчала */
        box-shadow: none;
        
        display: flex;
        flex-direction: column;
        padding: 90px 24px 40px;
        box-sizing: border-box;
        z-index: 1001;
        gap: 0;

        /* Полное скрытие за экраном */
        transform: translateX(100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    visibility 0.3s ease, 
                    opacity 0.3s ease, 
                    box-shadow 0.3s ease;
    }

    /* 3. Открытое меню */
    .header .nav.open {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        /* Тень появляется только при открытии */
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    }
}
/* ===== 12. Cookie-баннер ===== */
.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(0);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(720px, calc(100% - 32px));
    padding: 18px 20px;
    background: #1d2d47;
    color: #fff;
    border: 1px solid rgba(201, 165, 82, 0.35);
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    transition: transform 0.4s ease, opacity 0.4s ease, bottom 0.3s ease;
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent.is-hidden {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
    pointer-events: none;
}

.cookie-consent__text {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.cookie-consent__text a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent__text a:hover {
    color: #fff;
}

.cookie-consent__btn {
    flex-shrink: 0;
    min-width: 132px;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.cookie-consent__btn:hover {
    background: #b8943e;
}
/* ===== 13. Плавающая CTA ("Задать вопрос") ===== */

/* Переносим кнопку "Наверх" в левый нижний угол, чтобы не перекрывалась с CTA */
#scrollTopBtn {
  right: auto;
  left: 30px;
}

.floating-cta {
  position: fixed;
  right: 30px;
  bottom: 30px;
  /* Выше липкой шапки (1000), её шторки (1001) и бургера (1002): на низких
     мобильных экранах панель колбэка доходит до шапки и должна рисоваться
     поверх, а не прятаться под неё */
  z-index: 1003;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  transition: bottom 0.3s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

/* Скрытие до первого скролла (2b): единое поведение для всех плавающих */
.floating-cta.is-hidden,
.chat-widget.is-hidden {
  opacity: 0;
  transform: translateY(24px);
  visibility: hidden;
  pointer-events: none;
}

/* Постоянный фейдер под плавающими кнопками: самостоятельный fixed-слой
   ВНЕ .floating-cta — виден всегда, независимо от скрытия/появления кнопок
   (18.10: внутри контейнера он «моргал» вместе с ними). z-index 1002 —
   над контентом страницы, под кнопками (1003); клики проходят сквозь. */
.site-bottom-fade {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 170px;
  background: linear-gradient(to top, rgba(20, 20, 20, 0.15), rgba(20, 20, 20, 0));
  pointer-events: none;
  z-index: 1002;
}

.floating-cta-question {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--dark-charcoal);
  text-decoration: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(198, 166, 100, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.floating-cta-question:hover,
.floating-cta-question:focus-visible {
  background: #b89551;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(198, 166, 100, 0.45);
}

.floating-cta-question-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-cta-question-label::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232A2A28' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12l7 7 7-7'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* Mobile: вопросная пилюля; пузырь-трубка виджета колбэка — над пилюлей
   (секция 14) */
@media (max-width: 768px) {
  .floating-cta {
    right: 16px;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    align-items: center;
  }

  .floating-cta-question {
    padding: 13px 16px;
    font-size: 14px;
  }

  .floating-cta-question-label::after {
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232A2A28' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12l7 7 7-7'/%3E%3C/svg%3E") no-repeat center/contain;
  }

  #scrollTopBtn {
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .site-bottom-fade {
    height: 140px;
  }
}

/* ===== 14. Виджет обратного звонка (самописный; до 17.10 — пузырь Novofon) ===== */

/* Пузырь-трубка НАД пилюлей «Задать вопрос», прижат к её правому краю.
   Позиция — прежнее место пузыря Novofon: right 40 / bottom 96 от вьюпорта
   (мобайл: right 26 / bottom 96+safe). У fixed-контейнера right 30 / bottom 30
   это right 10 / bottom 66 от его краёв; на мобиле контейнер right 16 /
   bottom 30+safe — те же 10/66. */
.callback-bubble {
  position: absolute;
  right: 10px;
  bottom: 66px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  background: var(--gold);
  color: var(--dark-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(198, 166, 100, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.callback-bubble:hover,
.callback-bubble:focus-visible {
  background: #b89551;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(198, 166, 100, 0.45);
}

/* Спокойное золотое кольцо-пульс (как pulse-кольца Novofon, без кислоты) */
.callback-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: callback-pulse 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.callback-bubble[aria-expanded="true"]::after {
  animation: none;
}

@keyframes callback-pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 166, 100, 0.45); }
  70%, 100% { box-shadow: 0 0 0 20px rgba(198, 166, 100, 0); }
}

/* Панель: десктоп — слева от пузыря (как панель Novofon), тёмно-синий корпус
   в тон секции «Свяжитесь с нами», крем-текст, золотые акценты. Показ/скрытие —
   класс .open из script.js (hidden-атрибут гасит полностью закрытую панель). */
.callback-panel {
  position: absolute;
  right: 80px;
  bottom: 66px;
  width: 300px;
  padding: 22px 20px 18px;
  background: var(--dark-blue);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.callback-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.callback-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(245, 242, 235, 0.55);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.callback-close:hover,
.callback-close:focus-visible {
  color: var(--bg-cream);
  background: rgba(255, 255, 255, 0.08);
}

.callback-title {
  margin: 0 0 4px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--gold);
}

.callback-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(245, 242, 235, 0.75);
}

/* Поле и кнопка — как поля формы «Свяжитесь с нами», чуть компактнее */
.callback-input {
  width: 100%;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--bg-cream);
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.callback-input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.callback-input::placeholder {
  color: rgba(245, 242, 235, 0.4);
}

.callback-send {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  background: var(--gold);
  color: var(--dark-charcoal);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(198, 166, 100, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.callback-send:hover:not(:disabled),
.callback-send:focus-visible:not(:disabled) {
  background: #b89551;
  transform: translateY(-1px);
}

.callback-send:disabled {
  opacity: 0.75;
  cursor: default;
}

.callback-status {
  margin: 10px 0 0;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.4;
  display: none;
}

.callback-status.show { display: block; }
.callback-status.ok { color: #7DC98F; }
.callback-status.err { color: #FF8A80; }

.callback-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(245, 242, 235, 0.45);
}

.callback-divider::before,
.callback-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(245, 242, 235, 0.14);
}

.callback-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(198, 166, 100, 0.55);
  border-radius: 10px;
  color: var(--gold);
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.callback-call:hover,
.callback-call:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark-charcoal);
}

.callback-note {
  margin: 12px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(245, 242, 235, 0.4);
}

.callback-note a {
  color: rgba(245, 242, 235, 0.55);
  text-decoration: underline;
}

.callback-note a:hover { color: var(--bg-cream); }

@media (max-width: 768px) {
  .callback-bubble {
    right: 10px; /* = 26px от края экрана, как раньше */
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }

  /* Панель — над пузырём, почти во всю ширину экрана */
  .callback-panel {
    right: 10px;
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .callback-bubble::after { animation: none; }
  .callback-panel { transition: none; }
}

.cookie-consent__btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
        bottom: 16px;
        text-align: left;
        padding: 18px;
    }

    .cookie-consent__btn {
        width: 100%;
    }
}
/* ==========================================================================
   P1: НОВЫЕ БЛОКИ ГЛАВНОЙ (вводное УТП, этапы работы, судебные акты, сертификаты)
   ========================================================================== */

/* Вводный абзац УТП после hero */
.intro-lead {
    max-width: 650px;
    margin: 0 auto;
    padding: 46px 0 10px;
    text-align: center;
}

.intro-lead p {
    margin: 0;
    color: var(--gray-mid, #5a6472);
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    line-height: 1.75;
}

/* Этапы работы */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* Судебные акты: скачиваемые документы */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    max-width: 1180px;
    margin: 0 auto;
}

/* Гонорары (главная): при нечётном числе карточек последняя — по центру ряда */
@media (min-width: 821px) {
    .pricing-grid--centered .card-service:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 12px); /* половина ширины минус половина gap 24px — размер как у остальных */
        margin: 0 auto;
    }
}

.doc-card {
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    background: #ffffff;
    border: 1px solid rgba(29, 45, 71, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.step-card {
    padding: 28px 24px;
    background: #ffffff;
    border: 1px solid rgba(29, 45, 71, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--gold, #c9a552);
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 17px;
    font-weight: 600;
}

.step-card h3 {
    margin: 0 0 10px;
    font-family: "Cormorant Garamond", serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-dark, #1d2d47);
}

.step-card p {
    margin: 0;
    color: var(--gray-mid, #5a6472);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.doc-card__label {
    margin-bottom: 10px;
    color: var(--gold, #c9a552);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.doc-card h3 {
    margin: 0 0 8px;
    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-dark, #1d2d47);
}

.doc-card p {
    flex: 1;
    margin: 0 0 16px;
    color: var(--gray-mid, #5a6472);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    line-height: 1.55;
}

.doc-card__btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--gold, #c9a552);
    border-radius: 4px;
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.doc-card__btn:hover {
    opacity: 0.85;
}

.docs-disclaimer {
    max-width: 900px;
    margin: 22px auto 0;
    color: rgba(29, 45, 71, 0.55);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 1000px) {
    .docs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .docs-grid {
        grid-template-columns: 1fr;
    }
}

/* Сертификаты: подписи под фото */
.cert-card {
    background: #ffffff;
    border: 1px solid rgba(29, 45, 71, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.cert-card img {
    display: block;
    width: 100%;
    height: auto;
}

.cert-card figcaption {
    padding: 14px 16px;
    color: var(--gray-mid, #5a6472);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

/* Карточки сертификатов в карусели */
#certsTrack .cert-card {
    flex: 0 0 calc(50% - 12px);
    margin: 0;
}

@media (max-width: 768px) {
    #certsTrack .cert-card {
        flex: 0 0 100%;
    }
}
/* ==========================================================================
   Хлебные крошки: единый стиль для всех страниц
   (разделитель «→», ссылки — цвет текста без изменения при наведении,
   активный пункт — подчёркнут)
   ========================================================================== */
.breadcrumbs {
    padding: 16px 0;
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    background: #f7f5f0;
    border-bottom: 1px solid rgba(29, 45, 71, 0.08);
}
.breadcrumbs__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.breadcrumbs__list li {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: rgba(29, 45, 71, 0.75);
}
.breadcrumbs__list li:not(:last-child)::after {
    content: "→";
    color: var(--gold, #c9a552);
    font-size: 12px;
}
.breadcrumbs__list a {
    color: rgba(29, 45, 71, 0.75);
    text-decoration: none;
    transition: text-decoration-color 0.2s ease;
}
.breadcrumbs__list a:hover {
    color: rgba(29, 45, 71, 0.75);
    text-decoration: underline;
    text-decoration-color: var(--gold, #c9a552);
}
.breadcrumbs__list li[aria-current] {
    color: rgba(29, 45, 71, 0.75);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(29, 45, 71, 0.45);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Практика: судебные акты — расширенные карточки (страница «Об адвокате»)
   ========================================================================== */
.docs-grid--cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.doc-card__facts {
    flex: 1;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    color: var(--gray-mid, #5a6472);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    line-height: 1.55;
}
.doc-card__facts li {
    margin: 0 0 8px;
}
.doc-card__facts li:last-child {
    margin: 0;
}
.doc-card__facts strong {
    color: var(--gold, #c9a552);
    font-weight: 600;
}
@media (max-width: 900px) {
    .docs-grid--cases {
        grid-template-columns: 1fr;
    }
}

/* Форма обратной связи: поле сообщения необязательно */
.form-optional {
    font-weight: 400;
    opacity: 0.6;
    font-size: 13px;
}
.form-helper {
    margin-top: 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: var(--gray-mid, #5a6472);
    line-height: 1.5;
}

/* ==========================================================================
   Главная: цифра «130+» рядом с текстом об адвокате
   ========================================================================== */
.focus-block {
    display: flex;
    align-items: center;
    gap: 56px;
}
.focus-stat {
    flex: 0 0 auto;
    min-width: 230px;
    text-align: center;
}
.focus-stat__number {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 96px;
    line-height: 1;
    color: var(--gold, #c9a552);
}
/* Длинное число («С 2000 года»): 96px не влезает в колонку рядом с текстом */
.focus-stat__number--long {
    font-size: 64px;
    line-height: 1.1;
    white-space: nowrap;
}
.focus-stat__label {
    display: block;
    margin-top: 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-mid, #5a6472);
}
/* intro-lead внутри focus-block: слева, без автоподцентровки */
.intro-lead--side {
    max-width: 720px;
    margin: 0;
    text-align: left;
}

/* Карточка «Банкротство» на странице «Виды правовой помощи»: на всю
   ширину сетки, оформление — как у остальных карточек */
.card-service--wide {
    grid-column: 1 / -1;
}
.card-service--wide p {
    max-width: 860px;
}

/* Процесс из 4 шагов: полный ряд из 4 колонок вместо пятой пустой ячейки
   базовой сетки .process-steps (брейкпоинты повторены — custom.css
   подключается после responsive.css) */
.process-steps--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
    .process-steps--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .process-steps--4 { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .focus-block {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    .intro-lead--side {
        margin: 0 auto;
        text-align: center;
    }
    .focus-stat__number {
        font-size: 72px;
    }
    .focus-stat__number--long {
        font-size: 52px;
    }
}


/* ===== 15. Выделение рассрочки в прайсовых блоках ===== */

/* <strong> внутри лёгкого текста (weight 300) даёт bolder=400 — без
   визуальной жирности; задаём явно: полужирный тёмно-синий, в тон .price */
.card-service p strong,
.pricing-table td strong {
    font-weight: 600;
    color: var(--dark-blue);
}


/* Гоча (повтор квиза): display:flex на элементе перебивает UA-правило
   [hidden] — гасим явно все скрываемые части чата */
.chat-panel[hidden],
.chat-start[hidden],
.chat-input[hidden],
.chat-offline[hidden] {
  display: none;
}

/* ===== 16. Живой чат (этап 2 плана docs/plan-zhivogo-chata.md) ===== */

/* Контейнер: свой fixed-слой (не внутри .floating-cta — не скрывается у
   формы, чат доступен всегда). Пузырь чата — над пузырём обратного звонка:
   колбэк занимает right 40 / bottom 96 от вьюпорта, чат — right 40 /
   bottom 166 (мобайл: 26 и 166+safe). */
.chat-widget {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 1003;   /* как .floating-cta: выше шапки (1000) и её слоёв */
}

.chat-bubble {
  position: absolute;
  right: 10px;     /* = right 40 от вьюпорта, вровень с пузырём колбэка */
  bottom: 136px;   /* = 166 от низа вьюпорта: 96 (колбэк) + 60 + зазор 10 */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  background: var(--gold);       /* в цвет пузыря обратного звонка (§14) */
  color: var(--dark-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(198, 166, 100, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-bubble:hover,
.chat-bubble:focus-visible {
  background: #b89551;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(198, 166, 100, 0.45);
}

/* Панель: над пузырями, тёмно-синий корпус как панель колбэка (§14),
   радиус 12, крем-текст ярусами, золотые акценты. */
.chat-panel {
  position: absolute;
  /* Ровно на месте окна обратного звонка (.callback-panel §14): панели
     никогда не открыты одновременно (события 2c<->2d), поэтому живут
     в одной точке одного размера */
  right: 80px;
  bottom: 66px;
  width: 300px;
  /* Фиксированная высота во ВСЕХ состояниях (старт/офлайн/диалог): ответ
     /chat/status подменяет контент, и без фиксации панель «прыгала» высотой
     (баг 18.10). Контент, которого нет, заменяет пустое место. */
  height: min(470px, calc(100vh - 160px));
  overflow: hidden;   /* контент не выпадает за корпус панели */
  display: flex;
  flex-direction: column;
  padding: 18px 16px 12px;
  background: var(--dark-blue);
  border: 1px solid rgba(198, 166, 100, 0.25);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.chat-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.chat-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(245, 242, 235, 0.55);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.chat-close:hover,
.chat-close:focus-visible {
  color: var(--bg-cream);
  background: rgba(255, 255, 255, 0.08);
}

/* Шапка: статус-точка (золото = онлайн, серый = офлайн) + подпись */
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 36px 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
}

.chat-head-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(198, 166, 100, 0.8);
  flex-shrink: 0;
}

.chat-head-dot.offline {
  background: rgba(245, 242, 235, 0.4);
  box-shadow: none;
}

.chat-head-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(245, 242, 235, 0.75);
}

/* Лента сообщений */
.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;      /* даёт ленте сжиматься под потолок панели и скроллиться */
  padding: 4px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 166, 100, 0.5) transparent;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.chat-msg--visitor {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 242, 235, 0.92);
  border-bottom-right-radius: 2px;
}

.chat-msg--operator {
  align-self: flex-start;
  background: rgba(198, 166, 100, 0.12);
  border: 1px solid rgba(198, 166, 100, 0.35);
  color: var(--bg-cream);
  border-bottom-left-radius: 2px;
}

.chat-msg--operator::before {
  content: "Адвокат";
  display: block;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}

.chat-msg--system {
  align-self: center;
  max-width: 95%;
  padding: 2px 8px;
  font-size: 12px;
  font-style: italic;
  color: rgba(245, 242, 235, 0.55);
  text-align: center;
}

/* Стартовый экран: имя (необязательно) + сообщение — центрируется в
   свободной высоте панели (панель фиксированной высоты) */
.chat-start {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
  min-height: 0;
  overflow-y: auto;
}

.chat-name,
.chat-textarea,
.chat-input textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: var(--bg-cream);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-name:focus,
.chat-textarea:focus,
.chat-input textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.chat-name::placeholder,
.chat-textarea::placeholder,
.chat-input textarea::placeholder {
  color: rgba(245, 242, 235, 0.45);
}

.chat-textarea {
  min-height: 96px;
  max-height: 96px;   /* фиксированная высота — поле не растягивается */
  resize: none;
}

.chat-send-start {
  padding: 13px 24px;
  background: var(--gold);
  color: var(--dark-charcoal);
  border: none;
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-send-start:hover,
.chat-send-start:focus-visible {
  background: #b89551;
  transform: translateY(-1px);
}

.chat-send-start:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* Ряд ввода в активном диалоге */
.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 8px;
}

.chat-input textarea {
  min-height: 42px;
  max-height: 110px;
  resize: none;
}

.chat-input button {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--dark-charcoal);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-input button:hover,
.chat-input button:focus-visible {
  background: #b89551;
  transform: translateY(-1px);
}

.chat-input button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Офлайн-блок (тумблер консоли выключен / вне графика) */
.chat-offline {
  flex: 1 1 auto;
  justify-content: center;
  padding: 10px 2px 2px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(245, 242, 235, 0.75);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-offline-phone {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: var(--bg-cream);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 14px;
}

.chat-offline-phone:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.chat-offline-phone::placeholder {
  color: rgba(245, 242, 235, 0.45);
}

.chat-offline-caption {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(245, 242, 235, 0.75);
}

/* Иконки мессенджеров (те же, что в футере): золото, без подчёркиваний */
.chat-offline-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.chat-offline-icons a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.chat-offline-icons a:hover,
.chat-offline-icons a:focus-visible {
  color: #d8bc82;
  background: rgba(198, 166, 100, 0.12);
}

.chat-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(245, 242, 235, 0.45);
}

.chat-note a {
  color: rgba(198, 166, 100, 0.8);
  text-decoration: underline;
}

/* Служебное состояние из script.js §2d (ошибка отправки) */
.chat-status-line {
  padding: 2px 4px;
  font-size: 12px;
  color: #FF8A80;
  text-align: center;
}

/* Мобильная панель: почти во всю ширину, над пузырями + safe-area */
@media (max-width: 768px) {
  .chat-widget {
    right: 16px;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  }

  .chat-bubble {
    right: 10px;   /* = right 26 от вьюпорта, вровень с пузырём колбэка */
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
  }

  .chat-panel {
    /* вровень с мобильной панелью колбэка (§14) */
    right: 10px;
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 32px);
    height: min(450px, calc(100vh - 230px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble,
  .chat-panel,
  .chat-input button,
  .chat-send-start {
    transition: none;
  }
}
