/* ===================================
   CUSTOM.CSS - Кастомизация под проект
   Специфичные стили, которые не вошли в другие файлы
====================================== */
/* =======================================
   СТИЛИ ШАПКИ (HEADER)
   ======================================= */

/* --- 1. Общие настройки --- */
.navigation-bar.fixed-top {
    /* Фон здесь НЕ задаем, он управляется классами .bg-white или .navbar-transparent */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- 2. Стили для БЕЛОЙ шапки (внутренние страницы) --- */
/* Этот класс добавляется PHP-кодом на внутренних страницах */
.navigation-bar.bg-white {
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    border-bottom: 1px solid #f0f0f0;
}

/* Логотип */
.navbar-brand .logo-img {
    max-height: 65px;
    width: auto;
}

/* --- 3. Верхний этаж (Контакты) --- */
.header-top-row {
    border-bottom-color: #e9ecef !important;
}

/* Телефон */
.phone-link {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.3px;
    transition: color 0.2s;
}
.phone-link:hover {
    color: var(--color-primary, #007bff) !important;
}

/* Эффект наведения на соцсети */
.hover-100 { transition: opacity 0.2s; }
.hover-100:hover { opacity: 1 !important; }

/* --- 4. Нижний этаж (Меню) --- */
.header-menu-row ul {
    margin-bottom: 0;
    padding-left: 0;
    display: flex;
    gap: 30px;
    list-style: none;
}

.header-menu-row ul li a {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    color: #222;
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

/* Подчеркивание при наведении */
.header-menu-row ul li a:hover,
.header-menu-row ul li.active a {
    color: var(--color-primary, #007bff);
    border-bottom-color: var(--color-primary, #007bff);
    background: none;
}

/* Скрываем лишнюю кнопку в меню */
.header-menu-row .btn-appointment {
    display: none !important;
}

/* =======================================
   ПРОЗРАЧНАЯ ШАПКА (ГЛАВНАЯ)
   Перебивает стили белой шапки
   ======================================= */

header.navbar-transparent,
header.navbar-transparent .navbar,
header.navbar-transparent .navbar-wrapper {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Цвет разделительной линии (полупрозрачный белый) */
header.navbar-transparent .header-top-row {
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

/* Белый текст меню */
header.navbar-transparent .header-menu-row ul li a {
    color: #ffffff !important;
}
header.navbar-transparent .header-menu-row ul li a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

/* Белые иконки и телефон */
header.navbar-transparent .phone-link,
header.navbar-transparent .bi {
    color: #fff !important;
}

/* Белый гамбургер (мобильное меню) */
header.navbar-transparent .sidemenu_btn span {
    background-color: #fff;
}

/* ===================================
   4. БЛОГ / ПОСТЫ
====================================== */

/* Сетка постов */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Карточка поста */
.instagram-post {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.instagram-post:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Контейнер медиа (16:9) */
.post-media-container,
.post-slider {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #000;
  overflow: hidden;
}

.post-media,
.post-video,
.grid-slide-img,
.video-wrapper.preview,
.video-wrapper.preview iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  margin: 0;
}

/* Стрелки слайдера */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  font-size: 18px;
  padding: 0;
  transition: background 0.2s;
}

.slider-arrow:hover { 
  background: rgba(0, 0, 0, 0.8); 
}

.slider-arrow.left { left: 10px; }
.slider-arrow.right { right: 10px; }

/* Инфо-блок под фото */
.post-info { 
  padding: 12px 16px; 
}

.post-title { 
  font-weight: 600; 
  margin-bottom: 6px; 
  font-size: 1.05rem; 
}

.post-content { 
  text-align: left !important; 
  display: none; 
}

.show-more {
  color: #3897f0;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.show-more::after {
  content: '↓';
  font-size: 12px;
  transition: transform 0.3s ease;
}

.show-more.open::after {
  transform: rotate(180deg);
}

/* Кнопка "Загрузить ещё" */
#load-more-container { 
  margin-top: 30px; 
  margin-bottom: 20px; 
}

#load-more-btn { 
  min-width: 160px; 
  border-radius: 20px; 
}

/* ===================================
   5. МОДАЛЬНОЕ ОКНО БЛОГА
====================================== */

/* Базовые настройки */
#blogModal {
  padding-right: 0 !important;
  overflow: hidden !important;
}

#blogModal .modal-dialog {
  position: relative !important;
  margin: 1.75rem auto !important;
  width: 70vw !important;
  max-width: 1000px !important;
  min-width: 350px;
  height: calc(100% - 3.5rem) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  pointer-events: none;
}

#blogModalContent {
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 20px 40px 50px !important;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
  background: #fff;
  white-space: pre-wrap;
  width: 100%;
  display: block !important;
}

/* Адаптив */
@media (max-width: 768px) {
  #blogModal .modal-dialog {
	width: 95vw !important;
	margin: 10px auto !important;
	height: calc(100% - 20px) !important;
  }
}

/* Шапка */
#blogModal .modal-header {
  flex-shrink: 0;
  padding: 20px 25px 15px 25px;
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#blogModal .modal-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: #000;
  text-align: left;
}

/* Тело (скролл тут) */
#blogModal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 !important;
  display: block !important;
  text-align: left !important;
}

#blogModalMedia {
  width: 100%;
  background: #fff;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center;
  align-items: flex-start;
  min-height: 0 !important;
}

/* Одиночные картинки */
#blogModalMedia > img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: 60vh !important;
  object-fit: contain !important;
  background: #fff;
  margin: 0 auto;
}

