/**
 * FFP (FFB 0.6.0): стили полноэкранного экрана покупки.
 *
 * Источник: docs/fridges/design/purchase-screen-2026-11-05.png (макет — закон).
 * Только собственная область .sfp-layer; общие стили FFB и темы не трогаем.
 * На десктопе слой растянут на весь экран, а контент ограничен шириной телефона
 * (это адаптация для проверки; структура/тексты/состояния — строго по макету).
 */

body.sfp-open {
    overflow: hidden !important;
}

.sfp-layer {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    justify-content: center;
    overflow: hidden;
    background: #0b0b0b;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.25;
    -webkit-font-smoothing: antialiased;
}

.sfp-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 520px;
    height: 100%;
    min-height: 0;
}

@supports (height: 100dvh) {
    .sfp-inner {
        height: 100dvh;
    }
}

/* ---------- Верхняя строка: ХОЛОДИЛЬНИК + id ---------- */

.sfp-appbar {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 12px;
    border-bottom: 1px solid #222222;
}

.sfp-appbar-title {
    color: #8c8c8c;
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.sfp-appbar-id {
    color: #f5a623;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Состояние «сканирование» / «пусто» ---------- */

.sfp-scan-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Окно камеры сверху: уголки, красная линия, подпись (макет) */
.sfp-camera {
    position: relative;
    flex: 0 0 auto;
    height: clamp(190px, 30vh, 320px);
    margin: 12px 16px 0;
    overflow: hidden;
    border: 1px solid #343434;
    border-radius: 16px;
    background: #111111;
}

.sfp-camera video,
.sfp-camera canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111111;
}

.sfp-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 0 solid #f5a623;
    pointer-events: none;
    z-index: 2;
}

