/* Мобильная шапка */
.header-mobile-wrapper {
    display: none;
    background: #31353d;
}

@media (max-width: 768px) {
    .header-mobile-wrapper {
        display: block !important;
    }
    
    .header-new {
        display: none !important;
    }
    
    /* Добавляем отступ для body, чтобы контент не перекрывался шапкой */
    body {
        padding-top: 80px !important;
    }
    
    /* Также добавляем отступ для основного контента */
    .site-content,
    main,
    #main,
    .content-area,
    .page-content,
    .entry-content {
        padding-top: 20px !important;
    }
    
    /* Отступ для первого элемента на странице */
    .site-content > *:first-child,
    main > *:first-child,
    #main > *:first-child {
        margin-top: 0 !important;
    }
}

.header-mobile,
.header-mobile-wrapper,
.header-mobile .container,
.header-mobile .header__top {
    background: #31353d !important;
}

.header-mobile {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-mobile .container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 5px;
    box-sizing: border-box;
    background: #31353d;
}

.header-mobile .header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
    min-height: 56px;
}

.header-mobile .header__section {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
}

.header-mobile .header__section-left {
    flex: 1;
    min-width: 0;
}

.header-mobile .header__section-right {
    flex-shrink: 0;
    gap: 6px;
}

.header-mobile .header__logo {
    flex-shrink: 0;
    margin-right: 12px;
}

.header-mobile .header__logo img {
    max-height: 32px;
    width: auto;
    height: auto;
    filter: brightness(0) invert(1);
}

.header-mobile .header__socials-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-mobile .header__social-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.header-mobile .header__social-mini i.fa-telegram-plane {
    color: #fff;
}

.header-mobile .header__social-mini i.fa-whatsapp {
    color: #fff;
}

.header-mobile .header__social-mini i.fa-map-marker-alt {
    color: #fff;
}

/* Скрываем кнопку выбора города на мобилке */
.header-mobile .header__social-mini[data-my-modal="#choosing-city"] {
    display: none !important;
}

/* Скрываем кнопку поиска на мобилке */
.header-mobile .header__icon-btn[data-my-modal="#mobile-search"] {
    display: none !important;
}

.header-mobile .header__social-mini:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.header-mobile .header__icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.header-mobile .header__icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-mobile .header__icon-btn i {
    font-size: 16px;
}

/* Модальные окна */
.my-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.my-modal.my-modal_menu {
    padding: 0;
}

.my-modal.my-modal_menu .my-modal__container {
    padding: 10px;
}

.my-modal.hidden {
    display: none !important;
}

/* Стили для magnificPopup */
.mfp-container .my-modal {
    display: flex !important;
}

.mfp-container .my-modal__container {
    position: relative;
    margin: 0 auto;
}

.my-modal__container {
    background: #fff !important;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10001;
}

