/* Модуль холодильника — прилеплен внизу; ширину задаёт тема */
.fridge-module {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    z-index: 9999;
    display: flex;
    justify-content: center;
}

/* Базовая кнопка — стиль кнопки «Подтвердить заказ» (green, непрозрачная) */
.fridge-module .fridge-float-btn {
    display: flex;
    width: 100%;
    max-width: var(--wd-container-width, 1140px);
    margin: 0 auto;
    align-items: center;
    justify-content: center;

    height: 48px;
    min-height: 48px;
    padding: 5px 28px;
    border: 1px dotted #D2D2D2;
    border-radius: 5px;
    cursor: pointer;

    font-family: inherit;
    font-size: 24px !important;
    font-weight: 100;
    line-height: 28.8px;
    letter-spacing: normal;
    text-transform: uppercase;

    background-color: #188127;
    color: #ffffff !important;

    box-shadow: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

/* Ховер */
.fridge-module .fridge-float-btn:hover {
    background-color: #12691e;
    color: #ffffff !important;
    transform: none;
    box-shadow: none;
}

/* Актив */
.fridge-module .fridge-float-btn:active {
    transform: none;
    box-shadow: none;
}

/* Отключённая кнопка (без загрузки) — перебиваем opacity темы (button[disabled] в base.min.css) */
.fridge-module:not(.fridge-module--loading) .fridge-float-btn[disabled],
.fridge-module:not(.fridge-module--loading) .fridge-float-btn[disabled]:hover,
.fridge-module:not(.fridge-module--loading) .fridge-float-btn[disabled]:focus {
    opacity: 1 !important;
    cursor: pointer;
}

/* Состояния модуля под сценарии */
.fridge-module--idle .fridge-float-btn {
    opacity: 1;
}

/* Отправка команды: белый спиннер поверх чёрного текста (без приглушения) */
.fridge-module--loading .fridge-float-btn {
    opacity: 1 !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border-color: #ffffff;
    position: relative;
    cursor: default;
}
.fridge-module--loading .fridge-float-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ffb-spin 0.7s linear infinite;
}
@keyframes ffb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fridge-module--busy .fridge-float-btn {
    opacity: 0.7;
    pointer-events: none;
}

/* Режим СКАНИРОВАТЬ ТОВАР — тот же стиль, что и базовый */
.fridge-module.fridge-module--scanning .fridge-float-btn {
    display: flex;
    width: 100%;
    max-width: var(--wd-container-width, 1140px);
    margin: 0 auto;
    height: 48px;
    min-height: 48px;
    padding: 5px 28px;
    text-align: center;
    background-color: #188127 !important;
    color: #ffffff !important;
    border: 1px dotted #D2D2D2;
    border-radius: 5px;
    font-size: 24px;
    font-weight: 100;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

/* Ховер в режиме сканирования */
.fridge-module.fridge-module--scanning .fridge-float-btn:hover {
    background-color: #12691e !important;
    color: #ffffff !important;
    box-shadow: none;
    transform: none;
}

/* Оверлей сканера (под будущую камеру) */
.fridge-scanner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;
}

.fridge-scanner-inner {
    background: #111;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.fridge-scanner-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.fridge-scanner-text {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.fridge-scanner-x {
    position: absolute;
    top: 10px;
    right: 14px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
}
.fridge-scanner-x:hover { background: rgba(255,255,255,0.3); }

/* Адаптив — на очень маленьких экранах немного ужимаем */
@media (max-width: 480px) {
    .fridge-module .fridge-float-btn {
        padding: 5px 16px;
        font-size: 18px !important;
    }
}

.fridge-scanner-inner {
    background: #111;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    position: relative;
}

.fridge-scanner-video-wrap {
    position: relative;
}

.fridge-scanner-video {
    width: 100%;
    height: 260px;
    background: #000;
    border-radius: 12px;
    margin: 0 auto 12px auto;
    object-fit: cover;
    display: block;
}

/* Красная линия по центру видео (зона сканирования) */
.fridge-scanner-video-wrap::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 2px;
    background: rgba(255, 0, 0, 0.7);
    transform: translateY(-50%);
    pointer-events: none;
}

.fridge-scanner-monitor {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}
.fridge-scanner-check {
    font-size: 52px;
    line-height: 1;
    color: #4caf50;
    animation: fridge-check-pop 0.35s ease;
    display: inline-block;
}
.fridge-scanner-cross {
    font-size: 52px;
    line-height: 1;
    color: #f44336;
    animation: fridge-check-pop 0.35s ease;
    display: inline-block;
}
.fridge-scanner-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 28px;
    border-radius: 999px;
    border: 2px solid #DD9933;
    background: transparent;
    color: #DD9933;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.fridge-scanner-done:hover {
    background: #DD9933;
    color: #fff;
}
.fridge-scanner-warn {
    color: #ffb74d;
    font-size: 15px;
    font-weight: 600;
    min-height: 24px;
}
@keyframes fridge-check-pop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
/* Выравнивание текста по центру */
.fridge-status-message {
    text-align: center;
}