/* ==============================================
   Helper Mascot – стили (v1.2.0)
   ============================================== */

.hm-mascot,
.hm-bubble {
    position: fixed;
    z-index: 99999;
    cursor: pointer;
    box-sizing: border-box;
}

/* --- Маскот --- */
.hm-mascot {
    left: -220px;
    top: 50%;
    width: 320px;
    height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
    transition: left 0.5s ease-out, opacity 0.4s ease, transform 0.5s ease;
    border-radius: 50%;
    /*box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);*/
}

.hm-mascot--visible {
    left: -60px;
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Вариант с эмодзи */
.hm-mascot--emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    line-height: 1;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* --- Плашка --- */
.hm-bubble {
    left: 200px;
    top: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #2575fc 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-50%) translateX(-40px);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                background 0.3s ease,
                box-shadow 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hm-bubble--visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

/* Иконка в плашке */
.hm-bubble-icon {
    font-size: 1.2em;
    animation: hm-icon-point 1.5s infinite;
}

/* Стрелочка у плашки */
.hm-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #2575fc;
}

/* --- Анимации привлечения внимания --- */
@keyframes hm-bounce {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-65%) scale(1.08);
    }
}

.hm-mascot--bounce {
    animation: hm-bounce 0.5s ease 3;
}

@keyframes hm-pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 45px rgba(37, 117, 252, 0.8);
    }
}

.hm-bubble--pulse {
    animation: hm-pulse 1.2s ease 2;
}

@keyframes hm-icon-point {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* --- Hover-эффекты --- */
.hm-mascot:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.hm-bubble:hover {
    background: linear-gradient(135deg, #7b2ff7 0%, #3b82f6 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-50%) translateX(5px);
}

/* --- Анимация скрытия --- */
.hm-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hm-mascot.hm-hidden {
    left: -220px;
    transform: translateY(-50%) scale(0.8);
}

.hm-bubble.hm-hidden {
    transform: translateY(-50%) translateX(-40px);
}

/* --- Адаптивность --- */
@media (max-width: 768px) {
    .hm-mascot {
        width: 140px;
        height: 140px;
        left: -150px;
    }
    .hm-mascot--visible {
        left: 10px;
    }
    .hm-bubble {
        left: 160px;
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 20px;
    }
    .hm-mascot--emoji {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .hm-mascot {
        width: 110px;
        height: 110px;
        left: -120px;
        top: auto;
        bottom: 10px;
        transform: none;
    }
    .hm-mascot--visible {
        left: 10px;
        bottom: 10px;
        transform: none;
    }
    .hm-bubble {
        left: 130px;
        top: auto;
        bottom: 40px;
        transform: translateX(-30px);
        padding: 10px 14px;
        font-size: 13px;
        white-space: normal;
        max-width: 200px;
    }
    .hm-bubble--visible {
        transform: translateX(0);
    }
    .hm-bubble::after {
        left: auto;
        right: -8px;
        border-right: none;
        border-left: 10px solid #2575fc;
    }
    .hm-mascot--bounce {
        animation: none;
    }
    .hm-bubble--pulse {
        animation: none;
}
}
/* --- ФОН МОДАЛЬНОГО ОКНА (ЗАТЕМНЕНИЕ И РАЗМЫТИЕ) --- */
.hm-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important; /* Цвет затемнения */
    backdrop-filter: blur(4px) !important;      /* Размытие заднего плана */
    z-index: 999999 !important;                  /* Всегда поверх сайта */
    box-sizing: border-box !important;

    /* Скрыто по умолчанию */
    display: none !important;
    align-items: center !important;              /* Выравнивание по вертикали */
    justify-content: center !important;           /* Выравнивание по горизонтали */
}

/* Класс активации модалки из JS */
.hm-modal-overlay.hm-modal-active {
    display: flex !important;
}

/* --- КОРПУС ФОРМЫ (БЕЛОЕ ОКНО ПО ЦЕНТРУ) --- */
.hm-modal-container {
    background: #ffffff !important;
    padding: 40px 30px 30px 30px !important;
    border-radius: 16px !important;
    position: relative !important;
    max-width: 450px !important;
    width: 90% !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15) !important;
    box-sizing: border-box !important;
    animation: hmFadeInUp 0.3s ease-out !important; /* Плавное появление снизу вверх */
}

/* --- КНОПКА ЗАКРЫТИЯ (КРЕСТИК) --- */
.hm-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: none !important;
    border: none !important;
    font-size: 32px !important;
    cursor: pointer !important;
    color: #a0aec0 !important;
    line-height: 1 !important;
    padding: 0 !important;
    z-index: 1000000 !important;
}
.hm-modal-close:hover {
    color: #4a5568 !important;
}

/* --- СТИЛИЗАЦИЯ ПОЛЕЙ ВНУТРИ МОДАЛКИ --- */
.hm-modal-content form {
    margin: 0 !important;
    padding: 0 !important;
}
.hm-modal-content label {
    display: block !important;
    margin-bottom: 15px !important;
    font-family: sans-serif !important;
    font-size: 14px !important;
    color: #333333 !important;
    font-weight: 600 !important;
}
.hm-modal-content input[type="text"],
.hm-modal-content input[type="tel"],
.hm-modal-content input[type="email"] {
    width: 100% !important;
    display: block !important;
    margin-top: 5px !important;
    padding: 12px 15px !important;
    border: 1px solid #cbd5e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
}

/* Чекбокс согласия (политика конфиденциальности) */
.hm-modal-content .wpcf7-acceptance {
    display: block !important;
    margin-top: 15px !important;
    margin-bottom: 20px !important;
    font-size: 13px !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
}

/* Кнопка отправки формы */
.hm-modal-content input[type="submit"] {
    width: 100% !important;
    background: #0085ff !important; /* Базовый синий цвет */
    color: #fff !important;
    padding: 14px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}
.hm-modal-content input[type="submit"]:hover {
    background: #00ffcc !important;
}

/* Блокировка прокрутки основного сайта при открытом окне */
body.hm-modal-open {
    overflow: hidden !important;
}

/* Анимация всплытия модалки */
@keyframes hmFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Эффект загрузки для кнопки «Отправить» */
.hm-modal-content form.submitting input[type="submit"] {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    position: relative !important;
}

/* Стили для блока успешной отправки */
.hm-success-message {
    text-align: center !important;
    padding: 20px 10px !important;
    animation: hmFadeInUp 0.3s ease-out !important;
}

/* Огромная анимированная зеленая галочка */
.hm-success-icon {
    font-size: 54px !important;
    color: #48bb78 !important;
    display: block !important;
    margin-bottom: 15px !important;
    line-height: 1 !important;
}

.hm-success-title {
    font-family: sans-serif !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: #2d3748 !important;
    margin-bottom: 10px !important;
}

.hm-success-text {
    font-family: sans-serif !important;
    font-size: 14px !important;
    color: #718096 !important;
}

