/* overrides.css — CSS-переопределения по замечаниям клиента (Редакция 20.03.26) */

/* Fix: <button> не наследует font от окружающих <a> — Меню рендерится Roboto 24px вместо OpenSans-Bold 14px */
button.header__right__nav__menu,
button.header__right__nav__menu .semi-desktop {
  font-family: 'OpenSans-Bold', sans-serif !important;
  font-size: 14px !important;
  color: #6f6f6f !important;
}
button.header__right__nav__menu {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
}


/* Задача 2: показать подписи иконок на semi-desktop (1024–1366px) */
@media screen and (min-width:1200px) and (max-width:1366px) {
  .semi-desktop {
    display: block !important;
    font-size: 0.65rem;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }
  .header {
    height: 88px !important;
    align-items: flex-start !important;
    padding-top: 10px;
  }
  .header__left,
  .header__right {
    height: auto !important;
    align-items: flex-start !important;
  }
  .header__right__nav {
    height: auto !important;
    align-items: flex-start !important;
    gap: 0.8vw;
  }
  .header__right__nav li {
    margin-right: 0 !important;
  }
  .header__right__nav li a,
  .header__right__nav__menu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px;
    height: auto !important;
    min-width: 52px;
    text-align: center !important;
    line-height: 1.1 !important;
  }
  .header__right__nav li a {
    font-size: 12px !important;
  }
  .header__right__nav__icon,
  .header__right__nav__menu i {
    margin-right: 0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }
  .header__right__nav__menu {
    font-size: inherit !important;
  }
  .header__right__nav__menu .semi-desktop {
    display: none !important;
  }
  .header__right .login-panel {
    margin-left: 0.8vw !important;
    align-items: flex-start !important;
  }
  .header__right .login-panel__login {
    margin-top: 8px;
  }
  /* Визуальная компенсация ассиметрии pin-глифа в icon-font: геометрический
     центр <i> совпадает с центром <span>, но рисунок pin внутри font-коробки
     сдвинут вправо — возвращаем влево на 3px. */
  .header__right__nav li a .icon-tracking {
    transform: translateX(3px);
  }
}

/* Задача 3: убрать изображение «СК» и полоску (страховка) */
.content__banner__image { display: none !important; }
.content__banner {
  width: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.content__banner__title {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  transform: translateX(0.5vw) !important;
}
.content__banner span {
  text-align: center !important;
}
@media screen and (max-width:1199px) {
  .content__banner {
    width: 100vw !important;
  }
  .content__banner__title {
    transform: none !important;
  }
}

/* Задача 5: выравнивание первой колонки футера по левому краю */
.footer__column:first-child,
.footer__column:first-child .footer__bigtext,
.footer__column:first-child .footer__number { text-align: left !important; }
.footer__column:first-child .footer__number { padding-left: 0 !important; }
@media screen and (max-width:1199px) {
  .footer { justify-content: flex-start !important; }
  .footer__column:first-child { padding-left: 5vw !important; }
}

/* Задача 7: мобильный хедер — единый бар с логотипом + навигацией */
@media screen and (max-width:1199px) {
  /* Скрыть старый header и показать новый unified-header */
  #header.header { display: none !important; }
  .header-foot.mobile {
    position: fixed !important;
    top: 0 !important;
    bottom: auto !important;
    box-shadow: 0 1px 4px 1px rgba(0,0,0,.08) !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    height: 56px !important;
  }
  .header-foot-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    padding-left: 12px;
    flex-shrink: 0;
  }
  .header-foot-list {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    justify-content: flex-end !important;
    height: auto !important;
  }
  .header-foot-item {
    flex-shrink: 0 !important;
    text-align: center !important;
    width: auto !important;
    height: auto !important;
  }
  .header-foot-item a {
    font-size: 0 !important;   /* скрыть текстовые подписи */
    padding: 6px 6px !important;
    white-space: nowrap !important;
  }
  .header-foot-item button {
    padding: 6px 6px !important;
    margin-right: 6px !important;
  }
  .header-foot-icon {
    font-size: 1.5rem !important;  /* крупные иконки для читаемости */
  }
}

