/* Адаптивный CSS для teplomagnat.ru */

/* Базовые настройки для мобильных устройств */
@media screen and (max-width: 768px) {
  /* Общие стили */
  body {
    font-size: 14px;
    line-height: 1.4;
    overflow-x: hidden;
  }
  
  /* Контейнеры */
  .container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
  }
  
  /* Шапка сайта */
  header {
    padding: 10px 0;
  }
  
  .header-top, .header-middle, .header-bottom {
    flex-direction: column;
    align-items: center;
  }
  
  .logo img {
    max-width: 150px;
    height: auto;
  }
  
  /* Навигация */
  .main-menu {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
  }
  
  .main-menu.active {
    display: block;
  }
  
  .main-menu ul {
    flex-direction: column;
    padding: 0;
  }
  
  .main-menu li {
    width: 100%;
    border-bottom: 1px solid #eee;
  }
  
  .main-menu a {
    display: block;
    padding: 12px 15px;
  }
  
  /* Кнопка меню для мобильных */
  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
  }
  
  /* Поиск в шапке */
  .header-search {
    width: 100%;
    margin: 10px 0;
  }
  
  .header-search form {
    width: 100%;
  }
  
  .header-search input {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Контакты в шапке */
  .header-contacts {
    text-align: center;
    margin: 10px 0;
  }
  
  .header-contacts .phone {
    font-size: 18px;
  }
  
  /* Корзина */
  .header-cart {
    margin: 10px 0;
  }
  
  /* Слайдер */
  .slider, .main-slider {
    height: 300px;
  }
  
  .slider-item, .slide {
    height: 300px;
  }
  
  .slider-content {
    padding: 20px;
  }
  
  .slider-title {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .slider-description {
    font-size: 14px;
    margin-bottom: 15px;
  }
  
  .slider-button {
    padding: 8px 15px;
    font-size: 14px;
  }
  
  /* Категории товаров */
  .categories, .product-categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .category-item, .product-category {
    margin-bottom: 10px;
  }
  
  /* Карточки товаров */
  .products-grid, .products-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .product-card {
    padding: 10px;
  }
  
  .product-image {
    height: 150px;
  }
  
  .product-title {
    font-size: 14px;
  }
  
  .product-price {
    font-size: 16px;
  }
  
  /* Блоки преимуществ */
  .advantages, .features {
    flex-direction: column;
  }
  
  .advantage-item, .feature-item {
    width: 100%;
    margin-bottom: 15px;
    text-align: center;
  }
  
  /* Подвал */
  footer {
    padding: 20px 0;
  }
  
  .footer-columns {
    flex-direction: column;
  }
  
  .footer-column {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  /* Формы */
  input, textarea, select {
    font-size: 16px; /* Предотвращает масштабирование в iOS */
  }
  
  /* Кнопки */
  .btn {
    padding: 10px 15px;
    font-size: 14px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  
  /* Хлебные крошки */
  .breadcrumbs {
    font-size: 12px;
    padding: 10px 0;
  }
  
  /* Заголовки страниц */
  .page-title {
    font-size: 22px;
    margin: 15px 0;
  }
  
  /* Фильтры в каталоге */
  .catalog-filters {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
  }
  
  .catalog-filters.active {
    display: block;
  }
  
  .filter-toggle {
    display: block;
    margin-bottom: 15px;
  }
  
  .close-filters {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
  }
  
  /* Таблицы */
  table {
    font-size: 12px;
  }
  
  /* Модальные окна */
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* Дополнительные адаптивные настройки для очень маленьких экранов */
@media screen and (max-width: 480px) {
  .categories, .product-categories,
  .products-grid, .products-list {
    grid-template-columns: 1fr;
  }
  
  .slider, .main-slider {
    height: 250px;
  }
  
  .slider-item, .slide {
    height: 250px;
  }
  
  .slider-title {
    font-size: 18px;
  }
  
  .page-title {
    font-size: 20px;
  }
}

/* Планшеты */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .products-grid, .products-list {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .categories, .product-categories {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .mobile-menu-toggle {
    display: none;
  }
}

/* Утилитарные классы для адаптивности */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media screen and (min-width: 769px) {
  .mobile-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }
}

/* Улучшение производительности на мобильных */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Предотвращение горизонтального скролла */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Плавная прокрутка */
html {
  scroll-behavior: smooth;
}

/* Оптимизация для сенсорных устройств */
button, a {
  min-height: 44px;
  min-width: 44px;
}

/* Улучшение читаемости текста на мобильных */
p, li, span {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}


