.sam-grid{display:grid;grid-template-columns:repeat(var(--sam-cols,4),minmax(0,1fr));gap:16px;margin:20px 0;width:100%;max-width:100%;box-sizing:border-box}
.sam-card{border:1px solid #e5e7eb;border-radius:10px;padding:12px;min-width:0;max-width:100%;background:#fff;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden}
.sam-card img{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;border-radius:6px}
.sam-card h3{font-size:15px;line-height:1.4;margin:10px 0;flex:1;overflow-wrap:anywhere}
.sam-buy{display:block;width:100%;box-sizing:border-box;text-align:center;background:#ee4d2d;color:#fff!important;padding:10px;border-radius:6px;text-decoration:none;font-weight:600;overflow-wrap:anywhere}
.sam-no-image{aspect-ratio:1/1;display:grid;place-items:center;background:#f3f4f6;color:#6b7280;text-align:center;font-size:13px}
.sam-placement{margin:24px 0;max-width:100%;width:100%;box-sizing:border-box}
.sam-article-products .sam-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sam-article-products .sam-card{padding:10px}
.sam-article-products .sam-card h3{margin:0 0 10px;font-size:15px}
.sam-popup{display:none;position:fixed;inset:0;z-index:999999;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}
.sam-popup.is-visible{display:flex}
.sam-popup-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65)}
.sam-popup-panel{position:relative;z-index:1;background:#fff;border-radius:12px;padding:22px;width:min(420px,100%);max-height:90vh;overflow:auto;box-shadow:0 15px 50px rgba(0,0,0,.25);box-sizing:border-box}
.sam-popup-content .sam-card{border:0;padding:0}
.sam-popup-content .sam-card img{width:100%;height:auto;max-height:280px;object-fit:contain}
.sam-popup-close{position:absolute;right:10px;top:5px;border:0;background:transparent;font-size:30px;line-height:1;cursor:pointer;z-index:2}
.sam-popup-content{padding-top:20px}
@media(max-width:700px){.sam-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.sam-card{padding:8px}.sam-card h3{font-size:13px}.sam-article-products .sam-grid{grid-template-columns:repeat(1,minmax(0,1fr))}.sam-article-products .sam-card{padding:10px}}
@media(max-width:360px){.sam-grid{grid-template-columns:minmax(0,1fr)}}

/* Article placement: one responsive, landscape product card at a time. */
.sam-article-products .sam-grid{display:block;max-width:100%;width:100%}
.sam-article-products .sam-card{width:100%;padding:14px}
.sam-article-products .sam-card img{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;max-height:none}
.sam-article-products .sam-no-image{width:100%;aspect-ratio:16/9}
.sam-article-products .sam-card h3{font-size:16px;margin:12px 0}
.sam-article-products .sam-buy{max-width:100%}
/* Sidebar cards fill the available widget width. */
.widget .sam-grid{display:block;width:100%;max-width:100%}
.widget .sam-card{width:100%;margin:0 0 12px}
.widget .sam-card img{aspect-ratio:16/9;object-fit:cover}
@media(max-width:700px){
 .sam-article-products .sam-card{padding:10px}
 .sam-article-products .sam-card img{aspect-ratio:16/9}
}

/* v1.4.2: all placements are fluid and show one landscape product at a time. */
.sam-grid,
.sam-sidebar-placement,
.sam-placement,
.sam-article-products {width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.sam-grid{display:block!important;grid-template-columns:minmax(0,1fr)!important}
.sam-grid>.sam-card{display:flex;width:100%;max-width:100%;min-width:0;margin:0 0 12px;box-sizing:border-box}
.sam-grid .sam-card img{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:16/9;object-fit:cover}
.sam-grid .sam-no-image{width:100%;max-width:100%;aspect-ratio:16/9;box-sizing:border-box}
.sam-grid .sam-card h3{overflow-wrap:anywhere}
.sam-grid .sam-buy{max-width:100%;white-space:normal}
.sam-sidebar-placement .sam-grid{margin:0}
.sam-sidebar-placement .sam-card{padding:10px}
@media(max-width:767px){
 .sam-grid,.sam-sidebar-placement,.sam-placement,.sam-article-products{width:100%;max-width:100%}
 .sam-grid .sam-card{padding:10px}
 .sam-grid .sam-card img{aspect-ratio:16/9}
}


/* v1.4.3: sidebar placement is fluid on narrow mobile sidebars and never prints a heading. */
.sam-sidebar-placement,
.sam-sidebar-placement *,
.widget:has(> .sam-sidebar-placement) {
    box-sizing: border-box;
}
.sam-sidebar-placement {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.sam-sidebar-placement .sam-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.sam-sidebar-placement .sam-card {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 12px !important;
    padding: clamp(8px, 2.5vw, 12px);
    overflow: hidden;
}
.sam-sidebar-placement .sam-card img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}
.sam-sidebar-placement .sam-card h3,
.sam-sidebar-placement .sam-card .sam-buy {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}
@media (max-width: 767px) {
    .sam-sidebar-placement,
    .sam-sidebar-placement .sam-grid,
    .sam-sidebar-placement .sam-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .sam-sidebar-placement .sam-card {
        padding: 8px;
        margin-bottom: 10px !important;
    }
    .sam-sidebar-placement .sam-card h3 {
        font-size: clamp(13px, 3.5vw, 16px);
        line-height: 1.4;
    }
    .sam-sidebar-placement .sam-buy {
        padding: 10px 8px;
        font-size: 14px;
    }
}


/* v1.4.4: sidebar product image fills the full available width without cropping. */
.sam-sidebar-placement .sam-card .sam-product-link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    overflow: hidden;
}
.sam-sidebar-placement .sam-card .sam-product-link img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 767px) {
    .sam-sidebar-placement .sam-card .sam-product-link,
    .sam-sidebar-placement .sam-card .sam-product-link img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* v1.4.5 product pricing */
.sam-prices{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;margin:7px 0 10px;line-height:1.35;min-width:0}
.sam-price-old{font-size:.88em;color:#777;text-decoration:line-through}
.sam-price-sale{font-size:1.12em;font-weight:700;color:#d32f2f}
.sam-price-discount{display:inline-block;padding:2px 6px;border-radius:4px;background:#fff0f0;color:#c62828;font-size:.78em;font-weight:700}
.sam-card .sam-prices{max-width:100%;overflow-wrap:anywhere}
@media(max-width:767px){.sam-prices{gap:5px 7px}.sam-price-sale{font-size:1.05em}}
