/* Мобильная оптимизация для сайта Софии Пузановой */

/* ============================================
   Базовые улучшения для мобильных устройств
   ============================================ */

/* Улучшение читаемости текста на мобильных */
@media screen and (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Touch-friendly элементы - минимальный размер 44x44px */
@media screen and (max-width: 768px) {
  a, button, .t-menu__link-item, .t454__list_item a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
}

/* Улучшение мобильного меню */
@media screen and (max-width: 980px) {
  .tmenu-mobile__container {
    padding: 16px 20px;
    min-height: 56px;
  }
  
  .t-menuburger {
    width: 32px;
    height: 32px;
    padding: 6px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .tmenu-mobile__imglogo {
    max-width: 140px !important;
    height: auto;
  }
  
  .t454__imglogomobile {
    max-width: 100px !important;
  }
}

/* Оптимизация шрифтов для мобильных */
@media screen and (max-width: 639px) {
  /* Заголовки */
  h1, .tn-atom h1, .t396__elem h1 {
    font-size: 32px !important;
    line-height: 1.2 !important;
  }
  
  h2, .tn-atom h2, .t396__elem h2 {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }
  
  h3, .tn-atom h3, .t396__elem h3 {
    font-size: 24px !important;
    line-height: 1.4 !important;
  }
  
  /* Основной текст */
  p, .tn-atom, .t396__elem .tn-atom {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  
  /* Меню */
  .t-menu__link-item, .t454__list_item a {
    font-size: 16px !important;
    padding: 12px 16px !important;
  }
}

/* Очень маленькие экраны (до 479px) */
@media screen and (max-width: 479px) {
  h1, .tn-atom h1, .t396__elem h1 {
    font-size: 28px !important;
  }
  
  h2, .tn-atom h2, .t396__elem h2 {
    font-size: 24px !important;
  }
  
  h3, .tn-atom h3, .t396__elem h3 {
    font-size: 20px !important;
  }
  
  p, .tn-atom, .t396__elem .tn-atom {
    font-size: 15px !important;
  }
  
  .tmenu-mobile__container {
    padding: 12px 16px;
    min-height: 52px;
  }
  
  .tmenu-mobile__imglogo {
    max-width: 120px !important;
  }
}

/* Оптимизация отступов для мобильных */
@media screen and (max-width: 768px) {
  .t396__artboard {
    padding: 20px 16px !important;
  }
  
  .t-rec {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Уменьшение больших отступов */
  section, .t-rec {
    margin-bottom: 30px !important;
  }
}

/* Оптимизация изображений для мобильных */
@media screen and (max-width: 768px) {
  img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  
  /* Изображения в портфолио */
  .t396__carrier {
    background-size: cover !important;
    background-position: center center !important;
  }
}

/* Улучшение блока "Направления" на мобильных */
@media screen and (max-width: 768px) {
  #rec1579816001 .tn-elem[data-elem-id="1763508950811"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950811"] .tn-atom {
    font-size: 42px !important;
    letter-spacing: -1px !important;
    line-height: 1.2 !important;
  }
  
  #rec1579816001 .t396__artboard {
    padding: 30px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  /* Скрытие текстов над и под картинками на мобильных */
  #rec1579816001 .tn-elem[data-elem-id="1763508950816"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950816"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950820"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950820"] {
    display: none !important;
  }
  
  /* Изменение позиционирования изображений на мобильных - между пунктами */
  #rec1579816001 .t396__elem[data-elem-id="1763508950886"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950887"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950888"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950889"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950890"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950891"] {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    margin: 20px 0 !important;
    padding: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    order: 2 !important;
    align-self: stretch !important;
    z-index: 1 !important;
  }
  
  /* Изображения внутри контейнеров */
  #rec1579816001 .t396__elem[data-elem-id="1763508950886"] img,
  #rec1579816001 .t396__elem[data-elem-id="1763508950887"] img,
  #rec1579816001 .t396__elem[data-elem-id="1763508950888"] img,
  #rec1579816001 .t396__elem[data-elem-id="1763508950889"] img,
  #rec1579816001 .t396__elem[data-elem-id="1763508950890"] img,
  #rec1579816001 .t396__elem[data-elem-id="1763508950891"] img {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  /* Пункты направлений - порядок 1 */
  #rec1579816001 .tn-elem[data-elem-id="1763508950862"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950867"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950871"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950875"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950878"],
  #rec1579816001 .tn-elem[data-elem-id="1763508950882"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950862"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950867"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950871"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950875"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950878"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950882"] {
    order: 1 !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px 0 !important;
    border-bottom: 1px solid #7e7e7e !important;
    align-self: stretch !important;
  }
  
  /* Первый пункт */
  #rec1579816001 .tn-elem[data-elem-id="1763508950862"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950862"] {
    border-top: 1px solid #7e7e7e !important;
    margin-top: 0 !important;
  }
  
  /* Изображение после первого пункта (Брендинг) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950886"] {
    order: 2 !important;
  }
  
  /* Изображение после второго пункта (Логотипы) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950887"] {
    order: 4 !important;
  }
  
  /* Изображение после третьего пункта (Презентации) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950888"] {
    order: 6 !important;
  }
  
  /* Изображение после четвертого пункта (Упаковка) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950889"] {
    order: 8 !important;
  }
  
  /* Изображение после пятого пункта (Мерч) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950890"] {
    order: 10 !important;
  }
  
  /* Изображение после шестого пункта (Печатная продукция) */
  #rec1579816001 .t396__elem[data-elem-id="1763508950891"] {
    order: 12 !important;
    margin-bottom: 0 !important;
  }
  
  /* Порядок пунктов */
  #rec1579816001 .tn-elem[data-elem-id="1763508950862"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950862"] {
    order: 1 !important;
  }
  #rec1579816001 .tn-elem[data-elem-id="1763508950867"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950867"] {
    order: 3 !important;
  }
  #rec1579816001 .tn-elem[data-elem-id="1763508950871"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950871"] {
    order: 5 !important;
  }
  #rec1579816001 .tn-elem[data-elem-id="1763508950875"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950875"] {
    order: 7 !important;
  }
  #rec1579816001 .tn-elem[data-elem-id="1763508950878"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950878"] {
    order: 9 !important;
  }
  #rec1579816001 .tn-elem[data-elem-id="1763508950882"],
  #rec1579816001 .t396__elem[data-elem-id="1763508950882"] {
    order: 11 !important;
    border-bottom: 1px solid #7e7e7e !important;
    margin-bottom: 0 !important;
  }
  
  /* Скрытие других изображений на мобильных (которые не нужны) */
  #rec1579816001 .tn-elem[data-elem-id="1763639351003"],
  #rec1579816001 .tn-elem[data-elem-id="1763639704015"],
  #rec1579816001 .tn-elem[data-elem-id="1763639396191"],
  #rec1579816001 .tn-elem[data-elem-id="1763639239852"],
  #rec1579816001 .tn-elem[data-elem-id="1763639351040"] {
    display: none !important;
  }
  
  /* Улучшение отображения пунктов на мобильных */
  #rec1579816001 .tn-elem[data-elem-id="1763508950862"] .tn-atom,
  #rec1579816001 .tn-elem[data-elem-id="1763508950867"] .tn-atom,
  #rec1579816001 .tn-elem[data-elem-id="1763508950871"] .tn-atom,
  #rec1579816001 .tn-elem[data-elem-id="1763508950875"] .tn-atom,
  #rec1579816001 .tn-elem[data-elem-id="1763508950878"] .tn-atom,
  #rec1579816001 .tn-elem[data-elem-id="1763508950882"] .tn-atom {
    font-size: 28px !important;
    line-height: 1.3 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Улучшение отображения изображений на мобильных */
  #rec1579816001 .t396__elem[data-elem-id="1763508950886"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950887"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950888"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950889"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950890"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950891"] .tn-atom {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
  
  /* Улучшение высоты контейнера на мобильных */
  #rec1579816001 .t396__artboard {
    min-height: auto !important;
    height: auto !important;
  }
  
  #rec1579816001 .t396__filter,
  #rec1579816001 .t396__carrier {
    height: auto !important;
    min-height: auto !important;
  }
}

