/* ========================================================================
   landing-play.css — Google Play / Material Design лендинг.

   Все правила scoped под `.landing-play` чтобы CSS можно было подключить
   как на полноценном лендинге (`<body class="landing-play">`), так и в
   админ-превью (`<div class="landing-play">`) без leakage в админ-стили.

   Цветовая палитра близка к нативному Google Play (light theme).
   Шрифт — system sans (Roboto / Google Sans / SF Pro Display fallback).
   ======================================================================== */

/* ── Wrapper + CSS variables ─────────────────────────────────── */
.landing-play {
    --color-text:        #202124;
    --color-text-muted:  #5f6368;
    --color-divider:     #e8eaed;
    --color-accent:      #01875f;
    --color-accent-hover:#017053;
    --color-bg:          #ffffff;
    --color-bg-soft:     #f1f3f4;
    --color-verified:    #1357cd;
    --color-star-empty:  #dadce0;
    --color-star-fill:   #01875f;

    --font-stack: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --container-max: 720px;
    --container-pad: 16px;

    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-stack);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Container query context — responsive triggers основаны на ширине wrapper'а,
       не viewport'а. Нужно чтобы в админ-превью (360px frame) НЕ применялись
       desktop-rules от viewport браузера 1920px. */
    container-type: inline-size;
    container-name: landing-play;
}

.landing-play, .landing-play * { box-sizing: border-box; }

.landing-play img { display: block; max-width: 100%; }
.landing-play a { color: inherit; text-decoration: none; }
.landing-play h1,
.landing-play h2,
.landing-play h3,
.landing-play h4 { margin: 0; font-weight: 500; color: var(--color-text); }

.landing-play .wrapper { display: block; }
.landing-play .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* ── Header (toolbar) — скроллится вместе с контентом, не sticky ── */
.landing-play .header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 var(--container-pad);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
}
.landing-play .header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
}
.landing-play .header__container a {
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.15s;
}
.landing-play .header__container a:hover {
    background-color: var(--color-bg-soft);
}
.landing-play .header-more__box { display: flex; gap: 8px; }

/* ── Program section (main app card) ─────────────────────────── */
.landing-play .program {
    padding-top: 16px;
    padding-bottom: 8px;
}
.landing-play .program__container.main-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.landing-play .program__left-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.landing-play .program-logo {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--color-bg-soft);
}
.landing-play .program-logo .logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.landing-play .program-info { flex: 1; min-width: 0; }
.landing-play .app-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.landing-play .program-name {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text);
}
.landing-play .verified-icon {
    flex-shrink: 0;
    width: 18px;
    height: 20px;
}
.landing-play .program-info-first {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-accent);
    margin-bottom: 6px;
}
.landing-play .program-company {
    font-weight: 500;
    color: var(--color-accent);
}
.landing-play .advertising {
    color: var(--color-text-muted);
    font-size: 12px;
}
.landing-play .advertising:before {
    content: '• ';
    color: var(--color-text-muted);
    margin-right: 4px;
}

