/**
 * Последний файл стилей портала (префикс zzz- → при склейке CSS идёт позже modern/responsive).
 * Правки мобильной главной: кнопки не на всю ширину, поиск, срочные новости.
 */
@media screen and (max-width: 768px) {
  html body .portal_top > .link_all,
  html body .portal_top > .link_add {
    width: auto !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-bottom: 10px !important;
    text-align: left !important;
  }

  html body .portal_top > .link_all {
    margin-right: 10px !important;
    max-width: calc(100% - 12px) !important;
  }

  html body .portal_top > .link_add a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 14px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    width: auto !important;
    max-width: 100% !important;
  }

  /* «Скидки»: первый пункт firm_menu или ссылка с классом .firm-menu--promo (mod_menu default_url) */
  html body .firm_menu .menu li:first-child,
  html body .firm_menu .menu li:first-child a {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body a.sale_link,
  html body .firm_menu .menu li:first-child a,
  html body .firm_menu .menu a.firm-menu--promo {
    width: auto !important;
    max-width: min(100%, 340px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    padding: 10px 16px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    line-height: 1.2 !important;
  }

  html body .firm_menu .menu li:first-child a i,
  html body .firm_menu .menu a.firm-menu--promo i {
    font-size: 15px !important;
  }

  html body .shop_menu_block .poisk .form-search > .finder {
    display: flex !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 0 !important;
  }

  html body .shop_menu_block .poisk .form-search .finder input.search-query,
  html body .shop_menu_block .poisk .form-search .finder input[type="text"] {
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    box-sizing: border-box !important;
  }

  html body .shop_menu_block .poisk .form-search button.finder {
    position: static !important;
    flex: 0 0 auto !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  html body .top_block .all_gorod {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 10px !important;
    padding-top: 8px !important;
    padding-bottom: 10px !important;
  }

  html body .top_block .hot_news {
    width: 100% !important;
    flex: 1 0 100% !important;
    order: 99 !important;
    margin: 4px 0 0 !important;
    text-align: left !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    background: rgba(31, 95, 168, 0.08) !important;
    border: 1px solid #d8e0ef !important;
    border-radius: 8px !important;
  }

  html body .top_block .hot_news i {
    font-size: 17px !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
  }

  html body .top_block .hot_news .newsflash {
    display: inline !important;
    vertical-align: middle !important;
    width: auto !important;
    text-align: left !important;
  }

  html body .top_block .hot_news .newsflash h4 {
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    margin: 0 !important;
  }

  html body .top_block .hot_news .newsflash h4 a {
    border-bottom: none !important;
    color: #1f5fa8 !important;
  }

  html body .block_shop_menu {
    margin-bottom: 12px !important;
  }

  html body .tagspopular li {
    margin: 0 6px 6px 0 !important;
  }

  /* Главная: без горизонтальной «прокрутки всей страницы» (часто из‑за стрелок карусели) */
  html {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  html body .news,
  html body .main_block {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .mod_afisha,
  html body .mod_catalog,
  html body .mod_doska,
  html body .mod_realty,
  html body .mod_auto,
  html body .mod_dost {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Карусель: стрелки внутри блока, не с отрицательными left/right */
  html body .carousel {
    position: relative !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .carousel-wrapper {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .carousel-button-left,
  html body .carousel-button-right {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    -webkit-transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    line-height: 1 !important;
    font-size: 28px !important;
    margin: 0 !important;
    z-index: 4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14) !important;
    -webkit-tap-highlight-color: transparent;
  }

  html body .carousel-button-left {
    left: 6px !important;
    right: auto !important;
  }

  html body .carousel-button-right {
    right: 6px !important;
    left: auto !important;
  }

  html body .carousel-button-left a,
  html body .carousel-button-right a {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
  }

  html body .carousel-dots {
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 16px !important;
  }

  html body .carousel-dot {
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
    min-height: 11px !important;
    flex-shrink: 0 !important;
  }

  /* Карусель: одна крупная карточка на экран (--carousel-slide-w выставляет carousel.js) */
  html body .carousel .carousel-items {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: auto !important;
  }

  html body .carousel .carousel-block,
  html body .main_block .mod_afisha .carousel .carousel-block,
  html body .main_block .mod_catalog .carousel .carousel-block,
  html body .main_block .mod_doska .carousel .carousel-block,
  html body .main_block .mod_realty .carousel .carousel-block,
  html body .main_block .mod_auto .carousel .carousel-block,
  html body .main_block .mod_dost .carousel .carousel-block,
  html body .mod_afisha .carousel .carousel-block,
  html body .mod_catalog .carousel .carousel-block,
  html body .mod_doska .carousel .carousel-block,
  html body .mod_realty .carousel .carousel-block,
  html body .mod_auto .carousel .carousel-block,
  html body .mod_dost .carousel .carousel-block {
    float: none !important;
    flex: 0 0 var(--carousel-slide-w, 100%) !important;
    width: var(--carousel-slide-w, 100%) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body .carousel .carousel-block .padding {
    margin: 0 0 14px !important;
    padding: 12px 14px 16px !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.08) !important;
    box-sizing: border-box !important;
  }

  html body .mod_afisha .carousel-block .mod_news_img img,
  html body .mod_catalog .carousel-block .mod_news_img img,
  html body .mod_doska .carousel-block .mod_news_img img,
  html body .mod_realty .carousel-block .mod_news_img img,
  html body .mod_auto .carousel-block .mod_news_img img,
  html body .mod_dost .carousel-block .mod_news_img img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 12px !important;
  }

  html body .mod_afisha .carousel-block .news_caption h3,
  html body .mod_catalog .carousel-block .news_caption h3 {
    font-size: 1.08rem !important;
    line-height: 1.35 !important;
    margin: 12px 0 8px !important;
  }

  html body .carousel-button-left,
  html body .carousel-button-right {
    top: 42% !important;
  }

  /* Фильтры афиши / каталога: одна прокручиваемая строка вместо громоздкого переноса */
  html body .mod_afisha .mini_menu,
  html body .mod_catalog .mini_menu,
  html body .mod_doska .mini_menu,
  html body .mod_realty .mini_menu,
  html body .mod_auto .mini_menu,
  html body .mod_dost .mini_menu {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  html body .mini_menu ul.menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    max-width: 100% !important;
    padding: 4px 4px 10px !important;
    margin: 0 !important;
    padding-left: 0 !important;
    box-sizing: border-box !important;
    list-style: none !important;
    scrollbar-width: thin;
  }

  html body .mini_menu ul.menu li {
    flex: 0 0 auto !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
  }

  html body .mini_menu ul.menu li:last-child a,
  html body .mini_menu ul.menu li.item-2851 a,
  html body .mini_menu ul.menu li.item-2853 a {
    white-space: nowrap !important;
  }

  /* —— Главная: колонка новостей + отступы секций —— */
  html body .all_gorod {
    padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
    box-sizing: border-box !important;
  }

  html body .news,
  html body .blog {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  html body .news {
    margin-bottom: 18px !important;
  }

  html body .blog {
    margin-bottom: 8px !important;
  }

  /*
   * Новости (default-news / firm-news / world): .bigNews — только для десктоп-ховера,
   * на мобилке должен быть скрыт (responsive.css). Не показывать оба столбца — иначе
   * абсолютные .big_item_* наезжают на .miniNews.
   */
  html body .news .bigNews {
    display: none !important;
  }

  html body .news .miniNews {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  html body .news .miniNews .padding.mini_item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: both !important;
    overflow: hidden !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
  }

  html body .news .miniNews .mod_news_img {
    display: block !important;
    width: 100% !important;
    max-width: 260px !important;
    margin: 0 auto 12px !important;
    box-sizing: border-box !important;
  }

  html body .news .miniNews .mod_news_img img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  html body .news .miniNews .mini_news_info {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
  }

  html body .news .miniNews .mini_icon {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 14px !important;
    line-height: 1.35 !important;
  }

  html body .news .miniNews .mini_icon .ic {
    margin-right: 0 !important;
    white-space: nowrap !important;
  }

  html body .news .miniNews .mini_firm_logo,
  html body .news .miniNews .mini_firm_info {
    display: inline-block !important;
    vertical-align: middle !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .news .miniNews .mini_firm_logo img {
    display: block !important;
  }

  html body .news .link_all,
  html body .news .link_add {
    display: inline-block !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
  }

  html body .news .link_add a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  html body .main_content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    box-sizing: border-box !important;
  }

  html body .main_content .left_block,
  html body .main_content .content,
  html body .main_content .content.big {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 0 16px 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  html body .home_problem,
  html body .home_poteri,
  html body .home_work {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
  }

  html body .forum_home,
  html body .comment_home {
    margin-bottom: 14px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  html body .main_block .mod_afisha,
  html body .main_block .mod_catalog,
  html body .main_block .mod_doska,
  html body .main_block .mod_realty,
  html body .main_block .mod_auto,
  html body .main_block .mod_dost {
    margin-bottom: 22px !important;
  }

  html body .tagspopular ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px 8px !important;
    padding: 0 4px !important;
    margin: 8px 0 12px !important;
    list-style: none !important;
    box-sizing: border-box !important;
  }

  html body .footer_portal {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }

  html body .portal_copy {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)) !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  html body .portal_copy .copy,
  html body .portal_copy .copy_vozrast,
  html body .portal_copy .counter {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
  }

  html body .portal_top h3 {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
  }
}

@media screen and (max-width: 414px) {
  html body a.sale_link,
  html body .firm_menu .menu li:first-child a,
  html body .firm_menu .menu a.firm-menu--promo {
    width: auto !important;
    max-width: min(100%, 340px) !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    text-align: center !important;
  }

  html body .firm_menu .menu li:first-child {
    width: auto !important;
  }
}

/* —— Верхняя панель: слева меню, центр погода, справа + / ЛК / «дом» в одной линии —— */
@media screen and (max-width: 640px) {
  html body .top_block .all_gorod {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    row-gap: 6px !important;
    column-gap: 6px !important;
  }

  /* Порядок: гамбургер | погода (растягивается) | красная кнопка | аватар | дом */
  html body .top_block .mobile_btn_mainmenu {
    order: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  html body .top_block .pogoda {
    order: 2 !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
  }

  /* Правая тройка подряд без «провала» */
  html body .top_block .top_btn {
    order: 3 !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  html body .top_block .user_panel {
    order: 4 !important;
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }

  html body .top_block .mobile_btn_home {
    order: 5 !important;
    width: auto !important;
    flex: 0 0 auto !important;
  }

  html body .top_block .valuta {
    order: 10 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    text-align: center !important;
    margin-top: 4px !important;
  }

  html body .top_block .top_vozrast,
  html body .top_block .today {
    order: 9 !important;
  }

  /* Единая сетка 44px; ЛК / «дом» — тот же синий, что и гамбургер (белые иконки читаемы) */
  html body .top_block .user_panel a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    line-height: 0 !important;
    background: #3b5998 !important;
    border-radius: 8px !important;
    border: none !important;
  }

  html body .top_block .user_panel a span.user_avatar {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body .top_block .user_panel a span.user_avatar img {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
  }

  /* Компактная кнопка ЛК: иконка белая на синем фоне (в т.ч. error без .modern-ui) */
  html body .top_block .user_panel > a.fancy_close span.user_avatar,
  html body .top_block .user_panel > a[href="#login"] span.user_avatar {
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }

  html body .top_block .user_panel > a .user_panel__guest-icon {
    color: #fff !important;
    font-size: 22px !important;
  }

  html body .top_block .user_panel a span.user_text {
    display: none !important;
  }

  /* Авторизованный ЛК (mod_slogin): аватар в той же синей кнопке 44px, подпись скрыта */
  html body .top_block .user_panel .city_login {
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .top_block .user_panel .mini_login {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: #3b5998 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  html body .top_block .user_panel .mini_login .top_ava_block {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .top_block .user_panel .mini_login .top_ava_block img {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    vertical-align: middle !important;
  }

  html body .top_block .user_panel .mini_login .login-greeting {
    display: none !important;
  }

  html body .top_block .top_btn a,
  html body .top_block .mobile_btn_mainmenu a,
  html body .top_block .mobile_btn_home a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    line-height: 0 !important;
  }

  html body .top_block .top_btn a {
    background: #f55 !important;
    border-radius: 8px !important;
  }

  html body .top_block .mobile_btn_mainmenu a {
    background: #3b5998 !important;
    border-radius: 8px !important;
  }

  html body .top_block .mobile_btn_home a {
    background: #3b5998 !important;
    border: none !important;
    border-radius: 8px !important;
  }

  html body .top_block .top_btn a img,
  html body .top_block .mobile_btn_mainmenu a img,
  html body .top_block .mobile_btn_home a img {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    filter: none !important;
    opacity: 1 !important;
  }

  /* Светлая шапка (.modern-ui): явно тёмно-синие кнопки, белые пиктограммы */
  html body.modern-ui .top_block .user_panel a,
  html body.modern-ui .top_block .user_panel .mini_login {
    background: #3b5998 !important;
  }

  html body.modern-ui .top_block .mobile_btn_mainmenu a,
  html body.modern-ui .top_block .mobile_btn_home a {
    background: #3b5998 !important;
  }

  html body.modern-ui .top_block .top_btn a {
    background: #f55 !important;
  }

}

@media screen and (max-width: 320px) {
  html body .top_block .user_panel {
    width: auto !important;
    max-width: none !important;
  }
}

/* Строка: логотип города, срочные новости — на всю ширину */
@media screen and (max-width: 768px) {
  html body .all_gorod--subhead {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .all_gorod--subhead .like_block {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  html body .all_gorod--subhead .hot_news,
  html body .all_gorod--subhead .hot_news .newsflash,
  html body .all_gorod--subhead .hot_news .newsflash h4 {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .all_gorod--subhead .hot_news {
    flex: 1 1 100% !important;
  }

  /* «Скидки» + список под ним — по центру */
  html body .top_menu_left .firm_menu,
  html body .firm_menu {
    text-align: center !important;
  }

  html body .top_menu_left .firm_menu ul.menu,
  html body .firm_menu ul.menu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    text-align: center !important;
  }

  html body .firm_menu ul.menu > li,
  html body .firm_menu .menu li {
    text-align: center !important;
    display: block !important;
    list-style: none !important;
    width: 100% !important;
    max-width: 360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  html body .firm_menu .menu li a,
  html body .firm_menu ul.menu > li > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 6px !important;
    text-align: center !important;
  }
}

/* Форма входа (iframe com_users, модалка) */
@media screen and (max-width: 768px) {
  html body .login_form {
    width: 100% !important;
    max-width: 420px !important;
    margin: 12px auto !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
  }

  html body .login_form .padding,
  html body .login {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body .login_form .slogin-buttons,
  html body .login_form #slogin-buttons {
    display: block !important;
    width: 100% !important;
  }

  html body .login_form .slogin-buttons a,
  html body .login_form #slogin-buttons a,
  html body .login_form .slogin-default a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 8px 0 !important;
    min-height: 48px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  html body .login_form input.inputbox,
  html body .login_form input[type="text"],
  html body .login_form input[type="password"],
  html body .login_form input[type="email"] {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  html body .login_form .btn,
  html body .login_form .button,
  html body .login_form input[type="submit"] {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  html body .login_form .city_login a.btn {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

  /* Поля в 2 ряда на широком мобильном: убираем узкий .login_form 400px */
  html body #sloginForm .control-group,
  html body .login .control-group,
  html body .login .form-group,
  html body .login .control-group {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* —— Меню каталогов (гамбургер, :target + #gorod-catalog-overlay) —— */
@media screen and (max-width: 640px) {
  html body .overlay_mainmenu {
    -webkit-tap-highlight-color: transparent;
  }

  html body .overlay_mainmenu:target {
    display: block !important;
    z-index: 10020 !important;
    background-color: rgba(20, 35, 55, 0.45) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  /* Панель каталога: по центру экрана (модалка), не боковая шторка */
  html body .block_main_menu .mainmenu.mainmenu--drawer,
  html body .mainmenu.mainmenu--drawer {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    width: min(92vw, 400px) !important;
    min-width: 0 !important;
    max-width: min(92vw, 400px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(88vh, 640px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 50px rgba(15, 30, 60, 0.22), 0 4px 16px rgba(15, 30, 60, 0.12) !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    transform: translate3d(-50%, -50%, 0) scale(0.96) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    /* visibility не анимируем — иначе в части WebKit панель остаётся «закрытой» */
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.28s ease !important;
    z-index: 10021 !important;
  }

  html body .overlay_mainmenu:target + .mainmenu.mainmenu--drawer {
    transform: translate3d(-50%, -50%, 0) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  html body .mainmenu__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    /* верхний отступ без шапки «Меню каталогов» */
    padding: max(14px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px)) 10px !important;
  }

  html body .mainmenu__body > .moduletable,
  html body .mainmenu__body .moduletable {
    margin: 0 !important;
  }

  html body .mainmenu__body ul.menu,
  html body .mainmenu.mainmenu--drawer ul.menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li,
  html body .mainmenu__body ul.menu > li {
    width: 100% !important;
    text-align: left !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 10px !important;
    background: #f4f6fb !important;
    position: relative !important;
    overflow: visible !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li > a,
  html body .mainmenu__body ul.menu > li > a {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0 12px !important;
    padding: 12px 40px 12px 12px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    color: #23324d !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    position: relative !important;
  }

  /* Картинка рядом с текстом, без наложения (перебивает inline-block из template.css) */
  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.city_menu_img,
  html body .mainmenu__body ul.menu > li > a span.city_menu_img {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    margin: 0 !important;
    margin-right: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.city_menu_img img,
  html body .mainmenu__body ul.menu > li > a span.city_menu_img img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.city_txt,
  html body .mainmenu__body ul.menu > li > a span.city_txt {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    margin-right: 0 !important;
    text-shadow: none !important;
    text-transform: none !important;
    font-size: 15px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.city_txt span,
  html body .mainmenu__body ul.menu > li > a span.city_txt span {
    border-bottom: none !important;
    text-decoration: none !important;
    display: inline !important;
    font-weight: 600 !important;
  }

  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.city_txt small,
  html body .mainmenu__body ul.menu > li > a span.city_txt small {
    display: block !important;
    margin-top: 2px !important;
    font-size: 12px !important;
    color: #6e7b95 !important;
    text-transform: none !important;
  }

  /* Бейдж «новое» — в углу ячейки, не на тексте */
  html body .mainmenu.mainmenu--drawer ul.menu > li > a span.note,
  html body .mainmenu__body ul.menu > li > a span.note {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    margin: 0 !important;
  }

  /* Если в разметке только <img> у ссылки */
  html body .mainmenu.mainmenu--drawer ul.menu > li > a > img:first-child,
  html body .mainmenu__body ul.menu > li > a > img:first-child {
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    object-fit: contain !important;
    margin: 0 10px 0 0 !important;
  }
}

/*
 * Тело материала com_content: картинки на ширину колонки.
 * Файл подключается после modern-ux — перебивает плагины/inline width/imgresizecache.
 */
html body.modern-ui .content .news-page .desc.padding img,
html body.modern-ui .content .news-page .news-page__body-extra img,
html body.modern-ui .content .news_all .desc.padding img,
html body.modern-ui .content .news-page .intro_text_item img,
html body.modern-ui .content .news_all .intro_text_item img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  float: none !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding picture,
html body.modern-ui .content .news-page .news-page__body-extra picture,
html body.modern-ui .content .news_all .desc.padding picture,
html body.modern-ui .content .news-page .intro_text_item picture,
html body.modern-ui .content .news_all .intro_text_item picture {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding picture img,
html body.modern-ui .content .news-page .news-page__body-extra picture img,
html body.modern-ui .content .news_all .desc.padding picture img,
html body.modern-ui .content .news-page .intro_text_item picture img,
html body.modern-ui .content .news_all .intro_text_item picture img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  float: none !important;
  box-sizing: border-box !important;
}

/* Обёртки TinyMCE / таблицы: не держать узкую колонку */
html body.modern-ui .content .news-page .desc.padding table,
html body.modern-ui .content .news_all .desc.padding table {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding td img,
html body.modern-ui .content .news-page .desc.padding th img,
html body.modern-ui .content .news_all .desc.padding td img,
html body.modern-ui .content .news_all .desc.padding th img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding p:has(img),
html body.modern-ui .content .news-page .news-page__body-extra p:has(img),
html body.modern-ui .content .news_all .desc.padding p:has(img),
html body.modern-ui .content .news-page .intro_text_item p:has(img),
html body.modern-ui .content .news_all .intro_text_item p:has(img) {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding div:not(.sigplus-gallery):not([class*="sigplus"]):has(img),
html body.modern-ui .content .news-page .news-page__body-extra div:not(.sigplus-gallery):not([class*="sigplus"]):has(img),
html body.modern-ui .content .news_all .desc.padding div:not(.sigplus-gallery):not([class*="sigplus"]):has(img),
html body.modern-ui .content .news-page .intro_text_item div:not(.sigplus-gallery):not([class*="sigplus"]):has(img),
html body.modern-ui .content .news_all .intro_text_item div:not(.sigplus-gallery):not([class*="sigplus"]):has(img) {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding span:has(> img:only-child),
html body.modern-ui .content .news-page .news-page__body-extra span:has(> img:only-child),
html body.modern-ui .content .news_all .desc.padding span:has(> img:only-child),
html body.modern-ui .content .news-page .intro_text_item span:has(> img:only-child),
html body.modern-ui .content .news_all .intro_text_item span:has(> img:only-child),
html body.modern-ui .content .news-page .desc.padding span:has(> span > img),
html body.modern-ui .content .news_all .desc.padding span:has(> span > img),
html body.modern-ui .content .news-page .intro_text_item span:has(> span > img),
html body.modern-ui .content .news_all .intro_text_item span:has(> span > img) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .news-page .desc.padding span:has(> span > img) > span,
html body.modern-ui .content .news_all .desc.padding span:has(> span > img) > span,
html body.modern-ui .content .news-page .intro_text_item span:has(> span > img) > span,
html body.modern-ui .content .news_all .intro_text_item span:has(> span > img) > span {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Раскладка default.php / page-blog: .item-page .desc и .full_desc */
html body.modern-ui .content .item-page .desc img,
html body.modern-ui .content .item-page .full_desc img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  float: none !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .item-page .desc p:has(img),
html body.modern-ui .content .item-page .full_desc p:has(img),
html body.modern-ui .content .item-page .desc div:not(.sigplus-gallery):not([class*="sigplus"]):has(img),
html body.modern-ui .content .item-page .full_desc div:not(.sigplus-gallery):not([class*="sigplus"]):has(img) {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .item-page .desc span:has(> img:only-child),
html body.modern-ui .content .item-page .full_desc span:has(> img:only-child),
html body.modern-ui .content .item-page .desc span:has(> span > img),
html body.modern-ui .content .item-page .full_desc span:has(> span > img) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.modern-ui .content .item-page .desc span:has(> span > img) > span,
html body.modern-ui .content .item-page .full_desc span:has(> span > img) > span {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Форма регистрации (com_users, модалка/мобайл) */
html body .registration_form {
  width: 100% !important;
  max-width: 460px !important;
  margin: 12px auto !important;
  box-sizing: border-box !important;
}

html body .registration_form .padding {
  padding: 0 10px 14px !important;
  box-sizing: border-box !important;
}

html body .registration_form .registration {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body .registration_form .page-header {
  margin: 0 0 12px !important;
}

html body .registration_form .page-header h1 {
  margin: 0 !important;
  color: #2f4d7a !important;
  font-size: 42px !important;
  line-height: 1.05 !important;
  letter-spacing: 0.2px !important;
  text-transform: uppercase !important;
}

html body .registration_form .page-header:after {
  content: "" !important;
  display: block !important;
  width: min(100%, 235px) !important;
  height: 4px !important;
  margin-top: 8px !important;
  border-radius: 2px !important;
  background: #f45a61 !important;
}

html body .registration_form #member-registration {
  margin: 0 !important;
  padding: 14px !important;
  border: 1px solid #d8e0ef !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 4px 14px rgba(20, 45, 90, 0.08) !important;
  box-sizing: border-box !important;
}

html body .registration_form #member-registration fieldset {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

html body .registration_form #member-registration legend {
  margin: 0 0 10px !important;
}

html body .registration_form #member-registration .control-group {
  margin: 0 0 14px !important;
}

html body .registration_form #member-registration .control-label {
  float: none !important;
  width: 100% !important;
  text-align: left !important;
  margin: 0 0 6px !important;
}

html body .registration_form #member-registration .control-label label {
  display: block !important;
  color: #2f4d7a !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  margin: 0 0 2px !important;
}

html body .registration_form #member-registration .control-label i,
html body .registration_form #member-registration .control-label .fa,
html body .registration_form #member-registration .control-label .fas {
  color: #f45a61 !important;
  margin-right: 8px !important;
}

html body .registration_form #member-registration .controls {
  margin-left: 0 !important;
}

html body .registration_form #member-registration input[type="text"],
html body .registration_form #member-registration input[type="password"],
html body .registration_form #member-registration input[type="email"] {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 46px !important;
  padding: 10px 14px !important;
  border: 1px solid #d8e0ef !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #23324d !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

html body .registration_form #member-registration input[type="text"]::placeholder,
html body .registration_form #member-registration input[type="password"]::placeholder,
html body .registration_form #member-registration input[type="email"]::placeholder {
  color: #8a98b3 !important;
}

html body .registration_form #member-registration input[type="text"]:focus,
html body .registration_form #member-registration input[type="password"]:focus,
html body .registration_form #member-registration input[type="email"]:focus {
  border-color: #1f5fa8 !important;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.16) !important;
}

html body .registration_form #member-registration .controls .btn {
  min-height: 44px !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

html body .registration_form #member-registration .controls .btn-primary {
  background: #1f5fa8 !important;
  border-color: #1f5fa8 !important;
  color: #fff !important;
}

html body .registration_form #member-registration .controls .btn-primary:hover {
  background: #184b84 !important;
  border-color: #184b84 !important;
}

html body .registration_form #member-registration .controls .btn + .btn {
  margin-left: 8px !important;
}

html body .registration_form #member-registration .control-group .help-block,
html body .registration_form #member-registration .control-group .help-inline {
  margin-top: 6px !important;
  color: #6e7b95 !important;
}

html body .registration_form #member-registration .control-group.error .help-inline,
html body .registration_form #member-registration .control-group.error .help-block {
  color: #c5313a !important;
}

html body .registration_form #member-registration .control-group.error input[type="text"],
html body .registration_form #member-registration .control-group.error input[type="password"],
html body .registration_form #member-registration .control-group.error input[type="email"] {
  border-color: #e26f76 !important;
  box-shadow: 0 0 0 3px rgba(244, 90, 97, 0.14) !important;
}

@media screen and (max-width: 768px) {
  html body .registration_form .page-header h1 {
    font-size: 40px !important;
  }

  html body .registration_form #member-registration {
    padding: 10px !important;
  }

  html body .registration_form #member-registration .controls .btn {
    width: 100% !important;
    display: block !important;
    margin: 0 0 8px !important;
  }

  html body .registration_form #member-registration .controls .btn + .btn {
    margin-left: 0 !important;
  }
}
