/**
 * Кастомные стили сайта
 */

/* Убираем padding слева и справа у второго элемента в правых иконках хедера */
#header > div > div.logo_and_menu-row.with-search.header__top-part > div > div > div.right-icons.wb.header__top-item > div > div:nth-child(2) > a {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Убираем padding слева и справа у третьего элемента в правых иконках хедера */
#header > div > div.logo_and_menu-row.with-search.header__top-part > div > div > div.right-icons.wb.header__top-item > div > div:nth-child(3) > a {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Убираем padding слева и справа у корзины */
#header > div > div.logo_and_menu-row.with-search.header__top-part > div > div > div.right-icons.wb.header__top-item > div > div.wrap_icon.wrap_basket.baskets.line-block__item.top_basket > a {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Увеличиваем ширину поля поиска адаптивно */
#title-search_fixed > form > div.search-input-div {
    flex: 1 1 auto !important; /* Занимает доступное пространство */
    max-width: 400px !important; /* Максимальная ширина */
    min-width: 250px !important; /* Минимальная ширина */
    margin-right: 20px !important; /* Отступ до блока мессенджеров */
}

/* Убираем margin слева и справа у блока мессенджеров */
#header > div > div.logo_and_menu-row.with-search.header__top-part > div > div > div.header__top-item.messengers-block {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Стилизация меню "Системная интеграция" в виде grid-сетки (как "Продукция") */

/* Убираем flexbox layout у menu-navigation и делаем блочным */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation {
    display: block !important;
    height: auto !important;
}

/* Скрываем правую часть с контентом (она пустая для services) */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__content {
    display: none !important;
}

/* Sections wrapper занимает всю ширину */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-wrapper {
    width: 100% !important;
    border: none !important;
    padding: 30px 40px !important;
}

/* Убираем scrollbar */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-wrapper .scrollblock {
    overflow: visible !important;
}

/* Превращаем вертикальный список в grid-сетку 4 колонки */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 32px 20px !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Стилизация каждого элемента как карточки */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item {
    display: block !important;
    text-align: center !important;
}

/* Ссылка в виде колонки: иконка сверху, текст снизу */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-decoration: none !important;
    padding: 0 !important;
    position: static !important;
    min-height: auto !important;
}

/* Скрываем стрелку */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .svg-inline-right {
    display: none !important;
}

/* Контейнер иконки - фиксированный размер сверху */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    margin: 0 auto 10px !important;
    padding: 0 !important;
}

/* Иконки одинакового размера - перекрываем встроенные размеры SVG */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image img,
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image svg,
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image .svg svg {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    object-fit: contain !important;
}

/* Перекрываем встроенные атрибуты width/height у SVG */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image svg[width],
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image svg[height] {
    width: 60px !important;
    height: 60px !important;
}

/* SVG обёртка */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image .svg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
}

/* Внутренние SVG элементы внутри .svg обёртки */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image .svg > svg {
    width: 100% !important;
    height: 100% !important;
}

/* Дополнительные правила для всех вложенных SVG */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image * {
    max-width: 60px !important;
    max-height: 60px !important;
}

/* Убираем встроенные стили у path внутри SVG */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image svg path,
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .image svg g {
    vector-effect: non-scaling-stroke;
}

/* Текст под иконкой - не в table-cell */
.mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections-item-link .name {
    display: block !important;
    text-align: center !important;
    font-weight: bold !important;
    line-height: 1.4 !important;
    padding: 0 !important;
    white-space: normal !important;
}

/* Адаптивность для меньших экранов */
@media (max-width: 1400px) {
    .mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1200px) {
    .mega-menu .menu-item.wide_menu a[href*="/services/"] ~ .dropdown-menu .menu-navigation__sections {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Скрыть блок "О компании" на мобильных устройствах */
@media (max-width: 991px) {
    .custom-company-block {
        display: none !important;
    }
}

/* Уменьшаем отступы между блоками "Наши проекты" и "3D туры" */
.drag-block.container.RECOMMENDED_PROJECTS_CUSTOM > div {
    margin-bottom: 20px !important; /* Уменьшенный отступ снизу (было 60px) */
    padding-bottom: 0 !important; /* Убираем padding снизу */
}

.drag-block.container.CUSTOM_3D_TOURS > div {
    margin-top: 0 !important; /* Убираем margin сверху */
    padding-top: 0 !important; /* Убираем padding сверху */
}

.drag-block.container.CUSTOM_3D_TOURS > div > div {
    padding-top: 0 !important; /* Убираем padding сверху у вложенного элемента */
}

/* Скрываем блок с соцсетями и хлебные крошки на страницах проектов */
body:has(.detail.projects_custom) #content > div.top-block-wrapper > section > div.topic,
body:has(.detail.projects_custom) #navigation {
    display: none !important;
}

/* Скрываем блок карты на страницах проектов, если карта не заполнена */
body:has(.detail.projects_custom) .detail-block.ordered-block.map.contacts-page-map {
    display: none !important;
}

/* Стилизация текста "По запросу" как обычной цены на детальной странице */
.cost.prices.detail.prices_block .price .price_value {
    font-size: 26px !important;
    font-weight: 700 !important;
    font-family: Montserrat, Arial, sans-serif !important;
    color: #555555 !important;
    line-height: 1.45 !important;
}

/* Стилизация текста "По запросу" на странице каталога (список товаров) */
.catalog_item .item_info .cost.prices.clearfix .price .price_value {
    font-size: 17px !important;
    font-weight: 700 !important;
    font-family: Montserrat, Arial, sans-serif !important;
    color: #555555 !important;
    line-height: 24.71px !important;
    display: inline-block !important;
}

