@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

/* =========================================================================
   Sticky-шапка
   — position: sticky на всех экранах (десктоп + мобилка).
   — overflow-x: clip вместо hidden — не ломает sticky.
   — Класс .is-stuck вешается JS'ом при scrollY > 60.
   ========================================================================= */

html, body {
    overflow-x: clip !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 100% !important;
    transform: none !important;
    filter: none !important;
}

.header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #fff;
    transition: box-shadow .25s cubic-bezier(.4, 0, .2, 1),
                padding     .25s cubic-bezier(.4, 0, .2, 1);
}

.header.fixed {
    position: sticky !important;
    top: 0 !important;
}

.header.is-stuck {
    box-shadow: 0 4px 20px rgba(25, 24, 23, .06);
}

@media (min-width: 681px) {
    .header.is-stuck {
        padding: 8px 0;
    }

    .header .header__top {
        overflow: hidden;
        max-height: 60px;
        transition: max-height .25s cubic-bezier(.4, 0, .2, 1),
                    margin-bottom .25s cubic-bezier(.4, 0, .2, 1),
                    opacity       .2s  cubic-bezier(.4, 0, .2, 1);
    }

    .header.is-stuck .header__top {
        max-height: 0;
        margin-bottom: 0;
        opacity: 0;
        pointer-events: none;
    }
}

@media (min-width: 1025px) {
    .header__middle {
        transition: margin-bottom .25s cubic-bezier(.4, 0, .2, 1);
    }

    .header.is-stuck .header__middle {
        margin-bottom: 14px;
    }
}

.header {
    padding: 15px 0;
    max-width: 1700px;
    margin: 0 auto;
}

.custom-container_header {
    margin: 0 150px;
}

.custom-container_header p {
    margin: 0;
}

.header__top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.header__top-left,
.header__top-right {
    display: flex;
    gap: 15px;
}

.header__info-wrapper {
    display: flex;
    align-items: center;
    gap: 7px;
}

.header__info-wrapper img {
    width: 14px;
    height: 14px;
}

.header__text {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    color: #B9B9B9;
}

.header__phone:hover {
    color: #B9B9B9;
}

.header__text_underline {
    text-decoration: underline;
    cursor: pointer;
}

.header__middle {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 27px;
    position: relative;
}

.header__middle-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
    position: relative;
}

