/* ============================================================
   NotFace — ПОЛНАЯ МОБИЛЬНАЯ ВЕРСИЯ (переопределяет десктопный макет)
   Подключается через media-запрос на экранах ≤ 768px
   ============================================================ */

@media (max-width: 768px) {

  /* ---------- База ---------- */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  body {
    font-size: 16px;
  }
  .container {
    margin: 0;
    min-height: auto;
  }
  .wrapper {
    max-width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
  }

  /* ---------- Шапка (современный адаптив) ---------- */
  .topline,
  .line {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }
  .topline {
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    padding: 0 !important;
  }
  .topline .wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-height: 44px;
  }
  .logo {
    float: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    transform: scale(0.8) !important;
    transform-origin: left center !important;
  }
  .entrance {
    float: none !important;
    flex: 0 1 auto !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .entrance a {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    padding: 6px 10px !important;
    border-radius: 16px !important;
    text-decoration: none !important;
  }
  /* «Зарегистрироваться» — акцентная кнопка-пилюля */
  .entrance a.register {
    background: #fff !important;
    color: #d32f52 !important;
    font-weight: bold !important;
  }
  .entrance a.enter {
    color: #fff !important;
  }
  /* Авторизованный пользователь — компактно */
  .authorized-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    max-width: 130px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .authorized-user img {
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 auto !important;
  }
  .exit {
    font-size: 12px !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
  }

  /* ---------- Главный экран (промо) ---------- */
  .promo {
    height: auto !important;
    min-height: 0 !important;
    padding: 40px 0 !important;
  }
  .promo .wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    max-width: 100% !important;
    position: static !important;
  }
  .main_page .promo .wrapper {
    height: auto !important;
  }
  .slogan {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .slogan-text {
    width: 100% !important;
    text-align: center !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9) !important;
  }
  .slogan-text span,
  .slogan-text h1,
  .slogan h1 {
    font-size: 26px !important;
    line-height: 34px !important;
    display: block !important;
    margin: 0 auto !important;
    padding-bottom: 10px !important;
  }
  .slogan .button,
  .promo .button {
    display: inline-block !important;
    width: auto !important;
    margin: 20px auto 0 !important;
    padding: 15px 50px !important;
  }
  /* Люди (мужчина и женщина) — показываем на мобильном как фон промо */
  .bg-people {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: 180px !important;
    max-width: 320px !important;
    margin: 12px auto 28px !important;
    background: url("../images/men_1.png") no-repeat center bottom !important;
    background-size: contain !important;
    order: 5 !important;
  }
  .pic_2 .bg-people {
    background-image: url("../images/men_2.png") !important;
  }
  /* Возвращаем привлекающую картинку, но без обрезки и двоения */
  .promo-wrap,
  .promo-bg,
  .pic_1 .promo-bg,
  .pic_2 .promo-bg {
    background: none !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .promo {
    background: linear-gradient(to bottom, #eaf5ee 0%, #e4f1e9 55%, #fcfbf9 100%) !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 28px 0 0 !important;
  }
  .promo .wrapper {
    flex-direction: column !important;
  }

  /* Основная секция — убираем огромный нижний отступ (186px) и боковые */
  .main {
    padding-top: 24px !important;
    padding-bottom: 40px !important;
  }
  .main .wrapper {
    padding: 0 16px !important;
  }

  /* ---------- Двухколоночный макет → одноколоночный ---------- */
  .wrapper.tabs {
    display: flex !important;
    flex-direction: column;
  }
  .wrapper.tabs > aside {
    width: 100% !important;
    float: none !important;
    order: 0;
    margin: 0;
  }
  .wrapper.tabs > .content {
    width: 100% !important;
    float: none !important;
    order: 1;
    min-height: 0;
    border-left: none !important;
    border-right: none !important;
  }

  /* ---------- Меню вкладок — горизонтальный скролл ---------- */
  .tabs-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px !important;
    margin: 0;
    gap: 8px;
    background: #f7f4ef;
    white-space: nowrap;
  }
  .tabs-menu li {
    display: inline-block;
  }
  .tab {
    padding: 8px 16px !important;
    border: 1px solid #e2ddd4 !important;
    border-radius: 20px !important;
    background: #fff;
    font-size: 14px !important;
    flex: 0 0 auto;
  }
  .tab a {
    text-decoration: none;
    color: #2e2e2e;
  }
  .tab.current {
    background: #d32f52 !important;
    border-color: #d32f52 !important;
  }
  .tab.current a {
    color: #fff !important;
  }
  .tab.current:after {
    display: none !important;
  }

  /* ---------- Карточки совпадений — одна колонка ---------- */
  .result-profiles {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    margin: 0 !important;
  }
  .result-profile {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
  }
  .result-profile .profile-pic img {
    width: 100%;
    height: auto;
  }

  /* ---------- Страница вопроса ---------- */
  .question-area {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
  }
  .question-pic,
  .question {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
  }
  .question-pic img {
    width: 100% !important;
    height: auto !important;
    max-height: 240px;
    object-fit: cover;
  }
  .question-text {
    font-size: 17px;
    line-height: 1.45;
    padding: 0 !important;
  }
  .answer-buttons {
    flex-wrap: wrap;
    gap: 10px !important;
  }
  .answer-buttons .button_red {
    width: 100%;
    text-align: center;
  }

  /* ---------- Формы ---------- */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important; /* 16px = без автозума на iOS */
    height: auto;
    padding: 10px !important;
    margin: 4px 0 10px;
  }

  /* ---------- Попапы ---------- */
  .popup {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 90vh;
    left: 50%;
  }
  .popup-container {
    padding: 16px;
  }
  .popup-title {
    font-size: 18px;
    padding-right: 40px;
  }

  /* ---------- Кнопки ---------- */
  .button_red,
  .btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 12px !important;
    height: auto !important;
    line-height: 1.3 !important;
  }

  /* ---------- Мессенджер ---------- */
  .messenger {
    flex-direction: column;
    height: auto;
  }
  .dialogs-list {
    width: 100% !important;
    flex: none !important;
    max-height: 220px;
  }
  .chat-panel {
    min-height: 380px;
  }
  .chat-messages .message {
    max-width: 85% !important;
  }

  /* ---------- Профиль ---------- */
  .profile-photo,
  .profile-info,
  .profile-main,
  .profile-matches,
  .profile-buttons {
    width: 100% !important;
    float: none !important;
    flex: none !important;
    text-align: left !important;
    margin-bottom: 10px;
  }
  .profiles-container,
  .photos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ---------- Футер ---------- */
  footer .wrapper {
    padding: 12px;
  }
  footer .menu ul {
    padding: 0;
  }
  footer .menu ul li {
    width: 100%;
    float: none;
    margin: 4px 0;
  }
  .socials {
    margin-top: 10px;
  }

  /* ---------- Таблицы / широкие блоки ---------- */
  table,
  .q-table,
  .table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
  .b-carousel {
    max-width: 100%;
    overflow: hidden;
  }
}

