/* Play Store clone — стилизация под актуальный Google Play (мобильная сетка) */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --gp-green: #01875f;
    --gp-green-hover: #017a55;
    --gp-text: #202124;
    --gp-text-secondary: #5f6368;
    --gp-divider: #e8eaed;
    --gp-bg: #ffffff;
    --gp-chip-bg: #f1f3f4;
    --gp-link: #1a73e8;
    --gp-star: #5f6368;
    --gp-shadow: 0 1px 2px rgba(60, 64, 67, .15);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--gp-bg);
    color: var(--gp-text);
    font-family: "Google Sans", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gp-link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    background: none;
}

/* === Header === */
.gp-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid var(--gp-divider);
}
.gp-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 8px 12px;
}
.gp-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 20px;
    color: var(--gp-text);
    text-decoration: none;
}
.gp-header .logo svg { flex: 0 0 auto; }
.gp-header .logo-text { font-weight: 400; font-size: 20px; }
.gp-header .spacer { flex: 1; }
.gp-header .icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gp-text-secondary);
    background: none;
    border: 0;
    cursor: pointer;
}
.gp-header .icon-btn:hover { background: var(--gp-chip-bg); }

/* === Bottom navigation === */
.gp-bottomnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 20;
    background: #fff;
    border-top: 1px solid var(--gp-divider);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 8px;
    box-shadow: 0 -1px 3px rgba(60, 64, 67, .08);
}
.gp-bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gp-text-secondary);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 8px;
    min-width: 56px;
    text-align: center;
}
.gp-bnav-item.active { color: var(--gp-green); }
.gp-bnav-item:hover  { color: var(--gp-text); text-decoration: none; }
body { padding-bottom: 72px; }

/* === Container === */
.gp-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

/* === Hero === */
.gp-hero {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}
.gp-hero .app-icon {
    width: 96px; height: 96px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(60,64,67,.15), 0 0 0 1px rgba(60,64,67,.08);
    padding: 4px;
}
.gp-hero .app-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 18px;
}
.gp-hero .app-meta h1 {
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 500;
    color: var(--gp-text);
}
.gp-hero .app-meta .dev {
    color: var(--gp-green);
    font-weight: 500;
    font-size: 14px;
}
.gp-hero .app-meta .ads {
    color: var(--gp-text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

/* === Stats row === */
.gp-stats {
    display: flex;
    gap: 0;
    margin: 20px 0 4px;
    text-align: center;
    border-bottom: 1px solid var(--gp-divider);
    padding-bottom: 16px;
}
.gp-stats .stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 0 6px;
}
.gp-stats .stat + .stat::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--gp-divider);
}
.gp-stats .stat .val {
    font-size: 14px;
    font-weight: 500;
    color: var(--gp-text);
    display: flex; align-items: center; gap: 4px;
}
.gp-stats .stat .label {
    font-size: 11px;
    color: var(--gp-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.rating-info-btn {
    background: none; border: 0; padding: 0;
    color: var(--gp-text-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center;
}
.rating-info-btn svg { display: block; }
.gp-stats .star-icon {
    width: 12px; height: 12px;
    fill: var(--gp-star);
}
.gp-stats .rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gp-text-secondary);
    color: var(--gp-text-secondary);
    border-radius: 4px;
    font-size: 11px;
    padding: 1px 6px;
    font-weight: 600;
}

/* === Install button === */
.gp-cta {
    margin: 18px 0 6px;
}
.gp-install-btn {
    width: 100%;
    background: var(--gp-green);
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 11px 24px;
    border-radius: 20px;
    display: inline-block;
    text-align: center;
    transition: background .15s;
    text-decoration: none;
}
.gp-install-btn:hover { background: var(--gp-green-hover); text-decoration: none; }
.gp-cta-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.gp-cta-row .gp-install-btn { flex: 1; }
.gp-secondary-link {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--gp-text-secondary);
}
.gp-secondary-link a { color: var(--gp-text-secondary); text-decoration: underline; }

.gp-share-row {
    display: flex;
    justify-content: space-around;
    margin-top: 12px;
    padding: 4px 0;
}
.gp-share-row button {
    color: var(--gp-text-secondary);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
}
.gp-share-row button:hover { background: var(--gp-chip-bg); }
.gp-share-row svg { width: 20px; height: 20px; fill: currentColor; }

/* === Family library === */
.gp-family { margin: 16px 0 8px; }
.gp-family .fam-row {
    display: flex; align-items: flex-start; gap: 14px;
    color: var(--gp-text); font-size: 13px;
    padding: 6px 0;
}
.gp-family .fam-row svg {
    width: 18px; height: 18px; fill: var(--gp-text-secondary);
    flex: 0 0 auto; margin-top: 1px;
}
.gp-family .fam-row a { color: var(--gp-link); }

/* === Section === */
.gp-section { padding: 20px 0; border-bottom: 1px solid var(--gp-divider); }
.gp-section:last-child { border-bottom: 0; }
.gp-section .gp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.gp-section h2 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: var(--gp-text);
}
.gp-section .more {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gp-text-secondary);
    border-radius: 50%;
}
.gp-section .more:hover { background: var(--gp-chip-bg); }
.gp-section .more svg { width: 20px; height: 20px; fill: currentColor; }