/* bundle.css даёт mobile-поведение .nav (fullscreen overlay + drawer справа)
   только при max-width:1024. На planshet 1025-1199 остаётся desktop-правило
   `.nav { position:fixed; top:7vw; height:120px; width:100% }` — Dropdown
   превращается в тонкую панель 120px, пункты не вмещаются. Копируем
   mobile-стиль bundle.css для ВСЕГО max-width:1199 диапазона. */
@media screen and (max-width:1199px) {
  #Dropdown.nav {
    height: 100% !important;
    width: 100vw !important;
    position: fixed !important;
    top: 98px !important;  /* под header-foot(56) + icons-bar(~42) */
    left: 0 !important;
    margin-top: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    z-index: 999 !important;
  }
  #Dropdown.nav.show {
    display: flex !important;
  }
  #Dropdown.nav .nav__overlay {
    display: inline-block !important;
    background-color: #000 !important;
    height: 100% !important;
    width: 35vw !important;
    opacity: .51 !important;
  }
  #Dropdown.nav .nav__menu {
    display: inline-block !important;
    padding: 25px 0 !important;
    width: 65vw !important;
    background-color: #fff !important;
    height: auto !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    margin-bottom: 60px !important;
    min-width: 241px !important;
  }
  #Dropdown.nav .nav__menu__item,
  #Dropdown.nav .nav__menu__section-divider {
    /* display: block без !important — чтобы .js-auth-only { display: none !important }
       мог скрывать ЛК-пункты для анонима (!important > no-!important). */
    display: block;
    width: 100% !important;
    padding-right: 20px !important;
    text-align: right !important;
    height: auto !important;
  }
  #Dropdown.nav .nav__menu__item.mobile {
    /* !important чтобы побить top-level `.mobile{display:none!important}` */
    display: block !important;
  }
}

/* Панель иконок под хедером (мобильная) */
@media screen and (max-width:1199px) {
  .header-icons-bar.mobile {
    position: fixed !important;
    top: 56px !important;
    left: 0; right: 0;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center;
    background: #fff;
    padding: 4px 0;
    border-bottom: 1px solid #e5e6e8;
    z-index: 999;
  }
  .header-icons-bar.mobile a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #6f6f6f;
    font-size: 11px;
    font-weight: 500;
  }
  .header-icons-bar.mobile a i {
    font-size: 1.4rem;
    color: #393939;
  }
  .header-icons-bar.mobile .icon-branches:before {
    content: "\0061" !important;
  }
  /* Pin-глиф \0061 ассиметричен (см. semi-desktop fix) — возвращаем визуальный
     центр под span влево на 3px. */
  .header-icons-bar.mobile .icon-branches {
    transform: translateX(3px);
  }
  .header-icons-bar.mobile .icon-tracking-new:before {
    content: "\0046" !important;
  }
}
@media screen and (min-width:1200px) {
  .header-icons-bar.mobile { display: none !important; }
}

/* Кнопка «Оставить запрос» — текст по центру */
a.footer__feedback__submit {
  text-align: center !important;
}

/* Dropdown nav и контент — выровнять под хедер (56px) + панель иконок (59px) = 115px */
@media screen and (max-width:1199px) {
  body { padding-top: 98px !important; }
  .nav { top: 98px !important; }
  .content { margin-top: 0 !important; }
}

/* Задача 9: убрать большой отступ на мобильных */
@media screen and (max-width:1199px) {
  .stocks { padding-top: 0 !important; }
  .stocks.news { padding-top: 0 !important; }
  .content__banner { margin-bottom: 10px !important; }
}

