/* ===== Telegram Widget (fixed bottom, always centered) ===== */

.tg-widget {
    box-sizing: border-box;
    position: fixed;
    z-index: 100000000000;

    /* прибит к низу + всегда по центру */
    left: 50%;
    bottom: 0;

    /* ширина с отступами 20px от краёв */
    width: calc(100% - 40px);
    max-width: 1320px;
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    /* внутренние отступы */
    padding: 10px 20px;

    /* если iPhone с "чёлкой"/safe-area */
    padding-bottom: calc(10px + env(safe-area-inset-bottom));

    /* стиль */
    background: linear-gradient(90deg, #38BDF8 0%, #229ED9 100%);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);

    /* анимация появления (важно: X всегда -50% для центра) */
    opacity: 0;
    transform: translate3d(-50%, 20px, 0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tg-widget--visible {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
}

.tg-widget--hiding {
    animation: tg-widget-hide 0.3s ease forwards;
}

@keyframes tg-widget-hide {
    to {
        opacity: 0;
        transform: translate3d(-50%, 30px, 0);
    }
}

.tg-widget * {
    box-sizing: border-box;
}

/* Иконка */
.tg-widget__icon {
    flex-shrink: 0;
    width: 41px;
    height: 41px;
    object-fit: contain;
}

/* Текст */
.tg-widget__text {
    display: flex;
    align-items: baseline;
    flex: 1;
    margin: 0 12px;

    text-decoration: none;
    color: #fff;
    line-height: 100%;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tg-widget__text:hover {
    text-decoration: none;
}

.tg-widget__text:hover .tg-widget__text-regular {
    text-decoration: underline;
}

.tg-widget__text-bold,
.tg-widget__text-regular {
    font-family: Arial, sans-serif;
    font-style: normal;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0;
    color: #fff;
}

.tg-widget__text-bold {
    font-weight: 700;
}

.tg-widget__text-regular {
    font-weight: 400;
}

/* Крестик */
.tg-widget__cross {
    flex-shrink: 0;
    position: relative;
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.tg-widget__cross:hover {
    opacity: 1;
}

.tg-widget__cross::before,
.tg-widget__cross::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 16px;
    background-color: #fff;
    border-radius: 1px;
    transform-origin: center;
}

.tg-widget__cross::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tg-widget__cross::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.tg-widget {
    display: none;
}
/* Мобилка — тоже по центру, тоже с отступами */
@media (max-width: 768px) {
    .tg-widget {
        display: flex;
        width: calc(100% - 40px);
    }
}
