/**
 * Локальные override-стили поверх готовой темы dentacare.
 * Здесь живут небольшие правки, которые не хочется впихивать в чужие файлы темы.
 *
 * - расширение container на больших экранах
 * - стиль иконок-кнопок в шапке (a11y, телефон)
 * - тонкие правки навбара
 */

/* ====== КОНТЕЙНЕР НА ШИРОКИХ ЭКРАНАХ ====== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}
@media (min-width: 1600px) {
  .container {
    max-width: 1440px;
  }
}

/* ====== NAVBAR — иконки-кнопки справа ====== */
.a11y-trigger-btn,
.navbar-phone-icon,
.navbar-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  color: #555;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.a11y-trigger-btn:hover,
.a11y-trigger-btn:focus,
.navbar-phone-icon:hover,
.navbar-phone-icon:focus,
.navbar-search-icon:hover,
.navbar-search-icon:focus {
  border-color: var(--primary, #1abc9c);
  color: var(--primary, #1abc9c);
  background: rgba(26, 188, 156, 0.08);
  text-decoration: none;
}

.a11y-trigger-btn i,
.navbar-phone-icon i,
.navbar-search-icon i {
  font-size: 1.05rem;
  line-height: 1;
}

/* Активное состояние — когда панель открыта */
.a11y-trigger-btn[aria-expanded="true"] {
  background: var(--primary, #1abc9c);
  border-color: var(--primary, #1abc9c);
  color: #fff;
}

/* ====== NAVBAR — общие правки ====== */
#mainNav .navbar-nav .nav-link {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  white-space: nowrap;
}

#mainNav .navbar-phone {
  font-weight: 600;
  color: #2f2f2f;
  text-decoration: none;
  white-space: nowrap;
}

#mainNav .navbar-phone:hover {
  color: var(--primary, #1abc9c);
}

#mainNav .nav-cta-btn {
  white-space: nowrap;
}

/* На мобильных меню-навигации делаем спокойнее */
@media (max-width: 1199px) {
  #mainNav .navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
  }
  #mainNav .navbar-nav .nav-item {
    text-align: left;
  }
  #mainNav .nav-cta {
    margin-top: 0.5rem;
  }
}

/* ====== NAVBAR на узких экранах ====== */
/* У .navbar bootstrap'а встроенный padding 0.5rem 1rem; он СУММИРУЕТСЯ с padding
   .container (15px) — итого гамбургер уезжает на 31px от viewport, а контент
   в col остаётся на 15px. Обнуляем navbar-padding, чтобы остался только
   container-padding 15px — как у hero-кнопок. */
#mainNav.navbar {
  padding-left: 0;
  padding-right: 0;
}

/* Гарантированно показать гамбургер на мобильных, прибит к верху navbar
   (а не к container — иначе когда меню раскрывается, container высокий
   и absolute top:50% уезжает на середину раскрытого списка). */
@media (max-width: 1199.98px) {
  #mainNav.navbar { position: fixed; }
  #mainNav .container { position: static; }
  #mainNav .navbar-toggler {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    right: 15px;
    top: 11px;
    transform: none;
    z-index: 1031;
    background: #f5f5f5 !important;
    border: 2px solid #d0d0d0 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    width: 44px !important;
    height: 44px !important;
  }
  #mainNav .navbar-toggler .navbar-toggler-icon {
    width: 22px !important;
    height: 22px !important;
    display: inline-block;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  /* Контейнер с иконками справа — чтобы под гамбургер не лезли  */
  #mainNav .container > .d-flex.ml-auto { padding-right: 56px; }

  /* «Записаться» в открытом мобильном меню — как обычный пункт,
     без яркой синей плашки (иначе кажется, что ты на этой вкладке) */
  #mainNav .nav-cta .btn-cta {
    background: transparent !important;
    color: var(--text, #2f2f2f) !important;
    border-radius: 0 !important;
    padding: 8px 15px !important;
    font-weight: 500 !important;
  }
  #mainNav .nav-cta .btn-cta:hover,
  #mainNav .nav-cta .btn-cta:focus {
    background: transparent !important;
    color: var(--primary, #2196F3) !important;
  }
}