/* Контейнер слайдера */
.post-slider-modal {
  width: 100%;
  height: 55vh !important;
  background: #fff !important;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.post-slider-modal img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Видео - исключение */
#blogModalMedia:has(.video-wrapper),
#blogModalMedia:has(video) {
  background: #000 !important;
  display: flex; justify-content: center;
}

#blogModalMedia .video-wrapper { width: 100%; }

/* Текст */
#blogModalContent {
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 30px 40px 50px !important;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
  background: #fff;
  white-space: pre-wrap;
  width: 100%;
  display: block !important;
}

#blogModalContent p {
  margin-bottom: 0rem !important;
  margin-top: 0 !important;
}

#blogModalContent ul,
#blogModalContent ol {
  margin-bottom: 0.7rem !important;
}

#blogModalContent h2,
#blogModalContent h3,
#blogModalContent h4 {
  margin-top: 1.2rem !important;
  margin-bottom: 0.5rem !important;
}

/* Стрелки */
.slider-arrow, .slider-prev, .slider-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.1) !important;
  color: #333 !important; border-radius: 50%; border:none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.post-slider .grid-slide-img {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
  object-fit: contain !important;
  background: #fff;
}

/* ===================================
   6. КОММЕНТАРИИ
====================================== */

/* Список комментариев */
.comment {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 12px;
  background: #f8f9fa;
  display: flex;
  gap: 12px;
}

.avatar-placeholder, .avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e9ecef;
  color: #555;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  object-fit: cover;
}

.comment-body { flex: 1; }

.comment-author { 
  font-weight: 600; 
  font-size: 0.95rem; 
  color: #000; 
}

.comment-date { 
  font-size: 0.8rem; 
  color: #888; 
  margin-left: 8px; 
  font-weight: normal; 
}

.comment-text { 
  margin-top: 4px; 
  font-size: 0.95rem; 
  line-height: 1.4; 
  color: #333; 
}

/* Шторка для мобильных комментариев */
#commentsModalMobile {
  z-index: 10000;
}

#commentsModalMobile .modal-dialog-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 85vh;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

#commentsModalMobile .modal-dialog-bottom.show { 
  transform: translateY(0); 
}

#commentsModalMobile .modal-content {
  height: 100%;
  border-radius: 20px 20px 0 0;
  border: none;
  display: flex;
  flex-direction: column;
}

#commentsModalMobile .modal-header {
  flex-shrink: 0;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  position: relative;
  justify-content: center;
}

.modal-swipe-indicator {
  width: 40px; height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
}

#mobileCommentsContent {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  padding-bottom: 80px;
}

/* Форма отправки */
.comment-form-mobile {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  padding: 10px;
  border-top: 1px solid #eee;
  z-index: 10;
}

.mobile-comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f2f6;
  border-radius: 24px;
  padding: 4px 4px 4px 15px;
}

.mobile-comment-form textarea {
  flex: 1;
  border: none;
  background: transparent;
  height: 40px;
  padding: 8px 0;
  resize: none;
  outline: none;
  font-size: 14px;
}

.mobile-comment-form button[type="submit"] {
  border: none;
  background: #3897f0;
  color: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
}

.emoji-button {
  background: none; 
  border: none; 
  font-size: 20px; 
  cursor: pointer; 
  padding: 0 8px;
}

.auth-message {
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  width: 100%;
  padding: 8px;
}

/* ===================================
   7. ПЕРЕОПРЕДЕЛЕНИЯ СТИЛЕЙ
====================================== */

/* Кастомизация кнопки "Наверх" */
.back-to-top {
  width: 60px !important;
  height: 60px !important;
  line-height: 56px !important;
  border-radius: 50%;
  text-align: center;
  display: none;
  position: fixed !important;
  bottom: 20px !important;
  right: 5px !important;
  z-index: 9980 !important;
  background-color: #677fa8;
  border: 2px solid #677fa8;
  font-size: 24px;
  color: #fff !important;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.back-to-top:hover {
  background-color: #677fa8;
  border-color: #677fa8;
  transform: translateY(-3px);
}

.back-to-top i {
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.back-to-top:hover i {
  animation: toTopFromBottom 0.5s forwards;
}

@keyframes toTopFromBottom {
  49% { transform: translateY(-100%); }
  50% { opacity: 0; transform: translateY(100%); }
  51% { opacity: 1; }
  100% { transform: translateY(0); }
}

/* Кастомизация виджета связи */
.contact-widget {
  position: fixed !important;
  bottom: 95px !important;
  right: 5px !important;
  z-index: 9999 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 60px;
}

.main-contact-btn {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50%;
  background: #677fa8;
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  z-index: 2;
}

.main-contact-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: inherit;
  z-index: -1;
  animation: pulse-ring 4s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.contact-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  margin-bottom: 5px;
  align-items: center;
}

.contact-widget.active .contact-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.contact-btn {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: white !important;
  text-decoration: none;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.contact-btn:hover { 
  transform: scale(1.1); 
}

/* Брендовые цвета */
.contact-btn.telegram { background: #229ED9; }
.contact-btn.whatsapp { background: #25D366; }
.contact-btn.email { background: #fd7e14; }
.contact-btn.phone { background: #dc3545; }

/* ===================================
   8. ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
====================================== */

/* Точки навигации */
#sliderDots {
  z-index: 10;
}

#sliderDots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
}

#sliderDots .dot.active {
  background: #fff;
  transform: scale(1.2);
}
