.recent-custom-models {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: flex-start;
    gap: 1.5rem;
}

.recent-custom-model-heading {
    font-weight: 700;
    font-size: 24px;
}

.recent-custom-models-section {
    width: 100%;
    min-height: 13.5rem;
    display: grid;
    align-items: center;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* ── Carousel mode ── */
.recent-custom-models-section.carousel-mode {
    display: flex;
    overflow: hidden;           /* no manual scrolling — animation drives movement */
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    animation: scroll-carousel 30s linear infinite;
    will-change: transform;     /* GPU layer */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.carousel-track.paused {
    animation-play-state: paused;
}

@keyframes scroll-carousel {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Cards ── */
.custom-model {
    width: 19rem;
    height: 13.5rem;
    background-image: linear-gradient(#FFFFFF24, #FFFFFF00);
    border: 0.67px solid rgba(255, 255, 255, 0.3);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.Header {
    display: none !important;
}

.hidden-model {
    display: none !important;
}

.custom-model-and-name {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.recent-custom-models-image-wrapper {
    width: 120px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.5rem;
}

.recent-custom-models-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.model-text-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
}

.model-name-and-username {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.model-name {
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 16px;
    line-height: 27.54px;
    letter-spacing: 0px;
    text-align: center;
}

.instagram-username {
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    opacity: 0.7;
    text-align: center;
}

.video-wrapper {
    width: 50%;
    height: 133%;
    position: relative;
}

.iframe-container {
    width: 100%;
    height: 100%;
}

/* ── Responsive grid (non-carousel) ── */
@media (max-width: 1080px) {
    .recent-custom-models-section {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .recent-custom-models-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .recent-custom-models-section:not(.carousel-mode) .custom-model {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .recent-custom-models-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .recent-custom-models-section:not(.carousel-mode) .custom-model {
        width: 100%;
        height: auto;
        min-height: 10rem;
    }

    .recent-custom-models {
        gap: 1rem;
    }

    .model-name {
        font-size: 12px;
    }

    .recent-custom-models-image-wrapper {
        width: 80px;
        height: 70px;
    }
}

/* ── Carousel: mobile fade edges ── */
@media (max-width: 768px) {
    .recent-custom-models-section.carousel-mode {
        mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    }
}