@media screen and (max-width: 479px) {
  #rec1579816001 .tn-elem[data-elem-id="1763508950811"] .tn-atom,
  #rec1579816001 .t396__elem[data-elem-id="1763508950811"] .tn-atom {
    font-size: 32px !important;
    letter-spacing: -0.5px !important;
  }
}

/* Оптимизация hero секции на мобильных */
@media screen and (max-width: 639px) {
  #rec1573152871 .t396__artboard,
  #rec1573152871 .t396__filter,
  #rec1573152871 .t396__carrier {
    height: 400px !important;
    min-height: 400px !important;
  }
}

/* Улучшение читаемости текста поверх изображений */
@media screen and (max-width: 768px) {
  .t396__elem .tn-atom {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  }
}

/* Оптимизация форм и кнопок */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    font-size: 16px !important; /* Предотвращает zoom на iOS */
    padding: 12px 16px !important;
    min-height: 44px !important;
  }
  
  button, .t-btn, input[type="submit"] {
    min-height: 44px !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
  }
}

/* Улучшение прокрутки на мобильных */
@media screen and (max-width: 768px) {
  html {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    height: 100%;
    height: -webkit-fill-available;
  }
  
  body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Использование CSS переменной для правильной высоты на iOS */
    min-height: calc(var(--vh, 1vh) * 100);
  }
}