.sfp-corner--tl {
    top: 10px;
    left: 10px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.sfp-corner--tr {
    top: 10px;
    right: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.sfp-corner--bl {
    bottom: 10px;
    left: 10px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.sfp-corner--br {
    bottom: 10px;
    right: 10px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.sfp-camera-line {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 2px;
    background: rgba(235, 60, 60, 0.9);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.sfp-camera-hint {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    color: #d2d2d2;
    font-size: 11px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 2;
}

/* ✓ / текст ошибки поверх камеры */
.sfp-scan-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    text-align: center;
}

.sfp-scan-feedback--visible {
    display: block;
}

.sfp-scan-error {
    display: inline-block;
    max-width: 260px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffb74d;
    font-size: 13px;
    line-height: 1.3;
}

/* ---------- Список товаров и итог ---------- */

.sfp-cart {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0 16px;
}

.sfp-cart-label {
    flex: 0 0 auto;
    padding: 14px 0 4px;
    color: #828282;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    text-transform: uppercase;
}

.sfp-items {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Интерактивные элементы: сброс стилей темы ----------
 * Woodmart задаёт стили всем button через `:is(.btn,.button,button,...)` с
 * переменными (#F3F3F3 фон / #3E3E3E текст / 13px). На боевой теме это
 * перебивало наши классы (зависит от порядка CSS). Поэтому для кнопок слоя
 * поднимаем специфичность (body .sfp-layer …) и помечаем !important критичные
 * свойства: список — прозрачный фон + белый текст, «Оплатить» — зелёная 18px.
 */
body .sfp-layer .sfp-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 0 10px !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    border: 0 !important;
    border-bottom: 1px solid #222222 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
    text-align: left;
    text-decoration: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    opacity: 1 !important;
    cursor: pointer;
    transition: none !important;
    -webkit-appearance: none;
    appearance: none;
}

body .sfp-layer .sfp-item:hover,
body .sfp-layer .sfp-item:focus,
body .sfp-layer .sfp-item:active {
    background: transparent !important;
    background-color: transparent !important;
    border-color: #222222 !important;
    border-bottom-color: #222222 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    outline: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.sfp-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body .sfp-layer .sfp-item-name {
    color: #ebebeb !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
    text-shadow: none !important;
    text-transform: uppercase !important;
    overflow-wrap: anywhere;
}

body .sfp-layer .sfp-item-qty {
    margin-top: 4px;
    color: #828282 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    text-transform: none !important;
    text-shadow: none !important;
}

body .sfp-layer .sfp-item-price {
    padding-top: 2px;
    color: #f0f0f0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap;
}

body .sfp-layer .sfp-total-label {
    color: #8c8c8c !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}

body .sfp-layer .sfp-item-remove {
    padding-top: 1px;
    color: #787878 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-transform: none !important;
    text-shadow: none !important;
}

/* Пустое состояние (макет: плашка «Пока пусто») */
.sfp-empty {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 90px;
    margin-top: 14px;
    padding: 16px 12px;
    border: 1px solid #282828;
    border-radius: 12px;
    background: #101010;
    text-align: center;
}

.sfp-empty-title {
    color: #aaaaaa;
    font-size: 13px;
    font-weight: 700;
}

.sfp-empty-text {
    color: #787878;
    font-size: 10px;
    line-height: 1.35;
}

.sfp-total {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 16px;
    border-bottom: 1px solid #282828;
}

.sfp-total--empty {
    margin-top: 14px;
    border-bottom-color: transparent;
}

.sfp-total-label {
    color: #8c8c8c;
    font-size: 12px;
    text-transform: uppercase;
}

.sfp-total-value {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.sfp-total--empty .sfp-total-label {
    color: #6e6e6e;
}

.sfp-total--empty .sfp-total-value {
    color: #969696;
}

/* ---------- Нижний блок: «Оплатить» + подсказки ---------- */

.sfp-footer {
    flex: 0 0 auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

body .sfp-layer .sfp-pay {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 58px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 16px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: #188127 !important;
    background-color: #188127 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    line-height: 1.15 !important;
    text-align: center;
    text-decoration: none !important;
    text-shadow: none !important;
    text-transform: uppercase !important;
    opacity: 1 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s ease;
}

body .sfp-layer .sfp-pay:hover,
body .sfp-layer .sfp-pay:focus {
    background: #12691e !important;
    background-color: #12691e !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

body .sfp-layer .sfp-pay:active {
    transform: none !important;
}

body .sfp-layer .sfp-pay:disabled,
body .sfp-layer .sfp-pay[disabled],
body .sfp-layer .sfp-pay:disabled:hover {
    background: #12351c !important;
    background-color: #12351c !important;
    box-shadow: none !important;
    color: #69826e !important;
    cursor: default;
    opacity: 1 !important;
}

.sfp-hints {
    margin-top: 18px;
}

.sfp-hint {
    font-size: 10px;
    line-height: 1.35;
}

.sfp-hint--left {
    padding: 0 4px;
    color: #787878;
    text-align: left;
}

.sfp-hint--center {
    margin-top: 8px;
    text-align: center;
}

.sfp-payment {
    color: #6e6e6e;
}

.sfp-note {
    margin-top: 8px;
    color: #555555;
    font-size: 9px;
}

/* ---------- Состояние «оплачено» (камера выключена) ---------- */

.sfp-paid-view {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sfp-paid-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 92px;
    height: 92px;
    margin-top: clamp(48px, 15vh, 150px);
    border-radius: 50%;
    background: #188127;
}

/* Галочка нарисована так же, как в макете: толстая белая полилиния. */
.sfp-paid-check-mark {
    width: 36px;
    height: 18px;
    margin-top: -8px;
    margin-left: 4px;
    border-left: 7px solid #ffffff;
    border-bottom: 7px solid #ffffff;
    transform: rotate(-45deg);
}

.sfp-paid-title {
    flex: 0 0 auto;
    margin-top: 22px;
    color: #78dc8c;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-align: center;
    text-transform: uppercase;
}

.sfp-paid-amount {
    flex: 0 0 auto;
    margin-top: 12px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.sfp-paid-thanks {
    flex: 0 0 auto;
    margin-top: 22px;
    color: #e1e1e1;
    font-size: 14px;
    text-align: center;
}

.sfp-paid-sms {
    flex: 0 0 auto;
    margin-top: 10px;
    color: #969696;
    font-size: 11px;
    text-align: center;
}

.sfp-receipt {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px solid #282828;
    border-radius: 12px;
    background: #101010;
}

.sfp-receipt-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}

.sfp-receipt-name {
    min-width: 0;
    color: #bebebe;
    font-size: 10px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.sfp-receipt-price {
    color: #d7d7d7;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.sfp-receipt-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #262626;
}

.sfp-receipt-total-label {
    color: #8c8c8c;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.sfp-receipt-value {
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

body .sfp-layer .sfp-done {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 56px !important;
    height: auto !important;
    margin: 26px 0 0 !important;
    padding: 8px 16px !important;
    border: 2px solid #464646 !important;
    border-radius: 14px !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #e1e1e1 !important;
    font-family: inherit !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    text-align: center;
    text-decoration: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    opacity: 1 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s ease;
}

body .sfp-layer .sfp-done:hover,
body .sfp-layer .sfp-done:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: #464646 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.sfp-paid-note {
    flex: 0 0 auto;
    margin-top: 16px;
    color: #5f5f5f;
    font-size: 9px;
    text-align: center;
}

/* ---------- Адаптация под низкие экраны ---------- */

@media (max-height: 680px) {
    .sfp-camera {
        height: clamp(150px, 24vh, 220px);
    }

    .sfp-paid-check {
        width: 74px;
        height: 74px;
        margin-top: 22px;
    }

    .sfp-paid-title {
        margin-top: 14px;
        font-size: 22px;
    }

    .sfp-paid-thanks {
        margin-top: 14px;
    }

    .sfp-receipt {
        margin-top: 14px;
    }

    .sfp-done {
        margin-top: 16px;
    }
}

/* ===== Чек-стиль корзины сканера (вариант «Меню») ===== */
body .sfp-layer .sfp-cart-label {
    display: none !important;
}
body .sfp-layer .sfp-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 11px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #f2e9de !important;
    text-align: left !important;
}
body .sfp-layer .sfp-item:hover,
body .sfp-layer .sfp-item:focus,
body .sfp-layer .sfp-item:active {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #f2e9de !important;
}
body .sfp-layer .sfp-item-top {
    grid-column: 1 / -1;
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
}
body .sfp-layer .sfp-item-name {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    color: #f2e9de !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: .2px !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
}
body .sfp-layer .sfp-item-dots {
    flex: 1 1 20px !important;
    min-width: 20px !important;
    height: 1em !important;
    border-bottom: 1px dotted rgba(226, 210, 190, .46) !important;
    margin: 0 2px 4px !important;
}
body .sfp-layer .sfp-item-price {
    flex: 0 0 auto !important;
    padding: 0 !important;
    color: #f4e7d6 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-shadow: none !important;
}
body .sfp-layer .sfp-item-desc {
    grid-column: 1 !important;
    min-width: 0 !important;
    margin-top: 2px !important;
    color: #9f8c78 !important;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: .05px !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body .sfp-layer .sfp-total {
    display: flex !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-top: 2px !important;
    padding: 14px 0 16px !important;
    border-top: 1px solid rgba(213, 195, 168, .38) !important;
    border-bottom: 0 !important;
}
body .sfp-layer .sfp-total-label {
    flex: 0 0 auto !important;
    color: #d5c3aa !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}
body .sfp-layer .sfp-total-dots {
    flex: 1 1 16px !important;
    min-width: 20px !important;
    height: 1em !important;
    border-bottom: 1px dotted rgba(226, 210, 190, .46) !important;
    margin: 0 2px 5px !important;
}
body .sfp-layer .sfp-total-value {
    flex: 0 0 auto !important;
    color: #fff4e5 !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
}
body .sfp-layer .sfp-total--empty {
    border-top-color: transparent !important;
}
body .sfp-layer .sfp-total--empty .sfp-total-dots {
    display: none !important;
}

/* 0.6.5: описание строго в колонке слева от цены */
body .sfp-layer .sfp-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 9px !important;
    align-items: start !important;
}
body .sfp-layer .sfp-item-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    min-width: 0 !important;
}
body .sfp-layer .sfp-item-price {
    grid-column: 2 !important;
    grid-row: 1 !important;
}
body .sfp-layer .sfp-item-desc {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

/* 0.6.6: отступ от сканера, крупнее строки и итог */
body .sfp-layer .sfp-cart {
    padding-top: 32px !important;
}
body .sfp-layer .sfp-item-name {
    font-size: 19px !important;
    line-height: 1.2 !important;
}
body .sfp-layer .sfp-item-price {
    font-size: 20px !important;
}
body .sfp-layer .sfp-total-label {
    font-size: 19px !important;
    letter-spacing: 1.5px !important;
}
body .sfp-layer .sfp-total-value {
    font-size: 20px !important;
    line-height: 1.1 !important;
}

/* 0.6.7: итоговая сумма +2px, шрифт кнопки оплаты как у суммы */
body .sfp-layer .sfp-total-value {
    font-size: 22px !important;
}
body .sfp-layer .sfp-pay {
    font-size: 22px !important;
}

/* ===== 0.7.0: товары под сканером — карточки с фото (стиль preview) ===== */
body .sfp-layer .sfp-cart {
    padding: 10px 16px 0 !important;
}
body .sfp-layer .sfp-cart-label {
    display: block !important;
    margin: 14px 4px 9px !important;
    padding: 0 !important;
    border: 0 !important;
    color: #8f7c69 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    letter-spacing: 2.6px !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}
body .sfp-layer .sfp-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
body .sfp-layer .sfp-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    border: 1px solid rgba(217, 198, 173, .13) !important;
    border-radius: 12px !important;
    background: #15110d !important;
    box-shadow: none !important;
    color: #f2e9de !important;
    text-align: left !important;
}
body .sfp-layer .sfp-item:hover,
body .sfp-layer .sfp-item:focus,
body .sfp-layer .sfp-item:active {
    background: #15110d !important;
    border-color: rgba(217, 198, 173, .2) !important;
    box-shadow: none !important;
    color: #f2e9de !important;
}
body .sfp-layer .sfp-item-thumb {
    display: block !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    overflow: hidden !important;
    border-radius: 9px !important;
    border: 1px solid rgba(245, 166, 35, .16) !important;
    background:
        radial-gradient(circle at 35% 35%, rgba(245, 166, 35, .35), transparent 55%),
        #22170e !important;
}
body .sfp-layer .sfp-item-thumb-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
body .sfp-layer .sfp-item-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
body .sfp-layer .sfp-item-name {
    display: block !important;
    flex: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #f2e9de !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
}
body .sfp-layer .sfp-item-desc {
    display: block !important;
    grid-column: auto !important;
    min-width: 0 !important;
    margin-top: 3px !important;
    color: #8f7c69 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body .sfp-layer .sfp-item-price {
    align-self: flex-start !important;
    flex: 0 0 auto !important;
    padding-top: 1px !important;
    color: #f4e7d6 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}
body .sfp-layer .sfp-total {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-top: 14px !important;
    padding: 13px 4px 14px !important;
    border-top: 1px solid rgba(217, 198, 173, .26) !important;
    border-bottom: 0 !important;
}
body .sfp-layer .sfp-total-label {
    color: #d9c6ad !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: 2.2px !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}
body .sfp-layer .sfp-total-value {
    color: #fff4e5 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
}
body .sfp-layer .sfp-total-dots {
    display: none !important;
}

/* 0.7.1: подпись «В КОРЗИНЕ» — слева, как в утверждённом preview. */
body .sfp-layer .sfp-cart-label {
    text-align: left !important;
}

/* ===== 0.8.0: компактный сканер, цены с количеством, оплата на нижней подложке ===== */
body .sfp-layer .sfp-camera {
    height: clamp(120px, 15vh, 160px) !important;
}
body .sfp-layer .sfp-item-prices {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-self: flex-start !important;
    padding-top: 1px !important;
    text-align: right !important;
    white-space: nowrap !important;
}
body .sfp-layer .sfp-item-qty-price {
    color: #8f7c69 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
}
body .sfp-layer .sfp-item-price {
    align-self: auto !important;
    padding-top: 0 !important;
    color: #f4e7d6 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}
body .sfp-layer .sfp-item-prices .sfp-item-price {
    margin-top: 2px !important;
}
body .sfp-layer .sfp-cart {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px)) !important;
}
body .sfp-layer .sfp-footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100000 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: #0b0b0b !important;
    border-top: 1px solid #202020 !important;
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .55) !important;
}
body .sfp-layer .sfp-footer .sfp-pay {
    max-width: 520px !important;
    margin: 0 auto !important;
}
@media (max-width: 480px) {
    body .sfp-layer .sfp-camera {
        height: clamp(120px, 15vh, 160px) !important;
    }
}

/* 0.8.2: сканер выше на высоту одной карточки, крупнее «ИТОГО». */
body .sfp-layer .sfp-camera {
    height: clamp(180px, 22.5vh, 220px) !important;
}
body .sfp-layer .sfp-total-label {
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: 2.2px !important;
}
@media (max-width: 480px) {
    body .sfp-layer .sfp-camera {
        height: clamp(180px, 22.5vh, 220px) !important;
    }
}

/* ===== 0.9.0: полноэкранный QR-сканер новой покупки ===== */
body.ffb-qr-open {
    overflow: hidden !important;
}
.ffb-qr-layer {
    position: fixed;
    inset: 0;
    z-index: 200000;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}
.ffb-qr-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #050403;
}
.ffb-qr-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72vw, 320px);
    height: min(72vw, 320px);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(245, 166, 35, .55);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
    z-index: 2;
}
.ffb-qr-corner {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border: 0 solid #f5a623;
    filter: drop-shadow(0 0 6px rgba(245, 166, 35, .5));
    pointer-events: none;
}
.ffb-qr-corner--tl { border-top-width: 3px; border-left-width: 3px; border-radius: 8px 0 0 0; }
.ffb-qr-corner--tr { border-top-width: 3px; border-right-width: 3px; border-radius: 0 8px 0 0; }
.ffb-qr-corner--bl { border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 8px; }
.ffb-qr-corner--br { border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 8px 0; }
.ffb-qr-layer.is-success .ffb-qr-corner {
    border-color: #35c65b;
    filter: drop-shadow(0 0 8px rgba(53, 198, 91, .6));
}
.ffb-qr-close {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(10, 8, 6, .65);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.ffb-qr-hint {
    position: absolute;
    left: 50%;
    top: calc(50% + min(36vw, 160px) + 18px);
    transform: translateX(-50%);
    z-index: 5;
    width: 80%;
    color: #f4eadc;
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.ffb-qr-status {
    position: absolute;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 5;
    max-width: 84%;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(11, 11, 11, .82);
    border: 1px solid rgba(217, 198, 173, .18);
    color: #d9c6ad;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
}
.ffb-qr-status.is-error {
    color: #ffd8cf;
    border-color: rgba(227, 58, 46, .6);
}
.ffb-qr-status.is-success {
    color: #dff7e5;
    border-color: rgba(53, 198, 91, .55);
}

/* QR scanner: close button поверх стилей темы и сайта. */
.ffb-qr-layer .ffb-qr-close {
    position: absolute !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: 14px !important;
    left: auto !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, .3) !important;
    border-radius: 50% !important;
    background: rgba(10, 8, 6, .8) !important;
    background-color: rgba(10, 8, 6, .8) !important;
    color: #fff !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

/* 0.9.4: подвижные уголки захвата товарного штрихкода. */
body .sfp-layer .sfp-camera .sfp-corner {
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transition: transform .12s linear, border-color .15s ease !important;
}
body .sfp-layer .sfp-camera--locked .sfp-corner {
    border-color: #35c65b !important;
    filter: drop-shadow(0 0 5px rgba(53, 198, 91, .55)) !important;
}

/* 0.9.7: Quagga canvas не должен перекрывать видео камеры.
   На iOS/Chrome без BarcodeDetector Quagga создаёт canvas.drawingBuffer поверх video;
   прозрачный canvas + слой ниже video возвращают видимую картинку. */
body .sfp-layer .sfp-camera video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    background: #111111 !important;
    z-index: 1 !important;
}
body .sfp-layer .sfp-camera canvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    background: transparent !important;
    background-color: transparent !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* 0.9.8: вспышка добавленной/обновлённой карточки товара. */
body .sfp-layer .sfp-item {
    position: relative !important;
    overflow: hidden !important;
}
body .sfp-layer .sfp-item::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    border-radius: inherit !important;
    background: rgba(53, 198, 91, .30) !important;
    opacity: 0;
    pointer-events: none !important;
}
body .sfp-layer .sfp-item--flash::after,
body .sfp-layer .sfp-item--new::after {
    animation: sfp-item-flash .65s ease-out !important;
}
body .sfp-layer .sfp-item--flash {
    animation: sfp-item-bump .55s ease-out !important;
}
body .sfp-layer .sfp-item--new {
    animation: sfp-item-in .6s ease-out !important;
}
@keyframes sfp-item-flash {
    0% { opacity: 0; }
    18% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes sfp-item-bump {
    0% { transform: scale(1); }
    32% { transform: scale(1.018); }
    100% { transform: scale(1); }
}
@keyframes sfp-item-in {
    0% { opacity: .35; transform: translateY(-8px) scale(.99); }
    60% { opacity: 1; transform: translateY(0) scale(1.018); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    body .sfp-layer .sfp-item--flash,
    body .sfp-layer .sfp-item--new {
        animation: none !important;
    }
    body .sfp-layer .sfp-item--flash::after,
    body .sfp-layer .sfp-item--new::after {
        animation: sfp-item-flash-dim .65s linear !important;
    }
}
@keyframes sfp-item-flash-dim {
    0% { opacity: 0; }
    18% { opacity: .55; }
    100% { opacity: 0; }
}

/* 0.9.9: вспышка заметнее + корректное снятие класса. */
body .sfp-layer .sfp-item::after {
    background: rgba(53, 198, 91, .42) !important;
    box-shadow: inset 0 0 0 2px rgba(53, 198, 91, .9) !important;
}
body .sfp-layer .sfp-item--flash::after,
body .sfp-layer .sfp-item--new::after {
    animation-duration: .8s !important;
}
@keyframes sfp-item-flash {
    0% { opacity: 0; }
    16% { opacity: 1; }
    100% { opacity: 0; }
}

/* 0.10.0: opacity в ::after не должна быть !important, иначе CSS-анимация
   не может проявить вспышку (important побеждает keyframes). */
body .sfp-layer .sfp-item::after {
    opacity: 0;
}

/* 0.10.8: всплывающая подсказка на экране сканера + кнопка оплаты в стиле FFB. */
body .sfp-layer .sfp-footer {
    --sfp-info-width: min(calc(100vw - 32px), 520px);
    overflow: visible !important;
}
body .sfp-layer .sfp-info-card {
    position: absolute !important;
    left: 50% !important;
    bottom: calc(100% + 10px) !important;
    transform: translateX(-50%) !important;
    z-index: 100001 !important;
    width: var(--sfp-info-width) !important;
    max-width: var(--sfp-info-width) !important;
    box-sizing: border-box !important;
    padding: 12px 52px 12px 16px !important;
    border: 1px solid rgba(255, 255, 255, .20) !important;
    border-radius: 10px !important;
    background: rgba(18, 16, 13, .97) !important;
    box-shadow: none !important;
    color: #dcd2c3 !important;
    font-family: inherit !important;
    text-align: left !important;
}
body .sfp-layer .sfp-info-title {
    color: #f1e8da !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}
body .sfp-layer .sfp-info-text {
    margin-top: 4px !important;
    color: #dcd2c3 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}
body .sfp-layer .sfp-info-close {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #d9d0c2 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}
body .sfp-layer .sfp-info-close:focus,
body .sfp-layer .sfp-info-close:active {
    outline: none !important;
    background: rgba(255, 255, 255, .07) !important;
    color: #ffffff !important;
}
body .sfp-layer .sfp-footer .sfp-pay {
    width: var(--sfp-info-width) !important;
    max-width: var(--sfp-info-width) !important;
    min-height: 48px !important;
    height: 48px !important;
    margin: 0 auto !important;
    padding: 5px 18px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 8px !important;
    background: #188127 !important;
    background-color: #188127 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1.15 !important;
    letter-spacing: .2px !important;
}
body .sfp-layer .sfp-footer .sfp-pay:hover,
body .sfp-layer .sfp-footer .sfp-pay:focus {
    background: #12691e !important;
    background-color: #12691e !important;
    border-color: rgba(255, 255, 255, .24) !important;
    box-shadow: none !important;
    color: #ffffff !important;
}
body .sfp-layer .sfp-footer .sfp-pay:disabled,
body .sfp-layer .sfp-footer .sfp-pay[disabled] {
    background: #12351c !important;
    background-color: #12351c !important;
    border-color: rgba(255, 255, 255, .08) !important;
    color: #69826e !important;
    cursor: default !important;
    opacity: 1 !important;
}

/* 0.11.6: та же типографика у подсказки над кнопкой оплаты. */
.sfp-layer {
    --ffb-notice-title: 20px;
    --ffb-notice-text: 18px;
}
body .sfp-layer .sfp-info-title {
    font-size: var(--ffb-notice-title) !important;
    line-height: 1.25 !important;
}
body .sfp-layer .sfp-info-text {
    font-size: var(--ffb-notice-text) !important;
    line-height: 1.35 !important;
}
