/* =========================
   LAYOUT
========================= */
.centerx {
    max-width: 1200px;
    margin: 0 auto;
}

main h2 {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    color: var(--text-light);
}

main h3 {
    font-size: 14px;
    color: var(--text-dark);
}

/* =========================
   COMMON
========================= */
.rank-item,
.rec-item,
.btn-more {
    text-decoration: none;
}

.gallery-container,
.rank-title {
    white-space: nowrap;
}

.rank-title{
    text-overflow: ellipsis;
}

.trusted-modal[aria-hidden="true"] {
    display: none;
}

/* =========================
   APP HEADER
========================= */
.app-header,
.app-header *,
.app-header::after,
.app-header::before {
    box-sizing: border-box;
}

.app-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 14px;
    overflow-x: hidden;
}

/* =========================
   ACTION BUTTONS & BADGES
========================= */
.trusted-badge {
    display: inline-flex;
    font-size: 12px;
    white-space: nowrap;
    align-items: center;
    color: #10b981;
    cursor: pointer;
    font-weight: 500;
}

.trusted-badge svg {
    fill: currentColor;
    margin-right: 4px;
    width: 16px;
    height: 16px;
}

/* =========================
   DESCRIPTION
========================= */
.description-box-info {
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.description-wrapper {
    position: relative;
    overflow: hidden;
    max-height: 180px;
    transition: max-height 0.3s ease;
}

.description-wrapper.expanded {
    max-height: none;
}

.description-content {
    width: auto !important;
    word-break: break-word;
    color: var(--text-dark);
    font-size: 15px;
    line-height: 28px;
}

.description-content p {
    margin-bottom: 5px;
}
.description-content ul {
    margin: 16px 0;
    padding-left: 20px;
    list-style: none;
}

.description-content li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 22px;
    line-height: 26px;
    color: var(--text-light);
}

.description-content li::before {
	content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-dark);
    
}

.description-content li:last-child {
    margin-bottom: 0;
}

.fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--card-bg));
    pointer-events: none;
    display: block;
    transition: opacity 0.3s;
}

.fade-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.toggle-btn {
    color: var(--linkweb);
    display: block;
    font-size: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: 0;
    margin-left: auto;
    text-align: right;
}

.arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.toggle-btn.expanded .arrow {
    transform: rotate(180deg);
}

/* =========================
   GALLERY
========================= */
.gallery-container {
    padding: 10px 0;
    max-width: 100vw;
    overflow-x: auto;
}

.gallery-container::-webkit-scrollbar {
    display: none;
}

.gallery {
    display: flex;
    gap: 10px;
}

.gallery img {
    height: 250px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    opacity: 1;
    background: var(--soft-bg);
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay-dark);
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 5px;
}

.lightbox .close,
.lightbox .next,
.lightbox .prev {
    position: absolute;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: none;
}

.lightbox .close {
    top: 10px;
    right: 20px;
}

.lightbox .next,
.lightbox .prev {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox .prev {
    left: 10px;
}

.lightbox .next {
    right: 10px;
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
}


.more-wrap {
    padding: 20px 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.btn-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background-color: var(--soft-bg);
    color: var(--text-dark);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    border-radius: 99px;
    transition: var(--transition);
}

.btn-more:hover {
    background-color: var(--hover-bg);
    color: var(--text-dark);
}


.btn-more:active {
    transform: scale(0.98);
}

/* =========================
   RECOMMEND
========================= */
.rec-wrapper {  
    margin-top: 10px;
    padding-bottom: 10px;
}

.rec-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.rec-item {
    display: flex;
    align-items: center;
    padding: 10px;
    transition: var(--transition);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: inherit;
}

.rec-item:hover {
    border-color: var(--linkweb);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rec-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 12px;
}

.rec-thumb img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: var(--muted-bg);
}

.rec-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rec-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-dev {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.rec-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

/* =========================
   RANK
========================= */
.rank-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.rank-header p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    padding-left: 4px;
}

.rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 10px;
    transition: var(--transition);
    border-radius: 8px;
    border: 1px solid transparent;
}

.rank-item:hover {
    background: var(--muted-bg);
    border-color: var(--border-color);
}

.rank-num {
    width: 30px;
    margin-right: 10px;
    text-align: center;
    font-style: italic;
    font-weight: 800;
    color: var(--text-light);
}

