/* Подсказки поиска.
   ВАЖНО: bootstrap 3 задаёт html {font-size:10px}, поэтому все rem-значения
   были бы в 1.6 раза меньше задуманного. Используем px. */
.search-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-width: 460px;
    min-width: 340px;
    width: auto;
    z-index: 1000;
    margin-top: 4px;
    max-height: 600px;
    overflow-y: auto;
}
.search-suggestion-item {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    align-items: center;
}
.search-suggestion-item:hover {
    background-color: #f5f5f5;
}
.suggestion-img {
    flex: 0 0 88px;
    margin-right: 14px;
}
.suggestion-img img {
    max-width: 88px;
    max-height: 88px;
    object-fit: contain;
}
.suggestion-info {
    flex: 1;
    min-width: 0;
}
.suggestion-name {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.3;
    color: #333;
}
.suggestion-price .old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
    font-size: 14px;
}
.suggestion-price .current-price {
    font-weight: bold;
    color: #d9534f;
    font-size: 18px;
}
.in-stock {
    color: green;
    font-size: 13px;
    margin-left: 8px;
}
.out-of-stock {
    color: rgb(114, 111, 111);
    font-size: 13px;
    margin-left: 8px;
}
.suggestion-dimensions {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}
.search-suggestion-empty {
    padding: 14px;
    text-align: center;
    color: #666;
    font-size: 15px;
}

/* Текстовые подсказки (фразы из логов поиска) */
.search-phrases {
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}
.search-phrase-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    cursor: pointer;
    color: #333;
    font-size: 16px;
}
.search-phrase-item:hover {
    background-color: #f5f5f5;
}
.phrase-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-right: 12px;
    position: relative;
}
.phrase-icon::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 1px;
    width: 9px;
    height: 9px;
    border: 1.5px solid #999;
    border-radius: 50%;
}
.phrase-icon::after {
    content: '';
    position: absolute;
    right: 0px;
    bottom: 0px;
    width: 5px;
    height: 1.5px;
    background: #999;
    transform: rotate(45deg);
}
.phrase-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-products-header {
    padding: 8px 14px 2px 14px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
}

/* Стили для формы расширенного поиска */
.dis-search-adv-filters {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}
.dis-search-adv-filters .row {
    margin-bottom: 15px;
}
.dis-search-adv-filters .control-label {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}
.dis-search-adv-filters .input-group {
    width: 100%;
}
.dis-search-adv-filters .search-adv-field {
    border-radius: 4px 0 0 4px;
    height: 34px;
}
.dis-search-adv-filters .input-group-btn .close {
    /*padding: 6px 12px;*/
    font-size: 20px;
    line-height: 1.2;
    background-color: #f2f2f2;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: red;
    /*opacity: 0.7;*/
    display: inline-block !important;
    visibility: visible !important;
    opacity: 0.6;
}
.dis-search-adv-filters .input-group-btn .close:hover {
    opacity: 1;
    background-color: #e6e6e6;
}
.dis-search-adv-filters .form-inline label {
    margin-right: 8px;
}
.dis-search-adv-filters .form-inline input {
    margin-right: 5px;
}
.dis-search-adv-filters button[type="submit"] {
    background-color: #da6139;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
}
.dis-search-adv-filters button[type="submit"]:hover {
    background-color: #b04d2c;
}
.dis-search-adv-filters {
    display: none;
}
.dis-search-adv-filters.visible {
    display: block;
}
/* Горизонтальное меню с картинками */
.dropdown-large .dropdown-menu {
    min-width: 400px;
    max-width: 800px;
    padding: 10px;
}
.dropdown-submenu {
    position: relative;
}
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
}
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}
.dropdown-submenu > a:after {
    content: "\f0da";
    font-family: FontAwesome;
    float: right;
    margin-right: 10px;
}
.menu-img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    margin-right: 8px;
    border-radius: 4px;
}
.badge {
    background-color: #da6139;
    margin-left: 5px;
    font-size: 10px;
}

