.masonry-grid {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.masonry-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.masonry-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    /* aspect-ratio is set per-image inline from width/height so the column
       reserves vertical space before the JPEG is downloaded; that's what
       keeps the layout from jumping while images load. */
}

.masonry-item .pm-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.masonry-item .pm-overlay-text {
    flex: 1 1 auto;
    min-width: 0;
}

.masonry-item .pm-overlay-desc {
    font-size: 0.75rem;
    line-height: 1.25;
    margin-top: 4px;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.masonry-item .pm-overlay-price {
    flex: 0 0 auto;
    font-size: 1rem;
}

.masonry-item:hover .pm-overlay {
    opacity: 1;
}

.skeleton-card {
    border-radius: 12px;
    background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 37%, #eef0f4 63%);
    background-size: 400% 100%;
    animation: pm-skeleton 1.4s ease infinite;
    height: 240px;
}

@keyframes pm-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