/* Для мобильного меню - полная высота без прокрутки контейнера */
@media (max-width: 768px) {
    .my-modal.my-modal_menu .my-modal__container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .my-modal.my-modal_menu .my-modal__body {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

.my-modal.my-modal_menu {
    padding: 0;
}

.my-modal.my-modal_menu .my-modal__container {
    padding: 10px;
}

@media (max-width: 768px) {
    /* Блокируем прокрутку body когда модальное окно открыто */
    body.my-modal-open,
    html.my-modal-open {
        overflow: hidden !important;
    }
    
    /* Скрываем виджет консультанта когда открыто мобильное меню */
    body.my-modal-open .consultant-widget,
    html.my-modal-open .consultant-widget {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /*
      ВАЖНО: MagnificPopup вешает transform на .mfp-content (popup-animations.css),
      а position:fixed внутри transform-родителя начинает "фиксироваться" относительно него.
      Поэтому меню визуально "съезжает" вниз и "крутится".
      Решение: для наших .my-modal попапов на мобилке отключаем transform/центрирование через класс mfp-my-modal (ставим в JS на mfpOpen).
    */
    .mfp-wrap.mfp-my-modal .mfp-container:before {
        display: none !important;
    }
    .mfp-wrap.mfp-my-modal .mfp-content {
        transform: none !important;
        animation: none !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        display: block !important;
    }
    .mfp-wrap.mfp-my-modal .mfp-container {
        padding: 0 !important;
        text-align: left !important;
    }
    
    /* Универсальное правило для всех модальных контейнеров (кроме меню) */
    .my-modal:not(.my-modal_menu):not(.hidden) .my-modal__container,
    .mfp-container .my-modal:not(.my-modal_menu):not(.hidden) .my-modal__container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 10002 !important;
        transform: none !important;
    }
    
    .my-modal.my-modal_menu {
        padding: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 9999 !important;
    }
    
    .my-modal.my-modal_menu .my-modal__container {
        max-width: 320px !important;
        width: 320px !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        padding: 0 !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        overflow: hidden !important;
        transform: none !important;
        z-index: 99999 !important;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .mfp-container {
        padding: 0 !important;
        text-align: left !important;
    }
    
    .mfp-container .my-modal.my-modal_menu {
        display: flex !important;
        justify-content: flex-start !important;
    }
    
    .mfp-container .my-modal.my-modal_menu .my-modal__container {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    .my-modal {
        padding: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        background: rgba(0, 0, 0, 0.5) !important;
        overflow: hidden !important;
    }
    
    .my-modal:not(.my-modal_menu) {
        overflow: hidden !important;
    }
    
    .mfp-container {
        padding: 0 !important;
    }
    
    .mfp-bg {
        background: rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Убеждаемся, что контент виден */
    .my-modal__head,
    .my-modal__body,
    .my-modal__footer {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
}

.my-modal__head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    visibility: visible !important;
    opacity: 1 !important;
    background: #fff;
}

.my-modal__head-text {
    font-size: 16px;
    font-weight: 600;
}

.my-modal__head-close button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-modal__body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .my-modal.my-modal_menu .my-modal__body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        max-height: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .my-modal.my-modal_menu .my-modal__head {
        flex-shrink: 0 !important;
    }
    
    .my-modal.my-modal_menu .my-modal__footer {
        flex-shrink: 0 !important;
        margin-top: auto !important;
    }
}

.my-modal__body .input_search {
    position: relative;
    width: 100%;
}

.my-modal__body .input_search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.my-modal__body .input__btn-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0cf4c;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #000;
    font-size: 16px;
}

.header__number_container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.header__number_container:last-child {
    border-bottom: none;
}

.header__number_content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header__number_content a {
    color: #333;
    text-decoration: none;
}

.my-modal__footer {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn_primary {
    background: #f0cf4c;
    color: #000;
}

.btn_white {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn_large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn_w100 {
    width: 100%;
}

.link {
    color: #333;
    text-decoration: none;
}

.link.underline {
    text-decoration: underline;
}

.mb-12 {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.p-3 {
    padding: 12px;
}

.d-flex {
    display: flex;
}

/* Стили для мобильного меню (гамбургер) */
.my-modal__head {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.my-modal__head.hidden-search {
    display: none !important;
}

.my-modal__head-text {
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.my-modal__head-text .input_search {
    position: relative;
    width: 100%;
    display: block;
    padding: 0;
    margin: 0;
    z-index: 2;
}

.my-modal__head-text .input_search input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    box-sizing: border-box;
    background: transparent;
    color: #333;
    outline: none;
    transition: none;
    position: relative;
    z-index: 1;
}

.my-modal__head-text .input_search input::placeholder {
    color: #999;
    font-size: 14px;
}

.my-modal__head-text .input_search input:focus {
    border: none;
    outline: none;
}

.my-modal__head-text .input__placeholder {
    display: none;
}

.my-modal__head-text .input__btns {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
    z-index: 3;
}

.my-modal__head-text .input__btn-clear {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s;
}

.my-modal__head-text .input__btn-clear:hover {
    background: #f5f5f5;
    color: #666;
}

.my-modal__head-text .input__btn-search {
    background: #f0cf4c;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #000;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    min-width: 36px;
    height: 36px;
}

.my-modal__head-text .input__btn-search:hover {
    background: #e6c044;
}

.my-modal__head-text .input__btn-search i {
    font-size: 16px;
}

.my-modal__head-close {
    flex-shrink: 0;
}

.my-modal__head-close button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s;
}

.my-modal__head-close button:hover {
    background: #f5f5f5;
}

.my-modal__body-links {
    padding: 0;
}

.header__catalog {
    width: 100%;
    padding: 0;
    margin: 0;
}

.header__catalog-container {
    display: block;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.header__catalog-container.active-catalog-container {
    padding: 0;
}

.header__catalog-container.active-catalog-container .header__catalog_links {
    padding: 0;
}

.header__catalog-container.active-catalog-container .header__catalog_item {
    padding: 14px 16px;
    margin: 0;
}

.header__catalog-container.header-mobile-catalog,
.header__catalog-container.header-mobile-production,
.header__catalog-container.header-mobile-company,
.header__catalog-container.header-mobile-contacts {
    padding: 0 16px;
}

.header__modal_catalog-container {
    padding: 0;
    margin: 0;
}

.header__catalog-container:not(.active-catalog-container) {
    display: none !important;
}

.header__catalog-container.active-catalog-container {
    display: block !important;
}

.header__catalog_links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    width: 100%;
}

.header__catalog_links.header-main-catalog {
    padding: 0;
}

.header__catalog_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

.header__catalog_item:hover {
    background-color: #f8f8f8;
}

.header__catalog_item:last-child {
    border-bottom: none;
}

.header__catalog_item a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header__catalog_item .basket-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__catalog_item .basket-icon i {
    font-size: 18px;
    color: #333;
}

.header__catalog_item .header__basket_count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4444;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__catalog_item .basket__counter {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.header__catalog_item i.fa-chevron-right {
    color: #C1C7D0;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: auto;
}

.header__catalog_item_overlap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.header__catalog_button-prev-menu,
.header__catalog_button-prev {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
    background: #fff;
}

.header__catalog_button-prev-menu button,
.header__catalog_button-prev button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__modal-title {
    margin-bottom: 16px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

.header__modal-title .first-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    padding: 0;
}

.header__modal-title a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.header__catalog_links.header-main-sub-catalog li {
    list-style: none;
    padding: 0;
}

.header__catalog_links.header-main-sub-catalog .header__catalog_item {
    padding: 14px 0;
}

.header__catalog_links.header-main-sub-production .header__catalog_item,
.header__catalog_links.header-main-sub-company .header__catalog_item,
.header__catalog_links.header-main-sub-contacts .header__catalog_item {
    padding: 14px 0;
}

.header__catalog_links.header-main-sub-catalog .header__catalog_item svg {
    flex-shrink: 0;
}

.header__catalog_bottom_button {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.my-modal__footer {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    flex-shrink: 0;
    margin-top: auto;
}

.my-modal__footer:not(.active-catalog-container) {
    display: none;
}

.my-modal__footer.my-modal__footer-city {
    display: flex !important;
    flex-direction: row;
    gap: 12px;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .my-modal__footer.my-modal__footer-city {
        flex-direction: column;
        gap: 12px;
    }
    
    .my-modal__footer.my-modal__footer-city .btn {
        width: 100%;
    }
}

.my-modal__footer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.my-modal__footer-row i {
    color: #666;
    font-size: 18px;
    flex-shrink: 0;
}

.my-modal__footer-row a,
.my-modal__footer-row span {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

.my-modal__footer-row .link-reverse {
    color: #333;
}

.my-modal__footer-row i.fa-chevron-right {
    color: #C1C7D0;
    font-size: 14px;
}

.mobile__compute {
    width: 100%;
    background: #f0cf4c;
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Стили для модального окна выбора города */
.my-modal__footer-city {
    display: flex !important;
    flex-direction: row;
    gap: 12px;
    justify-content: space-between;
    padding: 16px;
}

.my-modal__body .select_city {
    padding: 0;
}

.my-modal__body .select_city__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 0 16px;
    color: #333;
}

.my-modal__body .select_city__cities {
    padding: 0 16px;
    max-height: 400px;
    overflow-y: auto;
}

.my-modal__body .select_city__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.my-modal__body .select_city__item {
    width: 100%;
    margin: 0;
    padding: 0;
}

.my-modal__body .select_city__item_city {
    display: block;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.my-modal__body .select_city__item_city:hover {
    background: #f0cf4c;
    border-color: #f0cf4c;
    color: #000;
}

@media (max-width: 768px) {
    .my-modal__footer-city {
        flex-direction: column;
        gap: 12px;
    }
    
    .my-modal__footer-city .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .my-modal__footer-city .btn_large {
        padding: 12px 20px;
        font-size: 14px;
    }
}

.scroll-style {
    max-height: 400px;
    overflow-y: auto;
}

.scroll-style::-webkit-scrollbar {
    width: 4px;
}

.scroll-style::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.scroll-style::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.scroll-style::-webkit-scrollbar-thumb:hover {
    background: #555;
}