/* ============================================================
   ПОРТРЕТНЫЕ ТЕЛЕФОНЫ (≤480px) — агрессивный сброс жёстких ширин
   ============================================================ */
@media (max-width: 480px) {

  /* Универсально: блоки с фиксированной шириной растягиваем на весь экран */
  .content,
  .concept,
  .concept-text,
  .concept .preview,
  .fill-form,
  .profile-information,
  .about-block,
  .about-content,
  .description,
  .my-information,
  .user-photos-wrap,
  .photos-container,
  .search-options,
  .search-result,
  .info-block,
  .inform,
  .enter-form,
  .registration-form,
  .result-profiles,
  .q-list,
  .info-table,
  .question-view {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Контейнеры и врапперы — без вылезания */
  .wrapper,
  .container,
  .inner-wrap,
  .wrap,
  .pane .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }

  /* Внутренние карточки/блоки с float */
  .concept,
  .concept-text,
  .concept .preview {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Картинки преимуществ на главной — по центру */
  .conception {
    display: flex !important;
    flex-direction: column !important;
    gap: 36px !important;
  }
  .concept {
    width: 100% !important;
    float: none !important;
    padding-top: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .concept .preview {
    width: 100% !important;
    float: none !important;
    text-align: center;
    margin: 0 0 12px 0 !important;
    order: 2 !important;
  }
  .concept-text {
    width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-top: 0 !important;
    text-align: center;
    order: 1 !important;
  }
  .concept .preview img {
    display: inline-block;
    margin: 0 auto;
  }
  .concept-text .title {
    text-align: center;
  }
  .concept-text p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
  .concept .arrow {
    display: none;
  }

  /* Текстовые блоки — нормальный перенос */
  .slogan-text,
  .about-text,
  .description,
  .title {
    width: 100% !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .slogan-text span,
  .slogan-text h1,
  .slogan h1 {
    font-size: 22px !important;
    line-height: 30px !important;
  }

  /* Изображения не вылезают */
  img,
  .promo-bg,
  .bg-people,
  .b-slide img,
  .slide-pic img {
    max-width: 100% !important;
  }

  /* Поля форм — крупные, без автозума */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  input[type="number"],
  textarea,
  select {
    width: 100% !important;
    font-size: 16px !important;
    padding: 11px !important;
    margin: 6px 0 12px !important;
    box-sizing: border-box !important;
    height: auto !important;
  }

  /* Заголовки — читаемый размер */
  h1, h2, h3, .h1, .h2, .h3 {
    font-size: 18px !important;
    line-height: 1.35 !important;
  }

  /* Кнопки — на весь ряд, крупная зона нажатия */
  .button,
  .button_red,
  .btn,
  .submit,
  button[type="submit"],
  a.button {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 13px 16px !important;
    font-size: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Шапка — ещё компактнее на узких экранах */
  .topline .wrapper {
    padding: 6px 8px !important;
    min-height: 40px;
  }
  .logo {
    transform: scale(0.7) !important;
  }
  .entrance {
    gap: 6px !important;
  }
  .entrance a {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }
  .authorized-user img {
    width: 22px !important;
    height: 22px !important;
  }

  /* Меню вкладок — компактнее */
  .tab {
    font-size: 13px !important;
    padding: 7px 13px !important;
  }

  /* Попапы на весь экран */
  .popup {
    width: 96vw !important;
    max-width: 96vw !important;
  }

  /* ---------- Варианты ответов на вопрос (таблица → столбик) ---------- */
  .variants .table,
  .question-view-popup .variants .table,
  .add-info .table {
    width: 100% !important;
    display: block !important;
    border: none !important;
  }
  .table-row {
    display: block !important;
    margin-bottom: 8px;
  }
  .cell,
  .radio-cell,
  .text-cell,
  .rate-cell {
    display: block !important;
    width: 100% !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    border-right: none !important;
  }
  .text-cell {
    font-size: 15px !important;
    border-right: none !important;
  }
  .rate-cell {
    padding-top: 2px !important;
  }
  /* Каждый вариант — карточкой */
  .add-info .variant-row {
    border: 1px solid #ece7df;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 8px;
    background: #fff;
  }

  /* Текст вопроса — без лишнего правого отступа */
  .question-text {
    padding-right: 0 !important;
    font-size: 17px !important;
  }

  /* Кнопки навигации вопроса — в столбик/компактно */
  .answer-buttons {
    gap: 10px !important;
    flex-wrap: wrap;
  }
  .answer-buttons .button_red {
    height: auto !important;
    line-height: 1.4 !important;
    min-height: 44px;
  }

  /* Футер */
  footer {
    text-align: left;
    padding: 0 10px;
  }
}

/* ============================================================
   ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ (поворот телефона)
   Широкий, но низкий экран — шапка фиксированная и компактная
   ============================================================ */
@media (max-width: 900px) and (orientation: landscape) {

  html, body {
    overflow-x: hidden !important;
  }

  .topline,
  .line {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  .topline {
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
  }
  .topline .wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    padding: 6px 14px !important;
    min-height: 42px;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .logo {
    float: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    transform: scale(0.8) !important;
    transform-origin: left center !important;
  }
  .entrance {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }
  .entrance a {
    margin: 0 !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
    white-space: nowrap !important;
  }

  /* Промо в ландшафте — не на всю высоту */
  .promo {
    padding: 16px 0 !important;
  }
  .bg-people {
    height: 140px !important;
    margin: 6px auto 12px !important;
  }

  /* Меню вкладок остаётся горизонтальным */
  .tabs-menu {
    overflow-x: auto;
  }
}
