/* ============================================================
   Адаптивные стили для techexpert96.ru
   Подключать ПОСЛЕ /css/application.css
   ============================================================ */

/* --- Планшет landscape (≤1199px) --- */
@media (max-width: 1199px) {

  header section,
  article section,
  footer section {
    min-width: 0;
    padding: 1px 20px;
  }

  header section .wrapper,
  article section .wrapper,
  footer section .wrapper {
    max-width: 100%;
  }

  .row .cell:first-child,
  .row .cell:last-child {
    width: 50%;
  }

  .row.side .cell:first-child {
    width: 75%;
  }
  .row.side .cell:last-child {
    width: 25%;
  }

  .services .one,
  .clients .one,
  .works .one {
    width: calc(33.333% - 20px);
  }

  .wall .lead,
  .map .map-box,
  .feedback {
    width: 70%;
  }
}

/* --- Планшет portrait (≤991px) --- */
@media (max-width: 991px) {

  /* Header перестраиваем в 2 строки */
  header section .wrapper.flex-justify-valign {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  header section .wrapper .logo {
    flex: 0 0 auto;
  }
  header section .wrapper .contacts {
    text-align: right;
    flex: 0 0 auto;
  }

  /* Меню — на отдельную строку, во всю ширину */
  header section .wrapper .menu {
    order: 3;
    width: 100%;
    margin-top: 15px;
    text-align: center;
  }
  header section .wrapper .menu a {
    float: none;
    display: inline-block;
    padding: 12px 14px;
    font-size: 14px;
  }

  .wall {
    height: 450px;
  }

  .row .cell:first-child,
  .row .cell:last-child,
  .row.side .cell:first-child,
  .row.side .cell:last-child {
    float: none;
    width: 100%;
    padding-right: 0;
  }
  .row .cell:last-child {
    margin-top: 20px;
  }

  .services .one,
  .clients .one,
  .works .one {
    width: calc(50% - 20px);
  }

  .wall .lead,
  .map .map-box,
  .feedback {
    width: 80%;
  }

  .feedback .image {
    position: relative;
    width: 100%;
    height: 150px;
    left: 0;
    margin-bottom: 15px;
  }
  .feedback .content {
    float: none;
    width: 100%;
  }
}

/* --- Мобильный (≤767px) --- */
@media (max-width: 767px) {

  body {
    font-size: 15px;
  }

  h1 { font-size: 30px; }
  h2 { font-size: 24px; }

  /* Header: показываем гамбургер, прячем меню */
  header {
    position: relative;
  }
  .page {
    margin-top: 0 !important;
  }
  header section {
    padding-bottom: 0;
  }
  header section .wrapper {
    padding: 10px 0;
    position: relative;
  }
  header section .wrapper .logo a {
    font-size: 18px;
  }
  header section .wrapper .logo p {
    font-size: 12px;
  }
  header section .wrapper .contacts {
    display: none;
  }

  /* Кнопка-гамбургер */
  .mob-menu-toggle {
    display: block;
    position: absolute;
    right: 0;
    top: 18px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .mob-menu-toggle span,
  .mob-menu-toggle span:before,
  .mob-menu-toggle span:after {
    display: block;
    width: 26px;
    height: 2px;
    background: #333;
    position: absolute;
    left: 5px;
    transition: all .3s;
  }
  .mob-menu-toggle span { top: 17px; }
  .mob-menu-toggle span:before { content: ''; top: -8px; }
  .mob-menu-toggle span:after  { content: ''; top: 8px; }
  .mob-menu-toggle.is-open span { background: transparent; }
  .mob-menu-toggle.is-open span:before { top: 0; transform: rotate(45deg); }
  .mob-menu-toggle.is-open span:after  { top: 0; transform: rotate(-45deg); }

  /* Скрытое мобильное меню */
  header section .wrapper .menu {
    display: none;
    margin-top: 10px;
    background: #f7f7f7;
  }
  header section .wrapper .menu.is-open {
    display: block;
  }
  header section .wrapper .menu a {
    display: block;
    background: transparent;
    border-bottom: 1px solid #e6e6e6;
    padding: 12px 15px;
    text-align: left;
  }
  header section .wrapper .menu a:last-child {
    border-bottom: 0;
  }

  /* Скрываем десктоп-контакты, показываем мобильную плашку */
  .mob-contacts {
    display: block;
    background: #f7f7f7;
    padding: 12px 20px;
    text-align: center;
    font-size: 15px;
    margin: 0 -20px;
  }
  .mob-contacts a { color: black; text-decoration: none; }
  .mob-contacts .button {
    margin-top: 8px;
  }

  /* Hero */
  .wall {
    height: 360px;
  }
  .wall .lead {
    position: static;
    width: auto;
    margin: 60px 0 0 0;
    padding: 20px;
    font-size: 20px;
  }
  .wall .lead h1 { font-size: 26px; }
  .wall .lead p { font-size: 15px; }

  /* Контент */
  .row .cell,
  .row.side .cell {
    float: none;
    width: 100% !important;
    padding-right: 0;
  }
  .row .cell:last-child {
    margin-top: 20px;
  }

  /* Карточки в одну колонку */
  .services .one,
  .clients .one,
  .works .one {
    width: calc(100% - 20px);
    height: auto;
    min-height: 200px;
  }
  .works .one {
    min-height: 280px;
  }
  .works .one .image {
    height: 200px;
  }

  /* Почему мы: число и контент в колонку */
  .why .one > div {
    float: none;
    width: 100%;
  }
  .why .one .number {
    width: 50px;
    font-size: 40px;
    float: left;
  }
  .why .one .content {
    width: auto;
    margin-left: 65px;
  }

  /* Карта и блок контактов */
  .map {
    height: 480px;
  }
  .map .map-box {
    position: static;
    width: auto;
    margin: 0 0 20px 0;
    padding: 20px;
    font-size: 15px;
  }

  /* Модальное окно */
  .shadow .inner {
    width: auto;
    left: 10px;
    right: 10px;
    margin-left: 0;
    padding: 50px 20px 30px;
  }

  /* Фиксированный header для десктопа убираем на мобиле */
  header {
    position: static;
  }
}

/* --- Маленький мобильный (≤479px) --- */
@media (max-width: 479px) {

  body { font-size: 14px; }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }

  .wall { height: 300px; }
  .wall .lead h1 { font-size: 22px; }

  .button { padding: 12px 25px; font-size: 15px; }
  .button.small { font-size: 14px; }

  .services .one { min-height: 160px; }
  .works .one { min-height: 240px; }
  .works .one .image { height: 160px; }
}

/* --- Дефолтные состояния (скрытые на десктопе) --- */
.mob-menu-toggle { display: none; }
.mob-contacts    { display: none; }