.rank-num.rank-1 { color: var(--gold-color); font-size: 20px; }
.rank-num.rank-2 { color: var(--silver-color); font-size: 19px; }
.rank-num.rank-3 { color: var(--bronze-color); font-size: 18px; }

.rank-thumb img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--soft-bg);
}

.rank-main {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.rank-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 2px;
    overflow: hidden;
}


/* =========================
   ALTERNATIVES
========================= */
.alt-box {
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 20px;
}

.alt-header {
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.alt-header p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--text-light);
}

/* =========================
   TRUSTED MODAL
========================= */
.trusted-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.trusted-backdrop {
    position: absolute;
    inset: 0;
    background: var(--backdrop-dark);
    z-index: 1;
}

.trusted-dialog {
    position: relative;
    width: min(600px, 92%);
    background: var(--card-bg);
    color: var(--text-dark);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 20px;
    z-index: 2;
}

.trusted-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.trusted-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.trusted-header img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
}

.trusted-body {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

.trusted-list {
    margin: 10px 0;
    padding-left: 20px;
}

.trusted-footer {
    margin-top: 20px;
    text-align: right;
}

.trusted-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.trusted-btn:hover {
    background-color: var(--primary-hover);
}

.apk-hero__desc {
    font-size: 16px;
    line-height: 1.6;
    max-width: 460px;
}

/* =========================
   PANELS
========================= */

.panel {
    background: var(--card-bg);
    padding: 14px;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.panel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
}

.featured__grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 14px;
}

.featured__item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured__card {
    height: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    text-align: center;
    transition: var(--transition);
}

.featured__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.featured__thumb-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 8px;
}

.featured__thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    background: var(--bg-color);
}

.featured__name {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--text-dark);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================
   MORE APP HERO STYLES
========================= */
.rec-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.mmm {
    display: flex;
    justify-content: space-between;
}

.apk-hero {
    background: var(--bg-hero);
    color: var(--text-dark);
    overflow: hidden;
    padding: 20px 18px 0;
}

.apk-hero *,
.apk-hero *::before,
.apk-hero *::after {
    box-sizing: border-box;
}

.apk-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 10px;
}

.apk-hero__grid {
    display: grid;
    grid-template-columns: minmax(320px, 500px) minmax(520px, 1fr);
    align-items: start;
    gap: 72px;
}

.apk-hero__content {
    min-width: 0;
    max-width: 500px;
}

.apk-hero__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.apk-hero__icon {
    width: 86px;
    height: 86px;
    border-radius: 16px;
    flex: 0 0 auto;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.apk-hero__title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.apk-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 10px;
}

.apk-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 22px;
    border-radius: 5px;
    background: var(--downbg);
    color: var(--downtext);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s ease;
	    max-width: 320px;
    width: 100%;
}

.apk-hero__figure {
    width: 100%;
    max-width: 780px;
    margin: 0;
}

.apk-hero__image {
    width: 100%;
    height: auto;
    display: block;
}

.apk-hero-h1 {
    display: flex;
    flex-direction: column;
    text-align: left;
	    gap: 5px;
}

/* =========================
   META STRIP
========================= */
.apk-meta-strip {
    display: flex;
}

.apk-meta-strip__item {
    position: relative;
    text-align: center;
    padding: 10px 12px 8px;
    min-width: 0;
}

.apk-meta-strip__top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 24px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.apk-meta-strip__main {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-dark);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apk-meta-strip__sub {
    font-size: 14px;
    line-height: 1.35;
    color: var(--text-light);
    opacity: 0.78;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apk-meta-strip__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 34px;
    transform: translateY(-50%);
    background: var(--border-color);
    opacity: 0.9;
}

/* =========================
   SPECS CARD
========================= */
.apk-specs-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
	margin-top: 10px;
}

.apk-specs-card__head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.apk-specs-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.apk-specs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.apk-specs-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}

.apk-specs-item:not(:nth-child(4n)) {
    border-right: 1px solid var(--border-color);
}

.apk-specs-item__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    opacity: 0.75;
    margin-bottom: 4px;
    text-transform: uppercase;
    line-height: 1.3;
}

.apk-specs-item__value {
    font-size: 13.5px;
    color: var(--text-dark);
    line-height: 1.4;
    word-break: break-word;
}

