/* Кнопка MAX с крестиком - полный аналог Telegram */
.max-banner {
    position: fixed;
    bottom: 30px;
    right: 60px; /* Смещаем левее, чтобы не накладывалась на Telegram */
    z-index: 999;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    justify-content: center;
}

/* Состояние раскрытия */
.max-banner.expanded {
    width: 280px;
    height: auto;
    min-height: 60px;
    border-radius: 30px;
    padding: 18px 25px 18px 20px;
    justify-content: flex-start;
}

.max-banner__content {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Иконка MAX */
.max-banner__icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    fill: #0a66c2; /* Синий цвет MAX */
    transition: transform 0.3s ease;
}

.max-banner.expanded .max-banner__icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
}

/* Текст */
.max-banner__text {
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.4s ease 0.1s, max-width 0.4s ease 0.1s;
}

.max-banner.expanded .max-banner__text {
    opacity: 1;
    max-width: 200px;
    white-space: normal;
}

/* Крестик для закрытия */
.max-banner__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.max-banner.expanded .max-banner__close {
    opacity: 0.5;
    visibility: visible;
}

.max-banner__close:hover { opacity: 1; }

.max-banner__close::before,
.max-banner__close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background: #666;
    border-radius: 1px;
}

.max-banner__close::before { transform: rotate(45deg); }
.max-banner__close::after { transform: rotate(-45deg); }

@media (max-width: 768px) {
    .max-banner {
        bottom: 20px;
        right: 90px; /* Меньше отступ на мобильных */
        width: 56px;
        height: 56px;
    }
    .max-banner.expanded {
        width: 260px;
        padding: 16px 22px 16px 18px;
    }
    .max-banner__text { font-size: 13px; }
}

@media (max-width: 480px) {
    .max-banner.expanded {
        width: 240px;
        padding: 14px 20px 14px 16px;
    }
}