/* Задача 10: соцсети в мобильном футере */
@media screen and (max-width:1199px) {
  .footer__social-mobile { display: flex !important; gap: 12px; margin-top: 16px; justify-content: left; }
  .footer__social-mobile a { color: #fafafa; font-size: 1.4rem; }
}
@media screen and (min-width:1200px) {
  .footer__social-mobile { display: none !important; }
}

/* Секция «Личный кабинет» в #Dropdown гамбургер-меню (для авторизованных).
   Каждый пункт = flex-item на полную ширину родителя, box-sizing: border-box
   чтобы padding не расширял ширину за пределы drawer'а.
   Text-align: right — визуально отделяем от публичного меню, идущего ниже. */
/* Выравнивание по правому краю совпадает с публичными .nav__menu__item
   (они имеют padding-right: 20px в style.bundle.css). */
.nav__menu__section-divider--top,
.nav__menu__item--cabinet {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  padding-right: 20px !important;
  list-style: none;
  text-align: right;
}
.nav__menu__section-divider--top {
  padding-top: 10px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid #e5e6e8;
}
.nav__menu__section-divider--top span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ca1226;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
}
.nav__menu__item--cabinet {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  height: auto !important;
}
.nav__menu__item--cabinet > a {
  display: block;
  text-align: right;
  padding: 0;
}
/* После секции ЛК — разделитель перед публичным меню */
.nav__menu__item--cabinet:last-of-type {
  border-bottom: 1px solid #e5e6e8;
  padding-bottom: 8px !important;
  margin-bottom: 8px;
}
.nav__menu__item--logout a { color: #ca1226 !important; }

/* Серверный fallback: пока inline-скрипт не добавил класс — скрываем js-auth-only
   по умолчанию (нейтральное состояние для анонимов). */
.js-auth-only { display: none !important; }
html.authed .js-auth-only { display: block !important; }
html.authed .js-anon-only { display: none !important; }
html.anon .js-auth-only { display: none !important; }
html.anon .js-anon-only { display: block !important; }
/* Для тегов <a> внутри header-icons-bar нужен inline-flex, а не block */
html.authed .header-icons-bar.mobile .js-auth-only,
html.anon .header-icons-bar.mobile .js-anon-only {
  display: flex !important;
}

/* На desktop уже есть Vue-dropdown «Мои перевозки» — секция ЛК в гамбургере
   только для mobile (<1025px). Specificity поднята до 2 classes чтобы победить
   html.authed .js-auth-only { display: block !important; } (тоже 2 classes). */
@media screen and (min-width:1200px) {
  html.authed .nav__menu__section-divider--top,
  html.authed .nav__menu__item--cabinet,
  html.anon .nav__menu__section-divider--top,
  html.anon .nav__menu__item--cabinet {
    display: none !important;
  }
}

/* === MR-2: font-display: swap для всех @font-face ===
   Дублируем объявления из style.bundle.css с font-display: swap.
   Браузер использует ПОСЛЕДНЕЕ объявление с тем же font-family + font-weight + font-style,
   поэтому эти правила побеждают и шрифты не блокируют рендер текста (FOUT вместо FOIT).
   Когда style.bundle.css будет пересобран из Vue-исходников — добавить font-display: swap там
   и удалить этот блок. */
@font-face { font-family: Roboto; font-style: normal; font-weight: 400; src: url("/static/fonts/Roboto-Regular.3e1af3ef546b.ttf"); font-display: swap; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; src: url("/static/fonts/Roboto-Medium.d52f011be65b.ttf"); font-display: swap; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 300; src: url("/static/fonts/Roboto-Light.c6cdfded4630.ttf"); font-display: swap; }
@font-face { font-family: OpenSans-Bold; font-style: normal; font-weight: 400; src: url("/static/fonts/OpenSans-Bold.0062c34665a3.ttf"); font-display: swap; }
@font-face { font-family: OpenSans-SemiBold; font-style: normal; font-weight: 400; src: url("/static/fonts/OpenSans-SemiBold.096d8c73bb18.ttf"); font-display: swap; }
@font-face { font-family: OpenSans-Light; font-style: normal; font-weight: 400; src: url("/static/fonts/OpenSans-Light.f51d593e2ab5.ttf"); font-display: swap; }
@font-face { font-family: OpenSans-Regular; font-style: normal; font-weight: 400; src: url("/static/fonts/OpenSans-Regular.5a798cdadc7c.ttf"); font-display: swap; }
@font-face { font-family: SourceSansPro-Light; font-style: normal; font-weight: 400; src: url("/static/fonts/SourceSansPro-Light_0.111fe8b7e2db.otf"); font-display: swap; }
@font-face { font-family: SourceSansPro-Semibold; font-style: normal; font-weight: 400; src: url("/static/fonts/SourceSansPro-Semibold.411cd2257bbd.otf"); font-display: swap; }
@font-face { font-family: AGHelveticaBoldItalic; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/AGHelveticaBoldItalic.a8da286e3978.eot") format("embedded-opentype"), url("/static/fonts/AGHelveticaBoldItalic.969d2773518e.woff") format("woff"), url("/static/fonts/AGHelveticaBoldItalic.4fc4680c9aad.ttf") format("truetype"); }
@font-face { font-family: Avanti-Bold; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/avanti-bold_[allfont.ru].6f09fcccbdab.eot"), url("/static/fonts/avanti-bold_[allfont.ru].c9465ed563a6.woff") format("woff"), url("/static/fonts/avanti-bold_[allfont.ru].cb324dfe4797.ttf") format("truetype"); }
@font-face { font-family: Glyphter; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/Glyphter.b1dc8966891f.eot"); src: url("/static/fonts/Glyphter.b1dc8966891f.eot?#iefix") format("embedded-opentype"), url("/static/fonts/Glyphter.13cdf6fed0d4.woff") format("woff"), url("/static/fonts/Glyphter.f26b56045591.ttf") format("truetype"); }

/* === MR-3: SEO-блок в footer ===
   Виден всем пользователям, нужен для SEO-веса (300+ слов на странице).
   Не sr-only — это cloaking-эвристика для Google.
   Ограничиваем длину через max-height с overflow для безопасности fullpage layout. */
.footer__seo-info {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 16px;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
}
.footer__seo-info p { margin-bottom: 12px; }
.footer__seo-info p:last-child { margin-bottom: 0; }

@media (max-width: 1023px) {
  .footer__seo-info {
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
  }
}

/* Delivery первый экран на mobile/tablet (≤1024):
   ранее Mikhail сдвигал заголовок через `top:-34px; translateY(-34px)` —
   из-за этого заголовок «ДОСТАВКА В ТОРГОВЫЕ СЕТИ» наезжал на mobile-header
   и обрезался. Также `.textbox__mintext` глобально скрывался на ≤1024
   (правило из style.bundle.css), из-за чего пропадал блок «Открываем
   новые возможности…» под заголовком (Bug #5 design change). */
@media screen and (max-width: 1024px) {
  #fullpage > .section.del:first-child {
    padding-bottom: 56px;
  }

  #fullpage > .section.del:first-child .textbox.center .textbox__border.first {
    line-height: 1 !important;
    margin-bottom: 0 !important;
  }

  /* Показываем мобильный текст под заголовком (override глобального
     `.textbox__mintext { display:none !important }` в @media ≤1024). */
  #fullpage > .section.del:first-child .textbox__mintext.mobile {
    display: block !important;
    width: 90vw !important;
    margin: 16px auto 0 !important;
    padding: 0 5vw;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-family: SourceSansPro-Light, sans-serif;
    text-align: left;
  }
}

/* === MR-4 hotfix: picture-обёртка в карточках главной (.item.main) ===
   blocks.main-1.html и blocks.main-2.html обернули img в <picture>.
   CSS правило .content__list .item img { width: 25vw } применяется к img,
   но picture-обёртка не имеет width → layout ломается на десктопе.
   Дублируем правила на picture, чтобы рендер совпадал с до-MR-4 поведением. */
.content__list .item.main picture {
  width: 25vw;
  display: block;
  position: relative;
  /* sizing/positioning те же, что были у голого img */
}
.content__list .item.main picture img {
  width: 100%;
  height: auto;
  display: block;
}
/* На мобиле .item img использует другие правила — picture тоже full-width */
@media (max-width: 1023px) {
  .content__list .item.main picture {
    width: 100%;
  }
  .content__list .item.main picture img {
    width: 100%;
    height: auto;
  }
}

/* === MR-2 patch: AVIF/WebP для service-фонов ===
   style.bundle.css использует background-image для JPG для секций /3pl/, /avia/.
   Переопределяем через image-set() — современные браузеры (95%+) выбирают AVIF,
   fallback WebP, fallback JPG.
   Important: image-set() override применяется только к background-image,
   остальные свойства (height/width/position/etc) наследуются от style.bundle.css. */

.screen3pl.first {
  background-image: image-set(
    url("/static/img/3pl/3PL_1.5046886afff7.avif") type("image/avif"),
    url("/static/img/3pl/3PL_1.fe3aaacb9599.webp") type("image/webp"),
    url("/static/img/3pl/3PL_1.2f1d1325b328.jpg")
  );
}
.screen3pl.second {
  background-image: image-set(
    url("/static/img/3pl/3PL_2-new.7ee9ee55d3e9.avif") type("image/avif"),
    url("/static/img/3pl/3PL_2-new.85550198214f.webp") type("image/webp"),
    url("/static/img/3pl/3PL_2-new.09f4c1006225.jpg")
  );
}
.screen3pl.fifth {
  background-image: image-set(
    url("/static/img/3pl/3PL_3.a52c7895f76e.avif") type("image/avif"),
    url("/static/img/3pl/3PL_3.740086bf5d3c.webp") type("image/webp"),
    url("/static/img/3pl/3PL_3.50390729414b.jpg")
  );
}
.screenavia.first {
  background-image: image-set(
    url("/static/img/avia/avia_1.3110c1c09661.avif") type("image/avif"),
    url("/static/img/avia/avia_1.a107cd90f93e.webp") type("image/webp"),
    url("/static/img/avia/avia_1.acd6048793b9.jpg")
  );
}
.screenavia.second {
  background-image: image-set(
    url("/static/img/avia/avia_2.f82889255eef.avif") type("image/avif"),
    url("/static/img/avia/avia_2.b729faa42efd.webp") type("image/webp"),
    url("/static/img/avia/avia_2.9ab29a760229.jpeg")
  );
}
.screenavia.third {
  background-image: image-set(
    url("/static/img/avia/avia_3.28c93455d2da.avif") type("image/avif"),
    url("/static/img/avia/avia_3.7eb370dbf9ff.webp") type("image/webp"),
    url("/static/img/avia/avia_3.897fd86e89fa.jpeg")
  );
}

/* ===== Bug #3: восстановление стилей .simple-list* для /news/ и /promo/ =====
   Стили были потеряны в reconstructed bundle на dev. Восстановлены из main bundle. */
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list__item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #e6e6e6;
}
.simple-list__title { font-weight: 400; text-decoration: underline; }
.simple-list__date { white-space: nowrap; opacity: 0.7; }
.simple-list__empty { padding: 18px 0; opacity: 0.7; }

/* simple-list: pagination controls */
.simple-list-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.simple-list-pagination .page-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px;
  background: #f5f5f5;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  color: inherit;
  transition: background 0.2s;
}
.simple-list-pagination .page-link:hover { background: #e8e8e8; text-decoration: none; }
.simple-list-pagination .page-current { opacity: 0.6; font-size: 14px; }
@media (max-width: 576px) {
  .simple-list__item { flex-direction: column; gap: 4px; }
  .simple-list-pagination { justify-content: center; }
  .simple-list-pagination .page-link { flex: 1; justify-content: center; text-align: center; }
  .simple-list-pagination .page-current { flex-basis: 100%; text-align: center; order: -1; }
}