/* === Screenshots === */
.gp-shots {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: thin;
}
.gp-shots::-webkit-scrollbar { height: 6px; }
.gp-shots::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
.gp-shot {
    flex: 0 0 auto;
    width: 140px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--gp-chip-bg);
    scroll-snap-align: start;
    cursor: pointer;
    aspect-ratio: 9/16;
    border: 1px solid var(--gp-divider);
}
.gp-shot img { width: 100%; height: 100%; object-fit: cover; }

/* === About === */
.gp-about p {
    color: var(--gp-text);
    margin: 0 0 14px;
    white-space: pre-line;
    font-size: 14px;
    line-height: 1.5;
}
.gp-about.collapsed p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gp-about .updated {
    color: var(--gp-text-secondary);
    font-size: 12px;
    margin: 6px 0 12px;
}
.gp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gp-tag {
    background: var(--gp-chip-bg);
    color: var(--gp-text);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
}

/* === Data safety === */
.gp-data-safety .row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
}
.gp-data-safety .row svg { flex: 0 0 auto; width: 22px; height: 22px; fill: var(--gp-text-secondary); margin-top: 2px; }
.gp-data-safety .row .text { font-size: 13px; color: var(--gp-text); }
.gp-data-safety .row .text .ttl { color: var(--gp-text-secondary); font-size: 12px; }

/* === Ratings summary === */
.gp-ratings {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}
.gp-ratings .big {
    font-size: 48px;
    font-weight: 400;
    line-height: 1;
    color: var(--gp-text);
}
.gp-ratings .stars { font-size: 16px; color: var(--gp-green); letter-spacing: 2px; }
.gp-ratings .stars .star-empty { color: var(--gp-divider); }
.gp-ratings .stars .star-half {
    background: linear-gradient(90deg, var(--gp-green) 50%, var(--gp-divider) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gp-ratings .count { color: var(--gp-text-secondary); font-size: 13px; }
.gp-ratings-bars { flex: 1; min-width: 200px; }
.gp-ratings-bars .bar-row {
    display: flex; align-items: center; gap: 8px; margin: 2px 0;
    font-size: 12px; color: var(--gp-text-secondary);
}
.gp-ratings-bars .bar-row .lbl { width: 12px; text-align: right; }
.gp-ratings-bars .bar {
    flex: 1; height: 8px;
    background: var(--gp-chip-bg);
    border-radius: 4px;
    overflow: hidden;
}
.gp-ratings-bars .bar .fill {
    height: 100%;
    background: var(--gp-green);
}

/* === Read-more toggle === */
.read-more-btn {
    color: var(--gp-green);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 0;
    display: inline-block;
}
.read-more-btn:hover { text-decoration: underline; }

/* === Similar apps === */
.gp-similar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.gp-similar-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--gp-text);
    padding: 8px 4px;
    border-radius: 8px;
}
.gp-similar-card:hover { background: var(--gp-chip-bg); text-decoration: none; }
.gp-similar-card .sim-icon {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--gp-chip-bg);
    margin-bottom: 8px;
    border: 1px solid var(--gp-divider);
}
.gp-similar-card .sim-icon img { width: 100%; height: 100%; object-fit: cover; }
.gp-similar-card .sim-name { font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-similar-card .sim-dev { font-size: 12px; color: var(--gp-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.gp-similar-card .sim-rating { font-size: 12px; color: var(--gp-text-secondary); margin-top: 4px; display: flex; align-items: center; gap: 3px; }

/* === Footer === */
.gp-footer {
    padding: 32px 16px;
    color: var(--gp-text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--gp-divider);
    background: #fff;
}
.gp-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 30px;
}
.gp-footer-brand { grid-column: 1 / -1; font-size: 18px; font-weight: 500; color: var(--gp-text); }
.gp-footer-h { font-weight: 500; color: var(--gp-text); margin-bottom: 8px; font-size: 13px; }
.gp-footer-col { display: flex; flex-direction: column; gap: 10px; }
.gp-footer-col a { color: var(--gp-text-secondary); text-decoration: none; font-size: 13px; }
.gp-footer-col a:hover { color: var(--gp-text); text-decoration: underline; }
.gp-footer-lang {
    grid-column: 1 / -1;
    border-top: 1px solid var(--gp-divider);
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gp-text-secondary);
    font-size: 13px;
}

@media (min-width: 800px) {
    .gp-footer-inner { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .gp-footer-brand { grid-column: 1 / 2; }
}

/* === Lightbox === */
.gp-lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .9);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.gp-lightbox.open { display: flex; }
.gp-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.gp-lightbox .close-btn {
    position: absolute; top: 12px; right: 16px;
    color: #fff; font-size: 30px; line-height: 1;
}

/* === Desktop tweaks === */
@media (min-width: 800px) {
    .gp-container { padding: 24px 48px; }
    .gp-hero {
        grid-template-columns: 144px 1fr;
        gap: 24px;
    }
    .gp-hero .app-icon { width: 144px; height: 144px; }
    .gp-hero .app-meta h1 { font-size: 28px; }
    .gp-shot { width: 200px; }
    .gp-cta-row { max-width: 360px; }
}
