/* =========================================================
   The Miners — уведомления Shoptet (.messages > .msg)
   ---------------------------------------------------------
   Вместо зелёной полосы на всю ширину над хедером — тёмный
   «тост» внизу по центру: иконка по типу сообщения + текст,
   мягкое появление. Скрывает уведомление по-прежнему Shoptet.
   Типы: .msg-success / .msg-error / .msg-warning / .msg-info
   ========================================================= */

body .messages {
    --mn-toast-bg: #111111;
    --mn-toast-text: #ffffff;
    --mn-toast-border: rgba(255, 255, 255, .12);
    --mn-success: #DCFF50;
    --mn-error: #ff6b6b;
    --mn-warning: #ffb020;
    --mn-info: #8cc8ff;

    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 24px !important;
    left: 0 !important;
    z-index: 10010 !important;      /* выше попапов (10001) */
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 16px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: none;            /* пустой контейнер не мешает кликам */
}

/* ---------- Сам тост ---------- */
body .messages .msg {
    position: relative !important;
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: auto !important;
    max-width: min(520px, 100%);
    min-height: 52px;
    margin: 0 !important;
    padding: 14px 20px 14px 16px !important;
    background: var(--mn-toast-bg) !important;
    border: 1px solid var(--mn-toast-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28) !important;
    color: var(--mn-toast-text) !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left !important;
    pointer-events: auto;
    animation: mn-toast-in .45s cubic-bezier(.16, 1, .3, 1) both;
}

/* Цвет акцента по типу */
body .messages .msg-success { --mn-tone: var(--mn-success); }
body .messages .msg-error   { --mn-tone: var(--mn-error); }
body .messages .msg-warning { --mn-tone: var(--mn-warning); }
body .messages .msg-info,
body .messages .msg:not(.msg-success):not(.msg-error):not(.msg-warning) {
    --mn-tone: var(--mn-info);
}

/* Иконка в цветном кружке */
body .messages .msg::before {
    content: "" !important;
    position: static !important;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0 !important;
    border-radius: 50%;
    background-color: var(--mn-tone);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
    animation: mn-toast-pop .4s .15s cubic-bezier(.34, 1.56, .64, 1) both;
}

/* ✓ */
body .messages .msg-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
/* ✕ */
body .messages .msg-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}
/* ! */
body .messages .msg-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18.5v.01'/%3E%3C/svg%3E");
}
/* i */
body .messages .msg-info::before,
body .messages .msg:not(.msg-success):not(.msg-error):not(.msg-warning)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 10.5V18M12 5.5v.01'/%3E%3C/svg%3E");
}

body .messages .msg::after {
    content: none !important;
}

/* Внутренний .container Shoptet — без своих ширин и отступов */
body .messages .msg .container {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}

body .messages .msg .container,
body .messages .msg .container * {
    color: inherit !important;
    font-size: inherit;
    text-align: left !important;
}

body .messages .msg a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Анимации ---------- */
@keyframes mn-toast-in {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mn-toast-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    body .messages .msg,
    body .messages .msg::before {
        animation: none !important;
    }
}

/* ---------- Мобильные: на всю ширину с полями, над нижним краем ---------- */
@media (max-width: 767px) {
    body .messages {
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }

    body .messages .msg {
        width: 100% !important;
        max-width: none;
        font-size: 14px;
    }
}
