/* === ОСНОВНАЯ ОБЁРТКА === */
.menuWrap {
    --menu-sticky-top: 100px;
    background: rgba(246, 245, 244, 1);
    min-height: calc(100vh - 120px);
    padding-top: calc(100px + 18px);
    padding-bottom: 56px;
    position: relative;
}

.menuTitle {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 900;
    font-size: 44px;
    letter-spacing: .08em;
    text-align: center;
    margin: 30px 0 40px;
}

.menuLayout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    position: relative;
}

/* === САЙДБАР-КОЛОНКА: FIXED (desktop) + SPACER === */
.menuAsideCol {
    width: 280px;
    flex-shrink: 0;
    align-self: start;
}

.menuAsideSpacer {
    width: 280px;
    visibility: hidden;
    pointer-events: none;
}

.menuAside {
    position: fixed;
    top: var(--menu-sticky-top);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--menu-sticky-top) - 24px);
    width: 280px;
    z-index: 5;
    background: rgba(246, 245, 244, 1);
    padding-bottom: 20px;
    overflow: hidden;
    transition: top 0.1s ease;
}

/* === ПОИСК === */
.menuSearch {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 8px;
    margin-bottom: 16px;
}

.menuSearch__input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .14);
    background: #fff;
    font: inherit;
}

.menuSearch__btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fdfdfd;
    color: #2b2b2b;
    cursor: pointer;
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .06em;
    transition: all 0.2s ease;
}

.menuSearch__btn:hover {
    background: #f0f0f0;
}

/* === НАВИГАЦИЯ ПО КАТЕГОРИЯМ === */
.catNav {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(227, 6, 19, 0.35) transparent;
}

.catNav::-webkit-scrollbar {
    width: 4px;
}

.catNav::-webkit-scrollbar-thumb {
    background: rgba(227, 6, 19, 0.35);
    border-radius: 4px;
}

.catNav.has-scroll {
    mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
}

.catNav__link {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: #2b2b2b;
    transition: all 0.2s ease;
}

.catNav__link:hover {
    background: rgba(0, 0, 0, .04);
}

.catNav__link.is-active {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

.catNav__link--calc {
    margin-top: 10px;
    border-color: #E30613;
    background: transparent;
    color: #E30613;
    text-align: center;
}

.catNav.has-scroll-x {
    mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 97%, transparent 100%);
}

.menuToolbarSentinel {
    height: 1px;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.menuAside.is-stuck {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* === КОНТЕНТ С ТОВАРАМИ === */
.menuContent {
    padding-top: 6px;
    min-width: 0;
    width: 100%;
}

.catBlock {
    margin-bottom: 34px;
    scroll-margin-top: calc(var(--menu-sticky-top) + 16px);
}

.catTitle {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: .08em;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.itemsGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px 22px;
}

.itemCard {
    text-align: center;
}

.itemCard__imgBox {
    display: block;
    margin: 0 auto 10px;
    width: 190px;
    height: 150px;
}

.itemCard__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .14));
}

.itemCard__name {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 6px 0 6px;
}

.itemCard__meta {
    font-size: 12px;
    color: rgba(0, 0, 0, .62);
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 18px;
}

.itemCard__bottom {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

.itemPrice {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 900;
}

.itemBtn {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 12px;
    background: #E31E24;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
}

.itemBtn:hover {
    filter: brightness(.95);
}

/* === ПЛАВАЮЩАЯ КНОПКА КОРЗИНЫ === */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #E30613;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(227, 6, 19, 0.4);
    z-index: 997;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, background 0.2s, bottom 0.1s ease;
    /* bottom анимируется JS при приближении к футеру */
}

.floating-cart-btn:hover {
    transform: scale(1.05);
    background: #cc0510;
}

/* === БОКОВАЯ КОРЗИНА === */
.side-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
}

.side-cart-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.side-cart {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.side-cart.is-open {
    right: 0;
}

.side-cart__header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-cart__close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.side-cart__body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.side-cart__footer {
    padding: 20px;
    background: #fdfdfd;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sc-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.sc-item__img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.sc-item__info {
    flex-grow: 1;
}

.sc-item__name {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px;
}

.sc-item__price {
    font-size: 14px;
    color: #666;
}

/* === МОДАЛЬНОЕ ОКНО ТОВАРА === */
.prod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1005;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
    padding: 20px;
}

.prod-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.prod-modal {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 24px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.prod-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #333;
    z-index: 10;
}

.pm-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

.pm-img-box {
    background: #fdfdfd;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-img {
    width: 100%;
    max-width: 300px;
    object-fit: contain;
}

.pm-info {
    display: flex;
    flex-direction: column;
}

.pm-title {
    font-size: 28px;
    margin: 0 0 10px;
    font-family: 'Manrope', sans-serif;
}

.pm-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.pm-kbju {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.pm-addons {
    margin-bottom: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.pm-addon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
}

.pm-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.pm-price {
    font-size: 28px;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
}

.pm-btn {
    background: #E30613;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.pm-btn:hover {
    background: #cc0510;
}

@media(max-width: 768px) {
    .pm-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .prod-modal__close {
        top: 10px;
        right: 10px;
    }
}

/* === БЖУ И КАЛОРИИ В МОДАЛКЕ === */
.pm-nutri {
    margin: 20px 0;
    padding: 15px 0;
}

.pm-nutri-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eaeaea;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.pm-nutri-total {
    text-align: center;
    margin-top: 24px;
}

.pm-nutri-kcal {
    font-size: 46px;
    font-family: 'Manrope', sans-serif;
    color: #333;
    line-height: 1;
}

.pm-nutri-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* === ДОБАВКИ В МОДАЛКЕ === */
.pm-addons-group {
    margin: 24px 0;
}

.pm-addon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
    transition: 0.2s;
}

