/* PWA Install Button Styles */
@media (max-width: 480px) {
    .pwa-install-button {
    display: none;
    position: fixed;
    bottom: calc(4.17cqw + 12.5cqw + 2.08cqw); /* bottom бара + высота бара + отступ над баром */
    right: calc(50% - 41.67cqw + 0cqw); /* Правый край бара + небольшой отступ */
    background-color: #cf0a2c;
    color: white;
    border: none;
    border-radius: 10.42cqw; /* Пропорциональный border-radius */
    padding: 2.5cqw 5cqw; /* Адаптивный padding */
    font-size: 2.92cqw; /* 14px / 480px * 100 */
    font-weight: 500;
    font-family: 'Suisse Intl', sans-serif;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 0.83cqw 2.5cqw rgba(207, 10, 44, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
}

.pwa-install-button.show {
    opacity: 1;
    transform: translateY(0);
}

.pwa-install-button:hover {
    background-color: #cf0a2c;
    box-shadow: 0 0.83cqw 2.5cqw rgba(207, 10, 44, 0.3);
    transform: translateY(-2px);
}

.pwa-install-button:active {
    transform: scale(0.95);
}

.pwa-install-button-icon {
    display: inline-block;
    width: 4.17cqw; /* 20px / 480px * 100 */
    height: 4.17cqw; /* 20px / 480px * 100 */
    margin-right: 1.67cqw; /* 8px / 480px * 100 */
    vertical-align: middle;
}

/* iOS Install Instructions Modal */
.pwa-ios-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.pwa-ios-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-ios-modal-header {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pwa-ios-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin-left: 73px;
}

.pwa-ios-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.pwa-ios-modal-close:hover {
    background-color: #f5f5f5;
}

.pwa-ios-modal-body {
}

.pwa-ios-modal-body p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 16px;
}

.pwa-ios-modal-body ol {
    margin: 0;
    padding-left: 20px;
    color: #333;
}

.pwa-ios-modal-body li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.share-icon {
    display: inline-block;
    font-size: 20px;
    color: #007AFF;
    vertical-align: middle;
}

.pwa-ios-modal-image {
    text-align: center;
}

.pwa-ios-modal-image img {
    max-width: 85%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

/* Скрываем кнопку на десктопе */
@media (min-width: 481px) {
    .pwa-install-button {
        display: none !important;
    }
}

/* Адаптация для iOS Safari */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .pwa-install-button {
        appearance: none;
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Адаптация модального окна */
@media (max-width: 480px) {
    .pwa-ios-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Скрываем кнопку в Telegram WebApp */
.telegram-webapp .pwa-install-button {
    display: none !important;
}

/* Дополнительная защита для Telegram */
body[data-telegram="true"] .pwa-install-button,
body.is-telegram-webapp .pwa-install-button {
    display: none !important;
}

/* Скрываем кнопку на страницах выбора статуса и онбординга */
.status-choice-page .pwa-install-button,
.onboarding-page .pwa-install-button {
    display: none !important;
}