/* ===== NKG_VFIX: правки витрины по отчёту «медленный интернет» (18 октября 2026) ===== */

/* 1. Допродажа открывается поверх карточки товара (у карточки z-index 9999999) */
.upsell-modal { z-index: 10000050 !important; }

/* 12. Окно допродажи влезает в экран: шапка и кнопки на месте, прокручивается только список */
.upsell-modal .upsell-modal-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 32px) !important;
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.upsell-modal .upsell-modal-header,
.upsell-modal .upsell-modal-actions { flex-shrink: 0 !important; }
.upsell-modal .upsell-modal-items {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin-bottom: 0 !important;
    padding-bottom: 4px !important;
}
.upsell-modal .upsell-modal-actions { padding-top: 12px !important; margin-top: 0 !important; }
@media (max-height: 760px) {
    .upsell-modal .upsell-modal-content { padding-top: 20px !important; padding-bottom: 16px !important; }
    .upsell-modal .upsell-modal-emoji { font-size: 34px !important; line-height: 1 !important; margin-bottom: 4px !important; height: auto !important; }
    .upsell-modal .upsell-modal-header { margin-bottom: 12px !important; }
}

/* 2. Второй тап, пока товар добавляется, не проходит */
.product-modal-add-btn.nkf-busy { pointer-events: none !important; opacity: .72; transition: opacity .15s; }

/* 4, 10. Куки: на телефоне карточкой над нижним меню; прячется, пока открыто окно */
#cookieBanner { transition: opacity .2s ease, transform .2s ease, bottom .25s ease; }
#cookieBanner.nkf-float { left: 10px !important; right: 10px !important; }
#cookieBanner.nkf-float > div {
    border-radius: 18px !important;
    padding: 14px !important;
    box-shadow: 0 10px 36px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .04) !important;
}
#cookieBanner.nkf-hide { opacity: 0 !important; pointer-events: none !important; transform: translateY(14px) !important; }

/* 4. Кнопка чата не висит поверх шторки установки и куки */
#lcBbl { transition: opacity .2s ease, transform .2s ease; }
body.nkf-banner-up #lcBbl { opacity: 0 !important; pointer-events: none !important; transform: scale(.6) !important; }

/* 4. Иконка в окне установки: логотип магазина из памяти, вписан в плитку */
#pwaBanner .nkg-i-ico canvas.nkf-ico-logo { display: block; width: 100%; height: 100%; }

/* 9. Чат на компьютере: окно справа внизу, а не на весь экран */
html.nkd .lc-chat.open {
    top: auto !important; left: auto !important;
    right: 24px !important; bottom: 24px !important;
    width: 400px !important; max-width: calc(100vw - 48px) !important;
    height: min(640px, calc(100vh - 48px)) !important;
    border-radius: 20px !important; overflow: hidden !important;
    transform: none !important;  /* подъём «над клавиатурой» на компьютере не нужен */
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .06) !important;
}
html.nkd .lc-chat .lc-hdr { padding-top: 14px !important; padding-bottom: 14px !important; }
/* на компьютере стрелка «назад» читается как крестик в правом углу */
html.nkd .lc-chat .lc-hdr-back { order: 3; margin-left: auto; font-size: 0 !important; }
html.nkd .lc-chat .lc-hdr-back::before { content: "\2715"; font-size: 15px; line-height: 1; }
html.nkd .lc-chat .lc-input { padding-bottom: 12px !important; }
/* поле ввода не выталкивает кнопку отправки за край (во всех версиях) */
.lc-chat .lc-input-txt { min-width: 0 !important; width: auto; }

/* 6. Нет соединения */
#nkfNet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
    display: flex; justify-content: center;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: nkfNetIn .3s ease-out;
}
#nkfNet .nkf-net-card {
    pointer-events: auto; width: 100%; max-width: 380px; box-sizing: border-box;
    background: #fff; color: #1a1a1a; border-radius: 22px; padding: 22px 20px 18px; text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .05);
}
#nkfNet .nkf-net-ic {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: #f3f3f5;
    display: flex; align-items: center; justify-content: center; color: #1a1a1a;
}
#nkfNet .nkf-net-h { font-size: 18px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.2px; }
#nkfNet .nkf-net-p { font-size: 14px; line-height: 1.45; color: #75797f; margin-bottom: 16px; }
#nkfNet .nkf-net-btn {
    display: block; width: 100%; font: inherit; font-size: 15px; font-weight: 600; color: #fff; background: #1a1a1a;
    border: 0; border-radius: 14px; padding: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#nkfNet .nkf-net-btn:active { opacity: .85; }
@keyframes nkfNetIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.story-fullscreen, .story-viewer.active { z-index: 100020 !important; }
.story-fullscreen-inner { max-width: min(500px, calc(100vh * 9 / 16)) !important; }
@supports (height: 100dvh) {
    .story-fullscreen { height: 100dvh !important; }
    .story-fullscreen-inner { max-width: min(500px, calc(100dvh * 9 / 16)) !important; }
}