/* Защита от горизонтального overflow на мобильных — иначе элементы
   navbar могут уехать за viewport и гамбургер становится «невидимым». */
html, body { max-width: 100vw; overflow-x: hidden; }

/* Заголовки на мобильных принудительно переносим по словам/символам
   (длинные слова типа «Действующие», «консультация», «Свидетельство»
   уходили за правый край). */
@media (max-width: 767.98px) {
  h1, h2, h3, h4, h5, h6,
  .h1, .h2, .h3, .h4, .h5, .h6,
  .section-title, .page-hero__title {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  /* На xs запрещаем картинкам и прочим «жёстким» блокам выходить за viewport */
  img, table, pre, iframe, video {
    max-width: 100%;
    height: auto;
  }
}
@media (max-width: 575.98px) {
  #mainNav .navbar-brand {
    margin-right: 8px !important;
    padding-top: 0;
    padding-bottom: 0;
  }
  #mainNav .navbar-brand img {
    height: 30px !important;
    width: auto;
  }
  #mainNav .navbar-toggler {
    flex-shrink: 0;
    padding: 6px 10px;
    margin-right: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
  }
  #mainNav .navbar-toggler-icon {
    width: 1.2em;
    height: 1.2em;
  }
}

/* JS-fallback подстраховка: если CSS-селектор не сработает,
   класс на body хотя бы помечает состояние */
body.site-notice-active .sticky-cta { display: none !important; }

/* ====== COOKIE / SITE NOTICE ======
   Поверх sticky-cta (z-index выше), на мобиле — текст и кнопка
   в один ряд, кнопка не убегает за край. */
.site-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;                     /* выше sticky-cta (1050) */
  background: #fff;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
}
.site-notice__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-notice__text {
  flex: 1;
  font-size: 0.8rem;
  line-height: 1.35;
}
.site-notice__btn {
  flex-shrink: 0;
  white-space: nowrap;
}
/* Пока виден notice — прячем sticky-cta, чтобы не накладывались */
body.site-notice-active .sticky-cta { display: none !important; }

@media (max-width: 575.98px) {
  .site-notice { padding: 10px 0; }
  .site-notice__row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .site-notice__text { font-size: 0.78rem; }
  .site-notice__btn {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
  }
}

/* ====== Адаптивные таблицы «ключ-значение» ======
   Класс .table-mobile-stack превращает обычную table на xs в блоковый
   layout: каждая строка — отдельный блок «label сверху → value снизу».
   Используется в /svedeniya/ для реквизитов и других подобных мест. */
