/* ============================================================
   header-v1.css — стили нового хедера (.hv1)
   Подключается глобально (все страницы с header-v1.php)
   ============================================================ */

/* ── Цветовые токены (локальные) ───────────────────────────────────
   #8DA175 — второй стоп градиента. Отличается от --color-sage-dark: #8FA07C
   на 2 единицы; при уточнении дизайна привести к общему значению.
   ------------------------------------------------------------------ */
:root {
    --gradient-sage: linear-gradient(121.49deg, #A9B995 0%, #8DA175 100%);
}

/* ── Общий враппер ── */

.hv1__wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER v1
   ============================================================ */

.hv1 {
    position: sticky;
    top: 0;
    z-index: 100;
    font-family: "LorenzoSans", Arial, sans-serif;
}

/* ── Топ-бар ── */

.hv1__topbar {
    background: #fff;
}

.hv1__topbar .hv1__wrap {
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0;
}

/* Логотип */

.hv1__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.hv1__logo img {
    display: block;
    filter: brightness(0);
}

.hv1__brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hv1__brand-name {
    font-family: "LorenzoSans", Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-main-color);
}

.hv1__brand-sub {
    font-family: "LorenzoSans", Arial, sans-serif;
    font-weight: 500;
    font-size: 8.5px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-main-color-85);
    max-width: 200px;
}

/* Инфо-блок */

.hv1__topbar-info {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    justify-content: flex-end;
}

.hv1__topbar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "LorenzoSans", Arial, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-main-color-85);
}

.hv1__topbar-address span { max-width: 197px; text-wrap: balance; }
.hv1__topbar-parking span { max-width: 159px; }

.hv1__icon {
    flex-shrink: 0;
}

.hv1__topbar-phone a {
    font-weight: 600;
    font-size: 20px;
    line-height: 1.07;
    letter-spacing: -0.01em;
    color: var(--text-main-color);
    text-decoration: none;
}

.hv1__topbar-phone a:hover {
    color: var(--color-sage);
}

.hv1__item-circle,
.hv1__phone-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(240, 237, 228, 0.5);
    flex-shrink: 0;
}

/* ── Навигация ── */

.hv1__nav {
    background: #fff;
    padding: 6px 20px;
}

.hv1__nav .hv1__wrap {
    background: var(--color-sage);
    border-radius: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 28px;
}

.hv1__menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hv1__menu li a {
    font-family: "LorenzoSans", Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    letter-spacing: -0.005em;
    color: #fff;
    text-decoration: none;
    padding: 3px 0 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity var(--transition-speed);
}

.hv1__menu li a:hover {
    opacity: 0.75;
}

.hv1__menu-has-sub {
    position: relative;
}

/* wp_nav_menu выдаёт .menu-item-has-children для пунктов с подменю */
.hv1__menu .menu-item-has-children {
    position: relative;
}

.hv1__menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-sage);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(28, 28, 28, 0.12);
    min-width: 200px;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    z-index: 200;
}

.hv1__menu .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.hv1__menu .sub-menu li a {
    color: #fff;
    font-size: 13px;
    padding: 9px 18px;
    display: block;
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.hv1__menu .sub-menu li a:hover {
    opacity: 0.75;
}

/* Стрелка у пункта с подменю */
.hv1__menu .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 5px;
    margin-left: 5px;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    flex-shrink: 0;
}


/* Бургер, overlay и sheet скрыты на десктопе */

.hv1__burger  { display: none; }
.hv1__overlay,
.hv1__sheet   { display: none; }