.pm-addon-item:hover {
    background: #fdfdfd;
}

.pm-addon-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.pm-addon-cb {
    width: 20px;
    height: 20px;
    accent-color: #E30613;
    cursor: pointer;
}

.pm-addon-price {
    font-size: 15px;
    font-weight: 700;
}

/* === ВЫБОР ОБЪЕМА/РАЗМЕРА === */
.pm-sizes {
    margin: 15px 0;
}

.pm-sizes__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.pm-sizes__list {
    display: flex;
    gap: 10px;
}

.size-option {
    flex: 1;
    position: relative;
}

.size-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.size-option label {
    display: block;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.size-option input:checked+label {
    border-color: #E30613;
    background-color: rgba(227, 6, 19, 0.05);
    color: #E30613;
}

/* ========================================= */
/*           АДАПТИВ ДЛЯ ПЛАНШЕТОВ           */
/* ========================================= */
@media (max-width: 980px) {
    .menuWrap {
        --menu-sticky-top: 70px;
    }

    .menuLayout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .menuAsideCol {
        width: 100%;
    }

    .menuAsideSpacer {
        width: 100%;
    }

    .menuAside {
        display: block;
        z-index: 990;
        background: rgba(246, 245, 244, 0.98);
        padding: 10px 0 12px;
        margin: 0;
        max-height: none;
        overflow-x: visible;
        overflow-y: visible;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    /* Поиск — горизонтальный на планшетах */
    .menuSearch {
        flex-direction: row;
        gap: 6px;
        margin-bottom: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .menuSearch__input {
        flex: 1;
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 10px;
    }

    .menuSearch__btn {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 10px;
        letter-spacing: .04em;
        border-radius: 10px;
        white-space: nowrap;
    }

    /* Категории — горизонтальная лента */
    .catNav {
        flex: none;
        min-height: auto;
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 6px;
        padding-right: 0;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .catNav::-webkit-scrollbar {
        height: 0;
    }

    .catNav {
        scrollbar-width: none;
    }

    .catNav__link {
        flex-shrink: 0;
        font-size: 11px;
        padding: 7px 10px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .catNav__link--calc {
        flex-shrink: 0;
        margin-top: 0;
        margin-left: 4px;
        font-size: 10px;
        padding: 7px 10px;
    }

    .itemsGrid {
        grid-template-columns: repeat(2, 1fr);
    }

    .itemCard__imgBox {
        width: 180px;
        height: 140px;
    }

    .menuTitle {
        font-size: 36px;
    }

    .catBlock {
        scroll-margin-top: calc(var(--menu-sticky-top) + var(--menu-toolbar-height, 80px));
    }

    /* На планшете плавающая кнопка корзины тоже есть */
    .floating-cart-btn {
        bottom: 30px;
        right: 30px;
    }
}

/* ========================================= */
/* АДАПТИВ ДЛЯ ТЕЛЕФОНОВ           */
/* ========================================= */
@media (max-width: 768px) {

    .menuWrap {
        --menu-sticky-top: 56px;
        padding: 80px 16px 100px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .menuTitle {
        font-size: 26px !important;
        margin: 0 0 20px !important;
        text-align: center !important;
    }

    .menuLayout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .menuAsideCol,
    .menuAsideSpacer {
        width: 100% !important;
    }

    /* === ПОИСК (компактная строка) === */
    .menuSearch {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .menuSearch__input {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
        box-sizing: border-box !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    .menuSearch__btn {
        flex-shrink: 0 !important;
        width: auto !important;
        box-sizing: border-box !important;
        padding: 8px 12px !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        letter-spacing: .04em !important;
    }

    /* === ПАНЕЛЬ: поиск + категории (position: fixed через JS) === */
    .menuAside {
        z-index: 990 !important;
        padding: 6px 0 8px !important;
        background: rgba(246, 245, 244, 0.98) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        max-height: none !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    /* Лента категорий */
    .catNav {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 4px 16px 6px 0 !important;
        scroll-padding-right: 16px;
        box-sizing: border-box !important;
    }

    .catNav.has-scroll-x {
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }

    .catNav::-webkit-scrollbar {
        display: none !important;
    }

    .catNav__link {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 11px !important;
        min-height: 34px !important;
        display: inline-flex !important;
        align-items: center !important;
        padding: 7px 10px !important;
        border-radius: 10px !important;
    }

    .catNav__link--calc {
        font-size: 10px !important;
        padding: 7px 10px !important;
    }

    .catBlock {
        scroll-margin-top: calc(var(--menu-sticky-top) + var(--menu-toolbar-height, 100px));
    }

    /* === СЕТКА ТОВАРОВ === */
    .itemsGrid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* === КАРТОЧКА ТОВАРА === */
    .itemCard {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border-radius: 16px !important;
        padding: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        box-sizing: border-box !important;
        height: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .itemCard__imgBox {
        width: 100% !important;
        height: 110px !important;
        margin: 0 auto 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .itemCard__img {
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }

    .itemCard__name {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin: 0 0 8px 0 !important;
        text-align: center !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        white-space: normal !important;
        flex-grow: 1 !important;
    }

    .itemCard__bottom {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: auto !important;
    }

    .itemPrice {
        font-size: 15px !important;
        font-weight: 900 !important;
    }

    .itemBtn {
        width: 100% !important;
        padding: 10px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }

    .catTitle {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
}