/* Scoped styles for compact/small story cards used by MostRecent.
   These rules are intended to replace any ad-hoc product-item overrides in app.css
   so tweaks only affect the compact storycard variant. */

.storycard--compact-small {
    /* grid spacing tweaks kept to the container level if needed */
}

/* Per-card root */
.storycard--compact-small .product-item,
.storycard--compact-small .product-item.storycard--compact-small__card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image area */
.storycard--compact-small .product-item .product-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: block;
}

.storycard--compact-small .product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* small badge in corner */
.storycard--compact-small .product-item .product-badge {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 2;
}

/* CTA overlay (if kept) */
.storycard--compact-small .product-item .cart-btn {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    background: rgba(255,255,255,0.95);
    color: #000;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    z-index: 2;
    font-size: 0.85rem;
}

/* Info block */
.storycard--compact-small .product-item .product-info {
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
}

.storycard--compact-small .product-item .product-category {
    color: var(--muted, #666);
    font-size: 0.85rem;
}

.storycard--compact-small .product-item .product-price a,
.storycard--compact-small .product-item .product-name a {
    color: inherit;
    text-decoration: none;
}

.storycard--compact-small .product-item .product-price {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storycard--compact-small .product-item .product-name {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

/* placeholder state */
.storycard--compact-small .product-item.placeholder {
    background: linear-gradient(90deg, #f6f6f6 25%, #f0f0f0 37%, #f6f6f6 63%);
    background-size: 400% 100%;
    animation: placeholder-shimmer 1.4s ease infinite;
}

@keyframes placeholder-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* Small screens keep stacked layout */
@media (max-width: 767.98px) {
    .storycard--compact-small .product-item {
        flex-direction: column;
    }
    .storycard--compact-small .product-item .product-image {
        aspect-ratio: 16/9;
    }
}