@media (max-width: 768px) {

    html.hv1-sheet-open {
        overflow: hidden;
    }

    /* Шапка фиксирована наверху на мобайле — контент нужно сдвинуть вниз на её высоту.
       z-index 302 — выше overlay (300) и sheet (301), чтобы шторка выезжала из-под шапки. */
    .hv1 {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 6.25vw;
        z-index: 302;
    }

    /* ── Топ-бар ── */

    .hv1__topbar {
        height: auto;
        padding: 0;
    }

    .hv1__topbar .hv1__wrap {
        height: 6.25vw;
        width: 75vw;
        margin: 0 auto;
        flex-wrap: nowrap;
        gap: 0;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }

    /* Скрываем адрес / парковку / часы — оставляем только телефон */
    .hv1__topbar-info .hv1__topbar-item:not(.hv1__topbar-phone) {
        display: none;
    }

    .hv1__topbar-info {
        flex: none;
        gap: 0;
        justify-content: flex-end;
    }

    /* Скрываем иконку телефона — на мобайле только номер */
    .hv1__phone-circle {
        display: none;
    }

    .hv1__topbar-phone a {
        font-size: 3vw;
        font-weight: 600;
        line-height: 1.07;
        letter-spacing: -0.01em;
    }

    .hv1__logo img {
        height: 4.5vw;
        width: auto;
        max-width: 35vw;
    }

    /* ── Бургер ── */

    .hv1__burger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 6.25vw;
        height: 6.25vw;
        border-radius: 50%;
        background: rgba(240, 237, 228, 0.5);
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        margin-left: 3vw;
        position: relative;
        transition: background 0.2s ease, transform 0.15s ease;
    }

    .hv1__burger:active {
        transform: scale(0.88);
        background: rgba(240, 237, 228, 0.9);
    }

    /* ── Десктопная навигация скрыта — меню через bottom sheet ── */

    .hv1__nav { display: none; }

    /* ── Burger: гамбургер ↔ крестик (анимированный) ── */

    .hv1__burger-open,
    .hv1__burger-close {
        position: absolute;
        top: 50%;
        left: 50%;
        transition: opacity 0.22s ease, transform 0.22s ease;
    }

    .hv1__burger-open {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 1;
    }

    .hv1__burger-close {
        transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
        opacity: 0;
    }

    .hv1__burger[aria-expanded="true"] .hv1__burger-open {
        transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
        opacity: 0;
    }

    .hv1__burger[aria-expanded="true"] .hv1__burger-close {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 1;
    }

    /* ── Overlay ── */

    .hv1__overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.38);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .hv1__overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    /* ── Sheet (по умолчанию — top sheet, выезжает из-под шапки сверху вниз) ── */

    .hv1__sheet {
        display: block;
        position: fixed;
        top: 6.25vw;      /* высота мобильной шапки */
        left: 12.5vw;
        right: 12.5vw;
        background: #fff;
        border-radius: 0 0 5vw 5vw;
        z-index: 301;
        transform: translateY(-100%);
        will-change: transform;
        /* используется при закрытии (уход из .is-open) */
        transition: transform 0.28s ease-in;
        max-height: calc(85vh - 6.25vw);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-top: 2vw;
        padding-bottom: calc(2vw + env(safe-area-inset-bottom, 0px));
    }

    .hv1__sheet.is-open {
        transform: translateY(0);
        /* используется при открытии (вход в .is-open) */
        transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    }

    /* ── Bottom sheet — модификатор для открытия снизу вверх ── */

    .hv1__sheet--bottom {
        top: auto;
        bottom: 0;
        border-radius: 5vw 5vw 0 0;
        transform: translateY(100%);
        max-height: 85vh;
        padding-top: 0;
    }

    .hv1__sheet--bottom.is-open {
        transform: translateY(0);
    }

    /* Хэндл: скрыт для top sheet, показан для bottom */

    .hv1__sheet-handle {
        display: none;
        width: 10vw;
        height: 1vw;
        background: var(--color-sage);
        border-radius: 0.5vw;
        margin: 3.5vw auto 1vw;
    }

    .hv1__sheet--bottom .hv1__sheet-handle {
        display: block;
    }

    /* Навигация внутри шита */

    .hv1__sheet-nav { padding: 2vw 0; }

    .hv1__sheet-menu {
        list-style: none;
        margin: 0;
        padding: 0 6vw;
    }

    .hv1__sheet-menu > li {
        border-bottom: 1px solid #E5E9F0;
    }

    .hv1__sheet-menu > li:last-child {
        border-bottom: none;
    }

    .hv1__sheet-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-family: "LorenzoSans", Arial, sans-serif;
        font-weight: 700;
        font-size: 17px;
        line-height: 1.2;
        letter-spacing: -0.005em;
        color: var(--text-main-color);
        text-decoration: none;
        padding: 4vw 2vw;
        margin: 0 -2vw;
        border-radius: 2vw;
        transition: background var(--transition-speed) ease;
    }

    .hv1__sheet-menu > li:not(.menu-item-has-children) > a:active {
        background: linear-gradient(135deg, rgba(169, 185, 149, 0.18) 0%, rgba(150, 168, 130, 0.28) 100%);
    }

    .hv1__sheet-menu .menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 8px;
        height: 5px;
        background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%231C1C1C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .hv1__sheet-menu .menu-item-has-children.is-open > a::after {
        transform: rotate(180deg);
    }

    .hv1__sheet-menu .sub-menu {
        list-style: none;
        margin: 0;
        padding: 0 0 0 3vw;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        /* используется при закрытии */
        transition: max-height 0.22s ease-in, opacity 0.18s ease, padding-bottom 0.22s ease;
    }

    .hv1__sheet-menu .menu-item-has-children.is-open > .sub-menu {
        max-height: 400px;
        opacity: 1;
        padding-bottom: 2vw;
        /* используется при открытии */
        transition: max-height 0.38s ease-out, opacity 0.28s ease, padding-bottom 0.38s ease;
    }

    .hv1__sheet-menu .sub-menu li a {
        display: block;
        font-family: "LorenzoSans", Arial, sans-serif;
        font-weight: 600;
        font-size: 14px;
        color: var(--text-main-color-85);
        text-decoration: none;
        padding: 2.5vw 0;
        border-bottom: 1px solid #E5E9F0;
        transition: color var(--transition-speed) ease;
    }

    .hv1__sheet-menu .sub-menu li a {
        border-radius: 1.5vw;
        margin: 0 -1.5vw;
        padding-left: 1.5vw;
        padding-right: 1.5vw;
    }

    .hv1__sheet-menu .sub-menu li a:active {
        background: linear-gradient(135deg, rgba(169, 185, 149, 0.18) 0%, rgba(150, 168, 130, 0.28) 100%);
    }

    .hv1__sheet-menu .sub-menu li:last-child a {
        border-bottom: none;
    }

    /* Footer шита */

    .hv1__sheet-footer {
        display: none;
    }

}