/* ── Header metrics (Rating / Downloads / Age) ──────────────── */
.landing-play .header-metrics {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
}
.landing-play .header-metrics__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 0 4px;
}
.landing-play .header-metrics__item + .header-metrics__item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: var(--color-divider);
}
.landing-play .header-metrics__item-top {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 3px;
}
.landing-play .header-metrics__item-top span { font-weight: 500; }
.landing-play .header-metrics__item-bottom {
    font-size: 11px;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.landing-play .header-metrics__item.is--age .header-metrics__item-top span {
    border: 1px solid var(--color-text-muted);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 16px;
}

/* ── Install button ──────────────────────────────────────────── */
.landing-play .install-button {
    width: 100%;
    min-height: 36px;
    background-color: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
}
.landing-play .install-button:hover:not(:disabled) {
    background-color: var(--color-accent-hover);
}
.landing-play .install-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.landing-play .install-button__text { white-space: nowrap; }
.landing-play .install-button__progress {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.landing-play .install-button__loader { display: none; }

/* ── Fake install progress states ────────────────────────────── */
.landing-play .install-button.is-loading {
    background-color: var(--color-text-muted);
    cursor: progress;
}
.landing-play .install-button.is-loading .install-button__text { display: none; }
.landing-play .install-button.is-loading .install-button__progress {
    display: inline-flex;
}
.landing-play .install-button.is-loading .install-button__loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: landing-play-spin 0.8s linear infinite;
    margin-right: 6px;
}
.landing-play .install-button.is-starting {
    background-color: var(--color-text-muted);
}
.landing-play .install-button.is-starting .install-button__progress { display: none; }
.landing-play .install-button.is-starting .install-button__loader {
    display: inline-block;
    margin-right: 6px;
    width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff; border-radius: 50%;
    animation: landing-play-spin 0.8s linear infinite;
}

.landing-play .install-button__progress[hidden] { display: none; }

/* ── Post-install waiting state ──────────────────────────────────
   Between user accepting the install prompt and Android finishing the
   WebAPK intent-filter registration (~1-10 sec), the button is locked
   in a gray "Installing..." state. Prevents the user from tapping
   prematurely (which would silently fail — see appinstalled handler
   in landing-play.js). */
.landing-play .install-button.is-waiting {
    background-color: var(--color-text-muted);
    cursor: progress;
}
.landing-play .install-button.is-waiting .install-button__progress { display: none; }
.landing-play .install-button.is-waiting .install-button__loader {
    display: inline-block;
    margin-right: 6px;
    width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff; border-radius: 50%;
    animation: landing-play-spin 0.8s linear infinite;
}

@keyframes landing-play-spin { to { transform: rotate(360deg); } }

/* ── Screenshots ─────────────────────────────────────────────── */
.landing-play .program__images-box {
    margin: 16px -16px 0;
    padding: 0 16px;
    overflow: hidden;
}
.landing-play .program__images {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.landing-play .program__images::-webkit-scrollbar { display: none; }
.landing-play .program__images a {
    flex-shrink: 0;
    scroll-snap-align: start;
}
.landing-play .program__images img {
    width: 110px;
    height: 196px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--color-divider);
}

/* ── Section base ────────────────────────────────────────────── */
.landing-play section {
    padding: 16px 0;
    border-top: 1px solid var(--color-divider);
}
.landing-play section:first-of-type { border-top: none; }

.landing-play .title__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.landing-play .title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.landing-play .title h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}
.landing-play .more-btn {
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.15s;
}
.landing-play .more-btn:hover { background-color: var(--color-bg-soft); }

/* ── Description ─────────────────────────────────────────────── */
.landing-play .description__content {
    position: relative;
    margin-bottom: 8px;
}
.landing-play .description__expand {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.55;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.landing-play .description__expand.collapsed {
    max-height: 88px;
}
.landing-play .description__expand p {
    margin: 0;
}
.landing-play .description__content .shadow {
    display: none;
}
.landing-play .description__expand.collapsed + .shadow {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--color-bg));
    pointer-events: none;
}
.landing-play .expand-btn {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 8px;
}
.landing-play .expand-btn:hover { color: var(--color-accent-hover); }

.landing-play .description__category {
    margin-top: 12px;
}
.landing-play .description__category-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--color-divider);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-text);
    transition: background-color 0.15s;
}
.landing-play .description__category-btn:hover { background-color: var(--color-bg-soft); }

/* ── Rating-reviews ──────────────────────────────────────────── */
.landing-play .rating__box {
    display: flex;
    gap: 24px;
    align-items: center;
}
.landing-play .rating__left {
    text-align: center;
    flex-shrink: 0;
}
.landing-play .rating__total {
    font-size: 48px;
    font-weight: 400;
    line-height: 1;
    color: var(--color-text);
    margin-bottom: 4px;
}
.landing-play .rating__stars-box {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}
.landing-play .total-votes {
    font-size: 11px;
    color: var(--color-text-muted);
}
.landing-play .rating__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.landing-play .rating__bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.landing-play .rating__bar > span {
    font-size: 11px;
    color: var(--color-text-muted);
    width: 8px;
    text-align: right;
}
.landing-play .progress {
    flex: 1;
    height: 8px;
    background: var(--color-bg-soft);
    border-radius: 4px;
    overflow: hidden;
}
.landing-play .progress .bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Stars (звёзды через CSS variable --rating от 0 до 5). */
.landing-play .stars {
    --pct: calc(var(--rating, 0) / 5 * 100%);
    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    color: var(--color-star-empty);
}
.landing-play .stars:before {
    content: '★★★★★';
    letter-spacing: 1px;
}
.landing-play .stars:after {
    content: '★★★★★';
    letter-spacing: 1px;
    color: var(--color-star-fill);
    position: absolute;
    top: 0;
    left: 0;
    width: var(--pct);
    overflow: hidden;
    white-space: nowrap;
}

