/* =========================
   MOST POPULAR ADD-ONS
   Horizontal card carousel (scroll-snap + arrow buttons).
   Sits on the dark page background under the hero slider.
========================= */

.popular {
    --pop-card: #262626;
    --pop-line: #3D3D3D;
    --pop-gold: #FFD23F;
    --pop-green: #6CC04A;

    padding: 40px 16px 48px;
}

.popular-inner {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
}

.pop-icon {
    flex-shrink: 0;
    shape-rendering: crispEdges;
}


/* ---------- HEADER ---------- */

.popular-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.popular-title {
    flex: 1 1 100%;

    font-family: "Texureon", Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.popular-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.popular-btn {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: transparent;
    border: 0;

    color: #fff;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.popular-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.popular-btn:disabled {
    color: #555;
    cursor: default;
}

.popular-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* ---------- TRACK ---------- */

.popular-track {
    display: flex;
    gap: 12px;

    /* bleed to the screen edge so the next card peeks in */
    margin-inline: -16px;
    padding: 4px 16px 12px;
    scroll-padding-inline: 16px;

    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.popular-track::-webkit-scrollbar {
    display: none;
}


/* ---------- CARD ---------- */

.pop-card {
    flex: 0 0 280px;

    display: flex;
    flex-direction: column;

    padding: 16px;

    background: var(--pop-card);
    border-top: 3px solid var(--pop-line);
    border-bottom: 3px solid #000;

    color: #fff;
    scroll-snap-align: start;

    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pop-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 201, 51, 0.25);
    border-top-color: #FFC933;
}

.pop-card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.pop-card:hover .pop-card-title,
.pop-card:focus-visible .pop-card-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pop-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}

.pop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--pos, 50%) 50%;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.pop-card:hover .pop-card-media img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

.pop-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(253, 210, 74, 0.35), transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.pop-card:hover .pop-card-media::after {
    opacity: 1;
}

.pop-card-badge {
    position: absolute;
    left: 0;
    bottom: 0;

    padding: 4px 10px 3px;

    background: #1A1A1A;
    border: 3px solid var(--pop-gold);

    color: var(--pop-gold);
    font-family: "Minecraft", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.2;
}

.pop-card-title {
    margin-top: 20px;

    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.pop-card-desc {
    margin-top: 10px;
    color: var(--muted-color);
    font-size: 14px;
    line-height: 1.55;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pop-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.pop-card-type {
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 6px 12px 5px;

    background: #141414;
    border-bottom: 2px solid var(--pop-line);

    font-size: 16px;
    line-height: 1.3;
    white-space: nowrap;
}

.pop-card-author {
    min-width: 0;
    overflow: hidden;

    color: var(--muted-color);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pop-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    margin-top: auto;
    padding-top: 22px;
}

.pop-card-cost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.coin-icon {
    width: 18px;
    height: 18px;
    display: block;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}

.pop-card-price {
    font-family: "Minecraft", Arial, sans-serif;
    font-size: 18px;
    line-height: 1;
    color: #FFC933;
    text-shadow: 0 2px 0 #7A4B00;
}

.pop-card-price.is-free {
    color: var(--pop-green);
    text-shadow: 0 2px 0 #1F4A14;
}


/* ---------- DESKTOP ---------- */

@media (min-width: 701px) {
    .popular {
        padding: 56px 30px 64px;
    }

    .popular-head {
        flex-wrap: nowrap;
        margin-bottom: 20px;
    }

    .popular-title {
        flex: 1 1 auto;
        font-size: 40px;
    }

    .popular-nav {
        flex-shrink: 0;
    }

    .popular-track {
        gap: 20px;
        margin-inline: 0;
        padding-inline: 0;
        scroll-padding-inline: 0;
    }

    .pop-card {
        flex-basis: 340px;
    }

    .pop-card-title {
        font-size: 22px;
    }
}
