/* While this plugin is active, it owns the three Flashy placeholder divs — hide
   anything Flashy's thunder.js injects into them (it appends an .is-injected widget
   alongside ours). Makes prod cutover order-independent; rollback = deactivate us. */
.flashy-home-page > :not(.cpr-widget),
.flashy-product-page-complementary > :not(.cpr-widget),
.flashy-product-page-similar > :not(.cpr-widget) {
    display: none !important;
}

/* Self-contained widget layout — the theme's product-grid CSS doesn't attach to
   injected markup, so the grid is fully specified here. */
.cpr-widget { max-width: 1200px; margin: 40px auto; padding: 0 16px; }
.cpr-widget-title { text-align: center; margin: 0 0 24px; font-size: 26px; font-weight: 700; }

.cpr-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Equal-height cards: name clamps to 2 lines and grows, so price + button
   bottom-align across every card regardless of name length. */
.cpr-card { text-align: center; margin: 0 !important; display: flex; flex-direction: column; }
.cpr-card a { text-decoration: none !important; color: inherit !important; }
.cpr-card .woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1 1 auto; }
.cpr-card img { width: 100%; height: auto; display: block; margin: 0 0 10px; border-radius: 6px; }
.cpr-card .woocommerce-loop-product__title {
    font-size: 15px; line-height: 1.4; margin: 0 0 6px;
    flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cpr-card .price { display: block; font-weight: 600; white-space: nowrap; }
.cpr-card .price del { display: inline; opacity: .6; margin-inline-start: 6px; font-weight: 400; }
.cpr-card .price ins { display: inline; text-decoration: none; }
.cpr-card .cpr-add {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    background: #1e3a2a;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
}
.cpr-card .cpr-add.added { display: none; }
.cpr-card .added_to_cart { display: inline-block; margin-top: 10px; font-size: 14px; }

/* Mobile: one horizontal scroll row with snap */
@media (max-width: 768px) {
    .cpr-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
    }
    .cpr-card {
        flex: 0 0 44%; /* ~2.2 cards per view — full-width cards were oversized */
        scroll-snap-align: start;
    }
    .cpr-widget-title { font-size: 20px; }
}