/* карточка товара название блоков */
/* Общий стиль для заголовков блоков */
.block-header {
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 2px solid #da6139; /* цвет подчеркивания как у меню */
    padding-bottom: 6px;
    margin: 20px 0 15px 0;
    display: inline-block;
}
/* Ссылка внутри заголовка (если есть) */
.block-header a {
    color: #0d4680;
    text-decoration: none;
}
.block-header a:hover {
    text-decoration: underline;
}
/* Выравнивание вывода карточек в шаблоне _section_card.html */
.row-equal-height {
    display: flex;
    flex-wrap: wrap;
}
.row-equal-height .card1 {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.row-equal-height .card1 .styleLikeH4 {
    flex-grow: 1;
    /* Если нужно, добавить отступ снизу для красоты */
    margin-bottom: 10px;
}
/* Товарные карточки на главной: фиксируем высоту фото и выравниваем
   caption по низу, чтобы блоки не «плясали» из-за разной длины названия,
   наличия бейджа «на складе»/«размеры» и т.п. */
.row-equal-height.home-cards .card1 > a {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.row-equal-height.home-cards .card1 > a .styleLikeH4 {
    flex-grow: 0;
}
.row-equal-height.home-cards .card1 > a img {
    height: 130px;
    width: 100%;
    object-fit: contain;
    margin: auto;
}
.row-equal-height.home-cards .card1 .caption {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: 10px;
}
.row-equal-height.home-cards .card1 .caption .list-inline {
    margin-top: auto;
    padding-top: 10px;
    margin-bottom: 0;
}

/* Адаптив подсказок поиска */

/* Мобильные (xs, до 767px): окно на всю ширину экрана, без вылетов за край */
@media (max-width: 767px) {
    .search-suggestions {
        width: 100vw;
        max-width: none;
        min-width: 0;
        left: 0;
        right: 0;
        margin-top: 4px;
        max-height: 60vh;
    }
    .search-phrase-item {
        padding: 14px 16px;
        font-size: 17px;
    }
    .search-phrase-item:hover {
        background-color: #e9e9e9;
    }
    .search-products-header {
        padding: 10px 16px 4px 16px;
        font-size: 14px;
    }
    .search-suggestion-item {
        padding: 14px 16px;
    }
    .suggestion-img {
        flex: 0 0 72px;
        margin-right: 14px;
    }
    .suggestion-img img {
        max-width: 72px;
        max-height: 72px;
    }
    .suggestion-name {
        font-size: 16px;
    }
    .suggestion-price .current-price {
        font-size: 18px;
    }
    .in-stock, .out-of-stock {
        font-size: 14px;
    }
    .suggestion-dimensions {
        font-size: 14px;
    }
}

/* Крупные мониторы (>=1200px): подсказки ещё крупнее */
@media (min-width: 1200px) {
    .search-suggestions {
        max-width: 500px;
        max-height: 650px;
    }
    .search-phrase-item {
        font-size: 18px;
        padding: 12px 16px;
    }
    .suggestion-img {
        flex: 0 0 96px;
        margin-right: 16px;
    }
    .suggestion-img img {
        max-width: 96px;
        max-height: 96px;
    }
    .suggestion-name {
        font-size: 17px;
    }
    .suggestion-price .current-price {
        font-size: 20px;
    }
    .suggestion-price .old-price {
        font-size: 15px;
    }
    .in-stock, .out-of-stock {
        font-size: 14px;
    }
}

/* Блок «Вы смотрели»: фиксированное фото без искажений.
   Bootstrap задаёт img{max-width:100%!important}, из-за чего фото
   в узком сайдбаре сжималось. object-fit: contain сохраняет пропорции. */
.viewed-product-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: 4px 0;
}
.viewed-product-link:hover {
    text-decoration: none;
    color: #da6139;
}
.viewed-product-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin-right: 10px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}
.viewed-product-name {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    font-size: 13px;
    overflow-wrap: break-word;
}