.flex_row {
    display: flex;
    flex-direction: row;
}

/* Header: right-align Telegram menu item on desktop */
@media (min-width: 951px) {
    .header__menu-list {
        flex: 1 1 auto;
    }
    .header__menu-item--right {
        margin-left: auto;
        margin-right: 24px; /* space before phone button */
    }
}
.tg_img {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.7rem;
}

.modal__content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Fix for modal width issue on mobile Chrome */
@media (max-width: 768px) {
    .modal__content {
        max-width: 100vw !important;
        width: 100vw !important;
        padding: 20px 15px 40px 15px !important;
        box-sizing: border-box;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .modal__close-btn {
        right: 15px !important;
        top: 15px !important;
        z-index: 153 !important;
    }

    .modal__form {
        padding-right: 0 !important;
        overflow-x: hidden !important;
    }

    .modal__success {
        padding: 20px 15px !important;
        overflow-x: hidden !important;
    }
}

/* Fix for main window expansion when modal opens */
body {
    overflow-x: hidden !important;
}

/* When modal is active, prevent any scrolling and expansion */
.modal.active ~ * {
    overflow-x: hidden !important;
}

/* Additional fix for mobile devices */
@media (max-width: 768px) {
    .modal.active {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .modal.active .modal__overlay {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .modal.active .modal__content {
        position: fixed !important;
        right: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
}

/* Prevent viewport expansion on mobile */
@media (max-width: 768px) {
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* When modal is open, lock the viewport */
    body:has(.modal.active) {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    /* Fallback for browsers that don't support :has() */
    .modal-open {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 960px;
    background: linear-gradient(135deg, #f7f8fb 0%, #ffffff 100%);
    color: #1b1c25;
    border: 1px solid rgba(107, 126, 255, 0.2);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 16px 36px rgba(26, 33, 61, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    z-index: 1200;
    display: none;
}

.cookie-banner--visible {
    display: block;
}

.cookie-banner__content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cookie-banner__text {
    font-size: 14px;
    line-height: 1.5;
    flex: 1 1 auto;
}

.cookie-banner__link {
    color: #5e7dff;
    text-decoration: underline;
    margin-left: 8px;
    white-space: nowrap;
}

.cookie-banner__btn {
    background: linear-gradient(135deg, #6e8dff, #7b61ff);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    white-space: nowrap;
}

.cookie-banner__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(94, 125, 255, 0.28);
}

.cookie-banner__btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(94, 125, 255, 0.22);
}

@media (max-width: 768px) {
    .cookie-banner {
        bottom: 12px;
        padding: 14px;
    }

    .cookie-banner__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner__link {
        display: inline-block;
        margin-left: 0;
        margin-top: 6px;
    }

    .cookie-banner__btn {
        width: 100%;
        text-align: center;
    }
}