.apk-specs-item__value a {
    color: var(--linkweb);
    text-decoration: none;
}

.apk-specs-item__value a:hover {
    text-decoration: underline;
}

.apk-specs-item__value--rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.apk-specs-star {
    color: var(--warning-color);
    font-size: 13px;
    line-height: 1;
}

.apk-specs-muted {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.7;
}

.apk-specs-item__value--mono {
    font-family: monospace;
    font-size: 12.5px;
}

.apk-specs-item--accent {
    background: var(--muted-bg);
}

.rec-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 14px;
    overflow-x: hidden;
	    margin-top: 10px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1200px) {
    .featured__grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

@media (max-width:960px) {
    .apk-hero__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .apk-hero__actions {
        align-items: center;
    }
    .apk-hero__media {
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .featured__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .rec-list {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding-bottom: 15px;
        scrollbar-width: none;
    }

    .rec-list::-webkit-scrollbar {
        display: none;
    }

    .rec-item {
        min-width: 260px;
        max-width: 260px;
        scroll-snap-align: start;
    }

    .rec-thumb {
        width: 54px;
        height: 54px;
    }

    main h2 {
        font-size: 17px;
    }

    .description-content p, .apk-hero__desc {
        font-size: 14px;
    }

    .panel__head {
        align-items: flex-start;
        gap: 10px;
    }

    .featured__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    .featured__card {
        padding: 8px;
    }

    .featured__name {
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    .apk-hero {
        padding: 18px 16px 0;
    }

    .apk-hero__icon {
        width: 68px;
        height: 68px;
    }

    .apk-hero__title {
        font-size: 18px;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box; 
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .apk-hero__btn {
        width: 60%;      
    }

    .apk-hero__figure {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
    }

    .apk-meta-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 10px;
    }

    .apk-meta-strip__item {
        padding: 8px 10px 6px;
    }

    .apk-meta-strip__sub {
        font-size: 13px;
    }

    .apk-specs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apk-specs-item {
        padding: 9px 10px;
        border-right: none;
    }

    .apk-specs-item:not(:nth-child(2n)) {
        border-right: 1px solid var(--border-color);
    }

    .apk-specs-item__label {
        font-size: 10.5px;
    }

    .apk-specs-item__value {
        font-size: 13px;
    }

    .apk-specs-muted {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .svg-icon {
        width: 14px;
        height: 14px;
    }

    .panel__title {
        font-size: 14px;
    }

    .featured__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .apk-meta-strip__item {
        padding: 7px 8px 5px;
    }

    .apk-meta-strip__sub {
        font-size: 12px;
    }
}

/* =========================
   APK FAQ
========================= */

.apk-faq {
    padding: 10px 0;
}

.apk-faq__box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);   
    padding: 10px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}


/* Header */

.apk-faq__head p {
    margin: 0 0 14px;
    color: var(--text-light);
    font-size: 14px;
    opacity: 0.8;
}

/* List */

.apk-faq__list {
    display: flex;
    flex-direction: column;
}

/* Item */

.apk-faq__item {
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    transition: var(--transition);
}

.apk-faq__item:first-child {
    border-top: none;
}


/* Question */

.apk-faq__question {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.45;
    position: relative;
    padding-right: 20px;
}

/* Arrow */

.apk-faq__question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 18px;
    color: var(--brand-color);
    transition: var(--transition);
}

/* Open state */

.apk-faq__item[open] .apk-faq__question::after {
    content: "−";  
}

/* Answer */

.apk-faq__answer {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
}

.apk-faq__answer p {
    margin: 0;
}

/* Link answer */

.apk-faq__answer a {
    color: var(--linkweb);
    text-decoration: none;
    border-bottom: 1px dashed var(--linkweb);
}

/* Mobile */

@media (max-width: 767px) {
    .apk-faq__box {
        padding: 16px;
    }
    .apk-faq__answer {
        font-size: 14px;
    }
}

@media (max-width: 960px) {
    .apk-hero__actions {
        align-items: center;
    }
}

@media (max-width: 767px) {
    .apk-hero__btn {
        width: 60%;
        max-width: 320px;
    }
}

@media (max-width: 520px) {
    .apk-hero__btn {
        width: 100%;
    }
}
