/* ==========================================================================
   Шапка сайта в стиле hoff.ru
   Подключается после mmain.css / main11.css / main3.css
   ========================================================================== */

/* --- Верхняя тонкая серая полоса ------------------------------------------ */
.topbar {
    position: relative;
    z-index: 52;
    background: #f2f3f5;
    border-bottom: 1px solid #e4e7eb;
    color: #6b7280;
    font-size: 13px;
    line-height: 1;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 36px;
    padding: 0 24px;
    margin: 0 auto;
}

.topbar__links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.topbar__links a,
.topbar__email,
.topbar__address {
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.topbar__links a:hover,
.topbar__email:hover,
.topbar__address:hover {
    color: #d51932;
}

.topbar__email,
.topbar__address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar__email svg,
.topbar__address svg {
    width: 13px;
    height: 13px;
    color: #9aa1ac;
    flex: 0 0 auto;
    transition: color 0.15s ease;
}

.topbar__email:hover svg,
.topbar__address:hover svg {
    color: #d51932;
}

.topbar__phones {
    display: flex;
    align-items: center;
}

.topbar__phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.topbar__phone + .topbar__phone {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #d7dbe0;
}

.topbar__phone:hover {
    color: #d51932;
}

.topbar__phone svg {
    width: 14px;
    height: 14px;
    color: #9aa1ac;
    transition: color 0.15s ease;
}

.topbar__phone:hover svg {
    color: #d51932;
}

/* --- Основная строка шапки ------------------------------------------------ */
.header--hoff {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 76px;
    min-height: 76px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid #e4e7eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: relative;
    top: 0;
    z-index: 51;
}

.header--hoff .container-logo {
    position: static;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: auto;
    margin: 0;
}

.header--hoff .logo {
    position: static;
    display: flex;
    align-items: center;
    height: auto;
    padding: 0;
    overflow: visible;
}

.header--hoff .logo img {
    position: static;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 0;
    transform: none;
}

/* Поиск в шапке */
.header--hoff .header-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
    margin: 0 auto;
}

.header--hoff .search {
    display: block;
    position: relative;
    z-index: 52;
    margin: 0;
    padding: 0;
}

.header--hoff .search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 6px 0 16px;
    border: 1px solid #e3e7ec;
    border-radius: 10px;
    background: #f6f7f9;
    box-sizing: border-box;
}

.header--hoff .search-form:focus-within {
    border-color: #cfd5dd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(213, 25, 50, 0.06);
}

.header--hoff .search-form input.autocomplete-input {
    flex: 1 1 auto;
    width: auto;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f2937;
    font-size: 15px;
    outline: none;
    box-shadow: none;
}

.header--hoff .search-form input.autocomplete-input::placeholder {
    color: #9aa1ac;
}

.header--hoff .search-form-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}

.header--hoff .search-form-btn:hover {
    background: #eceef2;
    color: #d51932;
}

.header--hoff .search-form-btn svg {
    width: 18px;
    height: 18px;
}

.header--hoff .search-form .search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    max-height: 420px;
    margin: 0;
    padding: 8px;
    border: 1px solid #e3e7ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: opacity 0.15s ease;
    z-index: 60;
}

.header--hoff .search-form .search-results.visible {
    opacity: 1;
    visibility: visible;
}

.header--hoff .search-results .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
}

.header--hoff .search-results .item:hover {
    background: #f6f7f9;
}

.header--hoff .search-results .item .name a {
    color: #1f2937;
}

.header--hoff .search-results .item .price {
    color: #6b7280;
    white-space: nowrap;
}

/* Блок действий справа */
.header--hoff .container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    width: auto;
    height: auto;
    margin: 0 0 0 auto;
}

.header--hoff .container .favorite,
.header--hoff .container .login:not(.login--mobile),
.header--hoff .container .cart {
    display: flex;
    align-items: center;
}

.header--hoff .container .favorite > a,
.header--hoff .container .login > a,
.header--hoff .container .cart > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #1f2937;
    text-decoration: none;
}

.header--hoff .container .favorite svg,
.header--hoff .container .login svg,
.header--hoff .container .cart .cart-icon-wrap > svg {
    width: 26px !important;
    height: 26px !important;
    color: #1f2937;
    transition: color 0.15s ease;
}

.header--hoff .container .favorite:hover svg,
.header--hoff .container .login:hover svg,
.header--hoff .container .cart:hover .cart-icon-wrap > svg {
    color: #d51932;
}

.header--hoff .container .favorite .box-header-title,
.header--hoff .container .login .box-header-title,
.header--hoff .container .cart .box-header-title {
    padding: 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.1;
}

.header--hoff .container .cart .cart-icon-wrap {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}

.header--hoff .container .cart #basket {
    padding-left: 0 !important;
}

.header--hoff .container .cart:hover .box-header-title,
.header--hoff .container .login:hover .box-header-title,
.header--hoff .container .favorite:hover .box-header-title {
    color: #d51932;
}

/* Бургер показываем только на мобильных */
.header--hoff .wrapper {
    display: none;
}

/* Шапка всегда висит сверху: фиксируем её и освобождаем место в потоке.
   Высота шапки вычисляется скриптом (учитывает мобильный режим и свёрнутый поиск). */
header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
}

body {
    padding-top: var(--site-header-h, 112px);
}

/* На десктопе мобильная иконка входа не нужна (иначе дублируется) */
@media (min-width: 768px) {
    .header--hoff .login--mobile {
        display: none !important;
    }
}