@media (max-width: 575.98px) {
  .table-mobile-stack thead { display: none; }
  .table-mobile-stack tbody,
  .table-mobile-stack tr { display: block; }
  .table-mobile-stack tr {
    padding: 14px 0;
    border-bottom: 1px solid #e8e8e8;
  }
  .table-mobile-stack tr:last-child { border-bottom: 0; }
  .table-mobile-stack th,
  .table-mobile-stack td {
    display: block;
    padding: 0;
    border: 0;
    width: 100% !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .table-mobile-stack th {
    color: #777;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
  }
  .table-mobile-stack td {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

/* ====== AKCII — список позиций акции ====== */
.promo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.promo-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e5e5;
}
.promo-list__item:last-child { border-bottom: 0; }
.promo-list__name {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}
.promo-list__price {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.promo-list__price-old {
  color: #999;
  text-decoration: line-through;
  font-size: 0.9em;
}
.promo-list__price-new {
  color: var(--primary, #2196F3);
  font-weight: 700;
  font-size: 1.15em;
}
@media (max-width: 575.98px) {
  .promo-list__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .promo-list__price {
    text-align: left;
    align-self: flex-end;
  }
  .promo-list__price-new { font-size: 1.25em; }
}

/* ====== СЕКЦИЯ STATS (крупные цифры) ====== */
.stats-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary, #1abc9c) 0%, #16a085 100%);
  color: #fff;
}
.stats-item {
  padding: 1rem 0.5rem;
}
.stats-num {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.stats-num span {
  font-size: 2.2rem;
  vertical-align: top;
  margin-left: 2px;
  opacity: 0.85;
}
.stats-label {
  font-size: 0.95rem;
  opacity: 0.92;
  text-transform: lowercase;
  line-height: 1.3;
}
@media (max-width: 575.98px) {
  .stats-num { font-size: 2.4rem; }
  .stats-num span { font-size: 1.5rem; }
  .stats-label { font-size: 0.82rem; }
}

/* ====== HERO — усиление CTA + trust-бар ====== */
/* Стили layout .hero-actions живут в theme.css (column on desktop, row on mobile).
   Здесь — только косметика кнопок. */
.hero-actions .btn {
  white-space: normal;
  word-break: break-word;
}
.hero-actions .btn-primary {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-weight: 600;
}
.hero-trust-bar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.hero-trust-bar .trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #444;
  font-size: 0.92rem;
  font-weight: 500;
}
.hero-trust-bar .trust-item i {
  color: var(--primary, #1abc9c);
  font-size: 1.3rem;
}
@media (max-width: 767.98px) {
  .hero-trust-bar .trust-item {
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
  }
}

/* ====== СЕКЦИЯ "ОТЗЫВЫ + РАССРОЧКА" (объединённая) ====== */
.reviews-installment-section .installment-card {
  background: linear-gradient(135deg, var(--primary, #1abc9c) 0%, #16a085 100%);
  color: #fff;
  padding: 2rem;
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(26, 188, 156, 0.25);
}
.reviews-installment-section .installment-card h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 700;
}
.reviews-installment-section .installment-card .price-from {
  font-size: 2.2rem;
  font-weight: 700;
  display: block;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}
.reviews-installment-section .installment-card .price-from small {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
}
.reviews-installment-section .installment-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.reviews-installment-section .installment-card ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.reviews-installment-section .installment-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
}
.reviews-installment-section .review-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary, #1abc9c);
}
.reviews-installment-section .review-card .review-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}
.reviews-installment-section .review-card .review-author {
  font-weight: 600;
  color: #333;
}
.reviews-installment-section .review-card .review-rating {
  color: #f5a623;
}

/* ====== CTA-FINAL — финальный сильный блок ====== */
.cta-final-section {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  color: #fff;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.cta-final-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(26, 188, 156, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.cta-final-section h2 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
}
.cta-final-section .cta-lead {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 1.5rem;
}
.cta-final-section .cta-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.cta-final-section .cta-features li {
  padding-left: 2rem;
  position: relative;
  margin-bottom: 0.7rem;
  font-size: 1rem;
}
.cta-final-section .cta-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--primary, #1abc9c);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.4rem;
}
.cta-final-section .cta-form-card {
  background: #fff;
  color: #333;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.cta-final-section .cta-form-card h3 {
  color: #333;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-final-section .cta-form-card .text-muted {
  font-size: 0.9rem;
}

/* Описание услуги под названием в таблице прайса и в «Популярных услугах».
   Стиль = как строка врача в акции на главной (.promo-block__doctor). */
.price-item__desc {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: #888;
  line-height: 1.4;
  font-weight: normal;
}

/* Пояснение «что входит в бесплатную консультацию».
   Подключается компонентом includes/components/free-consult-note.php
   в hero, cta-final и модалке записи, чтобы не было ложного ожидания
   что бесплатно — полная диагностика. */
.free-consult-note {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.45;
  margin-top: 12px;
  margin-bottom: 0;
}
.free-consult-note strong {
  color: #28a745;        /* зелёный «бесплатно» — как плашка в прайсе */
  font-weight: 700;
}
/* Inline-вариант — под кнопками в hero. Оформлен как .hero-features span:
   полупрозрачная белая плашка с тёмным текстом, чтобы читалось поверх
   фонового фото и гармонировало с trust-фичами выше. */
.hero-actions + .free-consult-note--inline {
  display: inline-block;
  max-width: 640px;
  color: #333;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.hero-actions + .free-consult-note--inline strong {
  color: #1f8a3a;        /* насыщенный зелёный — заметно на белой плашке */
}
/* Box-вариант — с лёгкой подложкой в cta-final/модалке. */
.free-consult-note--box {
  padding: 10px 14px;
  background: #f3f8f5;
  border-left: 3px solid #28a745;
  border-radius: 4px;
}
