/* ==========================================================================
   1. СБРОС И БАЗОВЫЕ НАСТРОЙКИ СЕТКИ (Исправлено!)
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f6f8;
    color: #1c1c1e;
    -webkit-font-smoothing: antialiased;
}

/* Стили для заголовков витрины, чтобы старые стили документов их не ломали */
.app-header h1, .app-info-block h1 {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 8px 0 !important;
}

/* Специальный класс-контейнер для страниц политик и прав субъектов.
   Примените его к тегу <body> ТОЛЬКО в файлах privacy/rights документов,
   чтобы они выглядели как раньше и были зажаты в 800px. */
.legal-doc-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    background-color: #f5f6f8;
}

h3 { margin-top: 20px; color: #333; }
p, li { color: #444; }
ul, ol { padding-left: 20px; }

.highlight { background-color: #f9f9f9; padding: 15px; margin: 20px 0; }
.highlight.privacy-blue { border-left: 4px solid #0076ff; }
.highlight.rights-orange { border-left: 4px solid #ff9500; }

/* ==========================================================================
   2. ШАПКА САЙТА (Стиль RuStore)
   ========================================================================== */
.app-header {
    background: white;
    padding: 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e5ea;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px !important; /* Принудительное скругление иконки */
    margin-right: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: block;
}

.app-info-block {
    display: flex;
    flex-direction: column;
}

.app-info-block h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1c1c1e;
}

.app-author-tag {
    font-size: 14px;
    color: #007aff;
    font-weight: 500;
}

/* ==========================================================================
   3. АВТОМАТИЧЕСКАЯ КАРУСЕЛЬ СКРИНШОТОВ (Фиксация размеров!)
   ========================================================================== */
.carousel-wrapper {
    max-width: 1000px;
    margin: 20px auto 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.carousel-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e5e5ea;
    overflow: hidden;
    position: relative;
    height: 380px; /* Жестко фиксируем высоту контейнера под вертикальные скриншоты */
    box-sizing: border-box;
}

.carousel-track {
    display: flex;
    gap: 14px;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-track img {
    width: 190px; /* Фиксируем ширину каждого скриншота */
    height: 340px; /* Фиксируем высоту каждого скриншота */
    object-fit: cover; /* Защита от искажения пропорций картинок */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

/* ==========================================================================
   4. СЕТКА И ОСНОВНОЙ КОНТЕНТ (ДВЕ КОЛОНКИ)
   ========================================================================== */
.content-container {
    max-width: 1000px;
    margin: 20px auto;
    display: flex;
    gap: 24px;
    padding: 0 16px;
    box-sizing: border-box;
}

.left-column {
    flex: 2;
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e5e5ea;
    height: fit-content;
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e5e5ea;
}

h2 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 600;
    color: #1c1c1e;
}

.description-text {
    font-size: 15px;
    line-height: 1.6;
    color: #3a3a3c;
    white-space: pre-line;
}

.whats-new-block {
    border-left: 3px solid #007aff;
    padding-left: 12px;
    font-size: 14px;
    color: #3a3a3c;
}

/* ==========================================================================
   5. КНОПКИ УСТАНОВКИ МАГАЗИНОВ (Восстановление стиля!)
   ========================================================================== */
.store-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Стилизация ссылок под полноценные нажимаемые кнопки */
.store-buttons-grid a.btn-store {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    padding: 14px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    transition: transform 0.1s, background-color 0.2s !important;
    text-align: center !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.store-buttons-grid a.btn-store span {
    display: block !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    opacity: 0.85 !important;
    margin-top: 4px !important;
}

.store-buttons-grid a.btn-store:hover {
    text-decoration: none !important;
    opacity: 0.95;
}

.store-buttons-grid a.btn-store:active {
    transform: scale(0.98) !important;
}

/* Цвета для каждой кнопки стора */
.btn-apk { background-color: #34c759 !important; }
.btn-rustore { background-color: #005bff !important; }
.btn-huawei { background-color: #e6162d !important; }
.btn-oppo { background-color: #008453 !important; }
.btn-nash { background-color: #2c3e50 !important; }

/* ==========================================================================
   6. ИНФОРМАЦИОННЫЕ ПАНЕЛИ И ФУТЕР
   ========================================================================== */
#update-alert {
    display: none;
    background: #e5f1ff;
    border: 1px solid #007aff;
    color: #0056b3;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.legal-footer {
    text-align: center;
    padding: 30px;
    font-size: 12px;
    color: #8e8e93;
    background: white;
    border-top: 1px solid #e5e5ea;
    margin-top: 40px;
}

.legal-footer a {
    color: #007aff !important;
    text-decoration: none !important;
    margin: 0 10px;
}

.legal-footer a:hover {
    text-decoration: underline !important;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column;
    }
    .app-header {
        padding: 16px;
    }
    .app-icon {
        width: 72px;
        height: 72px;
        border-radius: 16px !important;
    }
    .app-info-block h1 {
        font-size: 22px;
    }
    .carousel-container {
        height: 280px;
    }
    .carousel-track img {
        width: 140px;
        height: 240px;
    }
}