/* Левое меню всегда начинается под фиксированной шапкой и не уезжает под неё */
.nav-side,
.nav-side.bottom-stick {
    top: var(--site-header-h, 112px) !important;
    bottom: auto !important;
    height: calc(100% - var(--site-header-h, 112px)) !important;
    padding-top: 0 !important;
}

/* Отступ от шапки до хлебных крошек */
.content .breadcrumbs,
.content ol.breadcrumb {
    margin-top: 20px;
}

/* --- Мобильная версия ----------------------------------------------------- */
@media (max-width: 767px) {
    .topbar__inner {
        height: 36px;
        padding: 0 10px;
        gap: 8px;
    }

    .topbar__links,
    .topbar__address {
        display: none;
    }

    .topbar__right {
        width: 100%;
        justify-content: center;
        gap: 12px;
        margin: 0;
    }

    .topbar__email {
        display: inline-flex;
        gap: 4px;
        font-size: 12px;
    }

    .topbar__email svg {
        width: 12px;
        height: 12px;
    }

    .topbar__phones {
        justify-content: center;
    }

    .topbar__phone {
        font-size: 12px;
        gap: 4px;
    }

    .topbar__phone + .topbar__phone {
        margin-left: 8px;
        padding-left: 8px;
    }

    .topbar__phone svg {
        width: 12px;
        height: 12px;
    }

    .header--hoff {
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        min-height: 0;
        gap: 6px 8px;
        padding: 10px 12px 0;
    }

    /* При скролле поиск сворачивается, чтобы шапка не занимала пол-экрана */
    .header--hoff .header-search {
        max-height: 60px;
        opacity: 1;
        transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
    }

    header.site-header.is-compact .header--hoff .header-search {
        max-height: 0;
        opacity: 0;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }

    .header--hoff .container .login:not(.login--mobile) {
        display: none;
    }

    .header--hoff .wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 1;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        flex: 0 0 auto;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .header--hoff .wrapper .burger {
        position: relative;
        display: block;
        width: 22px;
        height: 16px;
    }

    .header--hoff .wrapper .burger span {
        position: absolute;
        left: 0;
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: #1f2937;
        transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
    }

    .header--hoff .wrapper .burger span:nth-child(1) {
        top: 0;
    }

    .header--hoff .wrapper .burger span:nth-child(2) {
        top: 7px;
    }

    .header--hoff .wrapper .burger span:nth-child(3) {
        top: 14px;
    }

    /* Открытое меню: бургер превращается в крестик */
    .header--hoff .wrapper:not(.collapsed) .burger span:nth-child(1) {
        top: 7px;
        transform: rotate(45deg);
    }

    .header--hoff .wrapper:not(.collapsed) .burger span:nth-child(2) {
        opacity: 0;
    }

    .header--hoff .wrapper:not(.collapsed) .burger span:nth-child(3) {
        top: 7px;
        transform: rotate(-45deg);
    }

    .header--hoff .container-logo {
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }

    .header--hoff .logo {
        width: auto;
        max-width: 100%;
        margin: 0;
        min-width: 0;
    }

    .header--hoff .logo img {
        width: 112px;
    }

    .header--hoff .login--mobile {
        display: inline-flex;
        align-items: center;
        margin: 0;
    }

    .header--hoff .login--mobile svg {
        width: 24px;
        height: 24px;
        color: #1f2937;
    }

    .header--hoff .login--mobile .box-header-title {
        display: none;
    }

    .header--hoff .container .favorite {
        display: flex;
    }

    .header--hoff .container .favorite .box-header-title,
    .header--hoff .container .cart .box-header-title {
        display: none;
    }

    .header--hoff .container .favorite svg,
    .header--hoff .container .cart .cart-icon-wrap > svg {
        width: 24px !important;
        height: 24px !important;
        color: #1f2937;
    }

    .header--hoff .container .cart .cart-icon-wrap {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
    }

    .header--hoff .container {
        order: 4;
        align-items: center;
        gap: 14px;
        margin: 0;
        flex: 0 0 auto;
    }

    /* Иконки в один ряд: одинаковая высота, единый центр по вертикали */
    .header--hoff .container .favorite,
    .header--hoff .container .login--mobile,
    .header--hoff .container .cart {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        margin: 0;
        padding: 0;
    }

    .header--hoff .container .favorite > a,
    .header--hoff .container .login--mobile > a,
    .header--hoff .container .cart > a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin: 0;
        padding: 0;
        gap: 0;
    }

    .header--hoff .container .cart {
        padding-top: 0 !important;
    }

    .header--hoff .container .cart .cart-link {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header--hoff .container .favorite svg,
    .header--hoff .container .login--mobile svg,
    .header--hoff .container .cart .cart-icon-wrap > svg {
        display: block;
        width: 24px !important;
        height: 24px !important;
        color: #1f2937;
    }

    .header--hoff .header-search {
        order: 5;
        flex: 1 0 100%;
        max-width: none;
        margin: 2px 0 10px;
    }

    .header--hoff .search-form {
        height: 42px;
        padding-left: 12px;
    }

    .content .breadcrumbs,
    .content ol.breadcrumb {
        margin-top: 14px;
    }
}

/* Очень узкие экраны: экономим место в серой полосе */
@media (max-width: 340px) {
    .topbar__right {
        gap: 8px;
    }

    .topbar__email span {
        display: none;
    }

    .topbar__phone {
        font-size: 11px;
        gap: 3px;
    }

    .topbar__phone + .topbar__phone {
        margin-left: 6px;
        padding-left: 6px;
    }

    .topbar__phone svg,
    .topbar__email svg {
        width: 11px;
        height: 11px;
    }
}