/* ── Reviews ─────────────────────────────────────────────────── */
.landing-play .reviews__container {
    display: flex;
    flex-direction: column;
}
.landing-play .review {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-divider);
}
.landing-play .review:last-of-type { border-bottom: none; }
.landing-play .review__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.landing-play .review__img {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-bg-soft);
}
.landing-play .review__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.landing-play .review__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}
.landing-play .review__name { flex: 1; min-width: 0; }
.landing-play .review__name h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}
.landing-play .review__more-box .review__more {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.landing-play .review__more:hover { background-color: var(--color-bg-soft); }
.landing-play .review__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.landing-play .review-date {
    font-size: 11px;
    color: var(--color-text-muted);
}
.landing-play .review__text {
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.55;
}
.landing-play .review__text p { margin: 0; }
.landing-play .review__likes {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}
.landing-play .review__qna {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.landing-play .review__qna > span {
    font-size: 11px;
    color: var(--color-text-muted);
}
.landing-play .review__true-false {
    display: flex;
    gap: 4px;
}
.landing-play .review__true-false a {
    padding: 4px 14px;
    border: 1px solid var(--color-divider);
    border-radius: 14px;
    font-size: 11px;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 0.15s;
}
.landing-play .review__true-false a:hover { background-color: var(--color-bg-soft); }
.landing-play .review__true-false a.is-selected {
    background-color: var(--color-bg-soft);
    border-color: var(--color-text-muted);
}

/* Developer reply card */
.landing-play .review__qna-answer {
    margin-top: 12px;
    margin-left: 44px;
    padding: 12px 14px;
    background: var(--color-bg-soft);
    border-radius: 8px;
}
.landing-play .review__qna-answer-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.landing-play .review__qna-answer-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

.landing-play .all-reviews {
    display: inline-block;
    margin-top: 16px;
    color: var(--color-accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.landing-play .all-reviews:hover { color: var(--color-accent-hover); }

/* ── Contacts footer ─────────────────────────────────────────── */
.landing-play .contacts__more-btn.rotate svg {
    transition: transform 0.2s;
}
.landing-play .contacts__block {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.landing-play .contacts__block.open {
    max-height: 500px;
}
.landing-play .contacts__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.landing-play .contacts__list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider);
}
.landing-play .contacts__list li:last-child { border-bottom: none; }
.landing-play .contacts__list a {
    color: var(--color-text);
    font-size: 14px;
    display: block;
}

/* ── Install-instruction modal — landing-only ───────────────────
   SAME markup as the apple theme (shared partial templates/landing/_install_modal.html.twig).
   Styles ported here (mirrors landing-apple.css) so the play theme renders the
   modal identically. Scoped .landing-play; not present in preview. Fallbacks on
   --color-divider / --color-text-muted in case the play theme doesn't define them. */
.landing-play .safari-install-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}
.landing-play .safari-install-modal.active { display: flex; }
.landing-play .safari-install-modal .modal-content {
    background-color: var(--color-bg);
    padding: 20px 32px;
    border-radius: 34px;
    max-width: 382px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.landing-play .safari-install-modal .modal-content__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 22px;
    letter-spacing: -0.4px;
    margin: 0 0 22px;
    text-align: center;
}
.landing-play .safari-install-modal .app-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 16px;
    border-top: 0.5px solid var(--color-divider, rgba(0, 0, 0, 0.1));
    border-bottom: 0.5px solid var(--color-divider, rgba(0, 0, 0, 0.1));
    padding: 12px 0;
}
.landing-play .safari-install-modal .app_preview {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}
.landing-play .safari-install-modal .app_preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.landing-play .safari-install-modal .info_app { align-self: center; }
.landing-play .safari-install-modal .info_app > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.landing-play .safari-install-modal .titl_app {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}
.landing-play .safari-install-modal .app_descr {
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 220px;
}
.landing-play .safari-install-modal .modal-content__list {
    margin: 24px 0 0;
    padding-left: 20px;
}
.landing-play .safari-install-modal .modal-content__list li {
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}
.landing-play .safari-install-modal .modal-content__list li:last-child { margin-bottom: 0; }
.landing-play .safari-install-modal .list-logo {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    vertical-align: middle;
}
.landing-play .tap-icon-svg {
    vertical-align: middle;
    margin: 0 2px;
}

/* ── Responsive (container queries — основаны на ширине .landing-play) ── */
@container landing-play (min-width: 480px) {
    .landing-play .program__container.main-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
    .landing-play .program__left { flex: 1; }
    .landing-play .install-button {
        width: auto;
        min-width: 120px;
        align-self: flex-start;
        margin-left: 16px;
    }
}

@container landing-play (min-width: 640px) {
    .landing-play .program__images img {
        width: 130px;
        height: 232px;
    }
}