.header__middle-buttons,
.header__middle-buttons_mobile {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header__middle-buttons_tablet,
.header__middle-buttons_mobile {
    display: none;
}

.header__middle-button {
    font-family: 'Helvetica Neue Cyr Medium', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header__middle-button-caption {
    margin: 0;
}

.header__middle-button img {
    width: 28px;
    height: 28px;
}

.header__middle-button_basket-icon img {
    width: 35px;
    height: 28px;
}

.header__middle-button_hide img {
    display: none;
}

.header__middle-button_text {
    color: #262729;
    font-size: 18px;
    line-height: 100%;
}

.header__logo-wrapper {
    display: block;
    width: 300px;
    height: 38px;
}

.header__logo-wrapper img {
    width: 100%;
    height: 100%;
}

.header__search-wrapper {
    display: flex;
    flex: 1;
    position: relative;
}

.header__search-wrapper_mobile {
    position: absolute;
    left: 0;
    right: 50px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.header__search-button {
    width: 26px;
    height: 26px;
}

.header__search-button img {
    width: 100%;
    height: 100%;
}

.header__basket {
    position: relative;
}

.header__basket-quantity-wrapper {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #FF95AA;
}

.header__basket-quantity {
    color: white;
    font-size: 16px;
    line-height: 100%;
    font-weight: 500;
}

.header__bottom {
    margin: 0 150px;
    position: relative;
    min-height: 1px;
}

.header__bottom .submenu {
    width: 100%;
    top: 100%;
    background: #fff;
    border-top: 2.5px solid #C42030;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    gap: 0;
    animation: submenuIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes submenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Columns */
.header__bottom .submenu > li,
.header__bottom .submenu > div {
    flex: 1;
    padding: 0 20px;
    border-right: 1px solid #f0eded;
    min-width: 0;
}

.header__bottom .submenu > li:first-child,
.header__bottom .submenu > div:first-child {
    padding-left: 0;
}

.header__bottom .submenu > li:last-child,
.header__bottom .submenu > div:last-child {
    border-right: none;
    padding-right: 0;
}

/* Column heading */
.header__bottom .submenu > li > a,
.header__bottom .submenu > div > a {
    display: block;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #C42030 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #f0eded;
    text-decoration: none;
}

/* Sub-items */
.header__bottom .submenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.header__bottom .submenu ul li {
    list-style: none;
}

.header__bottom .submenu ul a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: #4a4a4a;
    text-decoration: none;
    transition: color 0.15s, padding-left 0.2s;
    line-height: 1.4;
}

.header__bottom .submenu ul a:hover {
    color: #C42030;
    padding-left: 4px;
}

/* Hide Популярные in mixed submenus (Букеты, Розы, Цветы, Композиции) */
.header__bottom .submenu:has(.with-childrens) > .menuCatalogLevel2.without-childrens {
    display: none !important;
}

/* Submenu product card */
.header__bottom .submenu .menu_elem_cart {
    position: static;
    right: auto;
    flex: 0 0 200px;
    padding: 0 0 0 20px;
    border-left: 1px solid #f0eded;
    display: flex;
    align-items: flex-start;
}

.header__bottom .submenu .catalog__item {
    width: 100%;
    max-width: 200px;
}

.header__bottom .submenu .catalog__content {
    height: auto !important;
    min-height: 0 !important;
    background: none;
    border: none;
    border-radius: 0;
    overflow: visible;
    display: block;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.header__bottom .submenu .catalog__content:hover {
    height: auto !important;
    min-height: 0 !important;
    border: none;
}

.header__bottom .submenu .catalog__content img.catalog__image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    margin-bottom: 6px;
}

.header__bottom .submenu .catalog__content br {
    display: none;
}

.header__bottom .submenu .catalog__name {
    font-size: 13px;
    line-height: 1.3;
    color: #3a3a3a;
    text-decoration: none;
    display: block;
    margin: 0 0 4px 0;
}

.header__bottom .submenu .catalog__name:hover {
    color: #C42030;
}

.header__bottom .submenu .catalog__price {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    color: #262729;
    display: block;
    margin: 0 0 6px 0;
}

.header__bottom .submenu .catalog__button {
    display: block;
    padding: 8px 16px;
    background: #C42030;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    text-align: center;
    width: 100%;
    margin: 0;
}

.header__bottom .submenu .catalog__button:hover {
    background: #a81a28;
    color: #fff;
}

/* Compact layout for items without sub-categories (Повод, Подарки) */
.header__bottom .submenu .menuCatalogLevel2.without-childrens {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    border-right: none !important;
    break-inside: avoid;
}

.header__bottom .submenu .menuCatalogLevel2.without-childrens > a {
    display: block !important;
    padding: 7px 16px !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #4a4a4a !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none;
    transition: color 0.15s, padding-left 0.2s;
    white-space: nowrap;
}

.header__bottom .submenu .menuCatalogLevel2.without-childrens > a:hover {
    color: #C42030 !important;
    background: none !important;
}

/* Submenu containing ONLY simple links: compact 3-column grid on hover (desktop only) */
@media (min-width: 993px) {
    .header__bottom-list li:has(> .submenu:has(.without-childrens):not(:has(.with-childrens))) {
        position: relative;
    }

    .header__bottom-list li:hover > .submenu:has(.without-childrens):not(:has(.with-childrens)) {
        display: block !important;
        columns: 3;
        column-gap: 12px;
        width: auto !important;
        min-width: 300px;
        max-width: 750px;
        padding: 16px 12px !important;
        left: auto;
        right: 0;
    }
}

@keyframes submenuInCompact {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.header__bottom-list {
    list-style-type: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.header__bottom-list li {
    display: block;
    height: 100%;
    list-style-type: none;
}

.header__menu-link {
    font-family: 'Helvetica Neue Cyr Medium', Arial, sans-serif;
    font-weight: 500;
    color: #3a3a3a;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    padding: 0 16px;
    transition: color 0.25s;
    letter-spacing: -0.01em;
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2.5px;
    background: #C42030;
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header__menu-link:hover {
    color: #C42030;
    text-decoration: none;
}

.header__menu-link:hover::after {
    transform: scaleX(1);
}

.header__menu-link_fast-delivery {
    padding: 10px 24px;
    border: none;
    border-radius: 12px;
    background-color: #C42030;
    font-weight: 700;
    color: #FFFFFF;
    margin-right: 8px;
    transition: background-color 0.2s, transform 0.15s;
}

.header__menu-link_fast-delivery:hover {
    background-color: #a81a28;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.header__menu-link_fast-delivery::after {
    display: none;
}

.header__menu-link,
.header__menu-link_fast-delivery {
    font-size: 17px;
    line-height: 100%;
}

@media (min-width: 1279px) {
    .header__bottom-list li:hover .submenu {
        display: flex;
    }
}

@media (max-width: 1440px) {
    .header__top {
        margin-bottom: 10px;
    }

    .header__middle {
        margin-bottom: 20px;
    }

    .header__search-button {
        width: 21px;
        height: 21px;
    }

    .custom-container_header,
    .header__bottom {
        margin: 0 120px;
    }

    .header__menu-link,
    .header__menu-link_fast-delivery {
        font-size: 16px;
    }

    .header__bottom-list {
        height: 48px;
    }
}

@media (max-width: 1280px) {
    .custom-container_header,
    .header__bottom {
        margin: 0 100px;
    }

    .header__middle {
        margin-bottom: 15px;
    }
}

@media (max-width: 1060px) {
    .custom-container_header,
    .header__bottom {
        margin: 0 75px;
    }

    .header__logo-wrapper {
        width: 204px;
        height: 26px;
    }

    .header__middle-button_text {
        font-size: 18px;
    }

    .header__top-left,
    .header__top-right {
        gap: 12px;
    }

    .header__menu-link,
    .header__menu-link_fast-delivery {
        font-size: 16px;
    }
}

@media (max-width: 1024px) {
    .header__top-right {
        display: none;
    }

    .header__middle {
        margin-bottom: 10px;
    }

    .header__middle,
    .header__middle-left {
        gap: 25px;
    }

    .header__middle-buttons,
    .header__middle-button-caption {
        display: none;
    }

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

    .header__middle-button_text {
        font-size: 16px;
    }

    .header__middle-button img {
        width: 24px;
        height: 24px;
    }

    .header__middle-button_basket-icon img {
        width: 31px;
        height: 24px;
    }

    .header__basket-quantity-wrapper {
        width: 24px;
        height: 24px;
    }

    .header__bottom-list {
        gap: 10px;
    }
}

@media screen and (max-width: 1024px) and (min-height: 1024px) {
    .header__menu-link,
    .header__menu-link_fast-delivery {
        font-size: 16px;
    }

    .header__bottom {
        margin: 0;
    }

    .header__bottom-list {
        overflow-x: auto;
        padding: 0 75px;
        flex-wrap: nowrap;
        gap: 16px;
        justify-content: flex-start;
    }

    .header__bottom-list::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 992px) {
    .custom-container_header {
        margin: 0 50px;
    }

    .header__menu-link,
    .header__menu-link_fast-delivery {
        font-size: 16px;
    }

    .header__bottom {
        margin: 0;
        padding-top: 10px;
    }

    .header__bottom-list {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 50px;
        gap: 16px;
    }

    .header__bottom-list::-webkit-scrollbar {
        display: none;
    }

    /* Hide dropdown submenus on mobile/tablet */
    .header__bottom .submenu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .custom-container_header {
        margin: 0 15px;
    }

    .header__logo-wrapper {
        width: 245px;
        height: 31px;
    }

    .header__bottom-list {
        gap: 12px;
        padding: 0 15px;
    }
}

@media (max-width: 680px) {
    .header {
        padding: 0 0 5px;
    }

    .header__logo-wrapper {
        width: 188px;
        height: 24px;
    }

    .header__visible {
        opacity: 1;
        pointer-events: all;
    }

    .header__hide {
        opacity: 0;
        pointer-events: none;
    }

    .header__top {
        display: none;
    }

    .header__basket {
        position: static;
    }

    .header__basket-quantity-wrapper {
        width: 24px;
        height: 24px;
    }

    .header__burger-button {
        color: #F13A5F;
        width: 24px;
        height: 24px;
    }

    .header__search-wrapper {
        display: none;
    }

    .header__search-wrapper_mobile {
        right: 35px;
    }

    .header__search-wrapper-popup-menu_mobile {
        margin-bottom: 20px;
    }

    .header__middle-buttons_tablet {
        display: none;
    }

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

    .header__middle-button_text {
        text-decoration: none;
    }

    .header__middle-button-caption_menu-popup {
        display: block;
    }

    .header__middle,
    .header__middle-left {
        gap: 15px;
    }

    .header__menu-popup-list {
        display: flex;
        flex-direction: column;
    }

    .header__menu-popup-button {
        max-width: 115px;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
        background-color: #FFF6F7;
        gap: 4px;
        padding: 6px 20px 5px;
        text-decoration: none;
        color: #A11826;
    }

    .header__menu-popup-button p,
    .header__menu-popup-button span.header__middle-button-caption,
    .header__menu-popup-button .header__middle-button-caption_menu-popup {
        font-size: 14px;
        color: #A11826;
        text-align: center;
        margin: 0;
    }

    /* Cart trigger inside popup: match login button layout */
    .header__menu-popup-button .tm-cart-trigger {
        flex-direction: column;
        gap: 4px;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: none;
        border: none;
    }

    .header__menu-popup-button_login {
        background-color: #F13A5F;
        color: #FFFFFF;
    }

    .header__menu-popup-button_login p {
        width: 100%;
        text-align: center;
    }

    .header__menu-popup-button:hover {
        text-decoration: none;
    }

    .header__menu-link_fast-delivery {
        padding: 8px 20px;
    }

    .header__menu-popup-link_fast-delivery {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 10px 20px;
        border: none;
        border-radius: 25px;
        background-color: #F13A5F;
        color: #FFFFFF;
        font-size: 20px;
        font-weight: 500;
        margin-bottom: 20px;
    }

    .header__menu-link_popup {
        display: flex;
        font-size: 24px;
        justify-content: space-between;
        align-items: center;
    }

    .header__menu-link_popup_level-2 {
        font-size: 20px;
    }

    .header__menu-link_popup_level-3 {
        font-size: 16px;
    }

    .header__menu-popup-top {
        margin: 60px 0 20px;
        display: flex;
        justify-content: center;
        position: relative;
    }

    .header__close-button-wrapper {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translate(0, -50%);
    }

    .header__basket-icon_hidden {
        display: none;
    }

    .header__menu-popup-buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
        gap: 15px;
        position: relative;
    }

    .header__top-left {
        margin-bottom: 30px;
        justify-content: center
    }

    .header__top-left .header__text {
        font-size: 16px;
        color: #777777;
    }

    .header__top-right {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        padding: 16px 15px 50px;
        background-color: #F9F9F9;
    }

    .header__top-right .header__text {
        font-size: 18px;
        color: #777777;
    }
}

@media (max-width: 450px) {
    .header__menu-link_fast-delivery,
    .header__menu-link {
        font-size: 14px;
    }

    .header__menu-popup-link_fast-delivery {
        font-size: 20px;
    }

    .header__middle {
        position: relative;
        margin: 0;
    }

    .header__bottom-list {
        justify-content: normal;
        gap: 10px;
        height: 30px;
    }

    .header__menu-popup-nav-list {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .header__menu-popup-nav-list li {
        display: flex;
        justify-content: space-between;
    }

    .header__menu-popup-footer {
    }
}

@media (max-width: 375px) {
    .header__top-left {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 350px) {
    .header__logo-wrapper {
        width: 168px;
        height: 22px;
    }
}