/* Предотвращение горизонтальной прокрутки */
@media screen and (max-width: 768px) {
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .t396__artboard,
  .t396__carrier,
  .t396__filter {
    overflow-x: hidden !important;
  }
}

/* Оптимизация таблиц для мобильных */
@media screen and (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Улучшение видимости фокуса для доступности */
@media screen and (max-width: 768px) {
  a:focus,
  button:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid #262e28;
    outline-offset: 2px;
  }
}

/* Оптимизация анимаций на мобильных (улучшение производительности) */
@media screen and (max-width: 768px) {
  * {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Отключение сложных анимаций на слабых устройствах */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* Улучшение отображения на очень маленьких экранах (iPhone SE и меньше) */
@media screen and (max-width: 374px) {
  .tmenu-mobile__container {
    padding: 10px 12px;
    min-height: 48px;
  }
  
  .tmenu-mobile__imglogo {
    max-width: 100px !important;
  }
  
  h1, .tn-atom h1 {
    font-size: 24px !important;
  }
  
  h2, .tn-atom h2 {
    font-size: 20px !important;
  }
  
  #rec1579816001 .tn-elem[data-elem-id="1763508950811"] .tn-atom {
    font-size: 28px !important;
  }
}

/* Оптимизация для планшетов (портретная ориентация) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .t396__artboard {
    padding: 30px 24px !important;
  }
  
  h1, .tn-atom h1 {
    font-size: 36px !important;
  }
  
  h2, .tn-atom h2 {
    font-size: 30px !important;
  }
}

/* Улучшение для планшетов (ландшафтная ориентация) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .t396__artboard {
    padding: 40px 32px !important;
  }
}

/* Оптимизация для устройств с высоким DPI */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Улучшение работы с клавиатурой на мобильных */
@media screen and (max-width: 768px) {
  /* Предотвращение zoom при фокусе на input (iOS Safari) */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Оптимизация для темной темы (если поддерживается) */
@media (prefers-color-scheme: dark) {
  @media screen and (max-width: 768px) {
    /* Сохраняем светлую тему, но можно добавить темную при необходимости */
  }
}

