/* units-mobile.css - Мобильные стили для страницы Jednostki medyczne */

/* ===== ОСНОВНЫЕ МОБИЛЬНЫЕ СТИЛИ ===== */
@media (max-width: 768px) {
  
  /* Базовые исправления для горизонтального скролла */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
  }
  
  body {
    width: 100%;
  }
  
  /* Адаптация верхней панели */
  header {
    top: 15px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  .top-left-icons {
    left: 15px;
    gap: 8px;
  }
  
  .top-left-icons img,
  .top-right-icon img {
    width: 18px;
    height: 18px;
  }
  
  .main-nav {
    display: none; /* Скрываем основное меню на мобильных */
  }
  
  .top-right-icon {
    right: 15px;
  }
  
  /* Бургер-меню для мобильных */
  .burger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  .burger-line {
    width: 100%;
    height: 2px;
    background-color: #000; /* Черный цвет для контраста */
    transition: all 0.3s ease;
  }

  .burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
  }

  .burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Боковое меню */
  .side-menu {
    position: fixed;
    top: 0;
    right: 100%; /* Меню скрыто справа */
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: right 0.3s ease; /* Анимация для right */
    padding: 60px 20px 20px;
    overflow-y: auto;
  }

  .side-menu.open {
    right: 0; /* Меню появляется справа */
  }

  .side-menu nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .side-menu a {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  .close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
  }

  .overlay-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
  }

  .overlay-blur.active {
    display: block;
  }
  
  /* Адаптация секции единиц */
  .units-frame {
    padding: 80px 15px 40px 15px !important;
    margin-top: 0;
  }
  
  .units-main-title {
    font-size: 24px !important;
    text-align: center;
    margin-bottom: 25px !important;
    line-height: 1.3;
  }
  
  .units-main-title span {
    font-size: 20px !important;
    display: block;
    margin-top: 8px;
  }
  
  /* Адаптация слайдера */
  .slideshow-container {
    height: 250px !important;
    min-height: 250px !important;
    margin: 15px auto !important;
    border-radius: 8px !important;
  }
  
  .mySlides img {
    object-fit: cover !important;
  }
  
  /* Кнопка галереи */
  .gallery-button {
    bottom: 15px !important;
    right: 15px !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
  }
  
  /* Точки навигации */
  .dots-container {
    padding: 10px !important;
  }
  
  .dot {
    height: 10px !important;
    width: 10px !important;
    margin: 0 3px !important;
  }
  
  /* Адаптация описания */
  .unit-description {
    margin-top: 30px !important;
    padding: 0 !important;
  }
  
  .unit-description h2 {
    font-size: 20px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
  }
  
  .unit-description h3 {
    font-size: 18px !important;
    margin: 25px 0 15px !important;
  }
  
  .unit-description p {
    font-size: 14px !important;
    margin-bottom: 15px !important;
    text-align: left !important;
    line-height: 1.5 !important;
  }
  
  .unit-description ul {
    margin-bottom: 15px !important;
    padding-left: 15px !important;
  }
  
  .unit-description li {
    font-size: 14px !important;
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
  }
  
  /* Адаптация модального окна галереи */
  .gallery-modal.active {
    padding: 10px !important;
  }
  
  .gallery-header {
    width: 100% !important;
    padding: 15px 0 !important;
  }
  
  .gallery-title {
    font-size: 18px !important;
  }
  
  .gallery-close {
    width: 40px !important;
    height: 40px !important;
    font-size: 24px !important;
  }
  
  .gallery-content {
    width: 100% !important;
    height: 50vh !important;
  }
  
  .gallery-nav {
    padding: 0 10px !important;
  }
  
  .gallery-prev, .gallery-next {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }
  
  .gallery-thumbnails {
    width: 100% !important;
    padding: 15px 0 !important;
    gap: 8px !important;
  }
  
  .gallery-thumb {
    width: 60px !important;
    height: 45px !important;
  }
  
  /* Поиск в мобильной версии */
  .search-container.active {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 8px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  .search-input {
    width: 100% !important;
    font-size: 16px !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
  }
  
  /* Результаты поиска для мобильных */
  .search-results-panel.enhanced {
    position: fixed !important;
    top: 80px !important;
    left: 5% !important;
    width: 90% !important;
    max-height: 70vh !important;
    z-index: 1002 !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  }
  
  .search-result-item {
    padding: 12px !important;
    border-bottom: 1px solid #eee !important;
  }
  
  .result-content {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
  
  /* Дополнительные исправления для переполнения */
  * {
    max-width: 100%;
  }
  
  img, video {
    max-width: 100%;
    height: auto;
  }
}

/* ===== СКРЫТИЕ МОБИЛЬНОГО МЕНЮ В ДЕСКТОП ВЕРСИИ ===== */
@media (min-width: 769px) {
  .burger-menu,
  .side-menu,
  .overlay-blur {
    display: none !important;
  }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ ===== */
@media (max-width: 480px) {
  .units-frame {
    padding: 70px 10px 30px 10px !important;
  }
  
  .units-main-title {
    font-size: 22px !important;
  }
  
  .units-main-title span {
    font-size: 18px !important;
  }
  
  .slideshow-container {
    height: 200px !important;
    min-height: 200px !important;
  }
  
  .gallery-button {
    bottom: 10px !important;
    right: 10px !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
  }
  
  .unit-description h2 {
    font-size: 18px !important;
  }
  
  .unit-description h3 {
    font-size: 16px !important;
  }
  
  .gallery-content {
    height: 45vh !important;
  }
  
  .gallery-thumb {
    width: 50px !important;
    height: 38px !important;
  }
}

/* ===== ТЕМНАЯ ТЕМА ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
  body.dark-theme .burger-line {
    background-color: #fff; /* Белый цвет для темной темы */
  }
  
  body.dark-theme .side-menu {
    background: rgba(40, 40, 40, 0.95);
  }
  
  body.dark-theme .side-menu a {
    color: #e0e0e0;
    border-bottom-color: #444;
  }
  
  body.dark-theme .close-menu {
    color: #e0e0e0;
  }
  
  body.dark-theme .units-main-title,
  body.dark-theme .units-main-title span {
    color: #ffffff;
  }
  
  /* Темная тема для поиска */
  body.dark-theme .search-container.active {
    background: rgba(40, 40, 40, 0.95);
  }
  
  body.dark-theme .search-input {
    color: #ffffff;
  }
  
  body.dark-theme .search-results-panel.enhanced {
    background: #2d2d2d !important;
    color: #ffffff !important;
  }
  
  body.dark-theme .search-result-item {
    border-bottom-color: #444 !important;
  }
  
  body.dark-theme .result-badge {
    background: #4da3d8 !important;
    color: white !important;
  }
}