/* Adverts carousel (shared/ad-carousel.js): every advert of the batch as a fixed-size card in a slowly auto-scrolling
 * carousel. The image area always has the same size (a placeholder when there's no image), so the cards line up.
 * Self-contained (card + button look copied from styles.css .home-row .card), so pages without .home-row can use it.
 * Dark mode follows the system unless <html class="force-light"> (adverts/). */
.ad-carousel.has-adverts { display: flex; flex-direction: column; gap: 6px; width: min(600px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); text-align: left; margin: 8px 0 16px; }
.ad-carousel > * { flex: none; }
.ad-carousel .ad-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--text-muted, #5b6b8c); font-size: 12px; font-weight: 700; padding: 0 4px; }
.ad-carousel .ad-head a { color: var(--blue, #2f6fed); text-decoration: none; }
.ad-carousel .ad-head a:hover { text-decoration: underline; }
.ad-carousel .ad-viewport { overflow-x: auto; overflow-y: hidden; scroll-behavior: auto; scrollbar-width: none; padding: 4px 0 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }
.ad-carousel .ad-viewport::-webkit-scrollbar { display: none; }
.ad-carousel.static .ad-viewport { -webkit-mask-image: none; mask-image: none; }
.ad-carousel.static .ad-track { justify-content: center; }
.ad-carousel .ad-track { display: flex; gap: 14px; width: max-content; min-width: 100%; }

.ad-carousel .ad-card { --c-card: #fff; --c-border: #e2e8f4; --c-hover: #eef3fc; --c-text: #10224f; --c-muted: #5b6b8c;
  background: var(--c-card); color: var(--c-text); border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,34,79,.06), 0 6px 18px rgba(16,34,79,.06);
  display: flex; flex-direction: column; font-size: 14px; line-height: 1.45;
  flex: none; width: 250px; padding: 0; gap: 0; overflow: hidden; }
@media (prefers-color-scheme: dark) {
  html:not(.force-light) .ad-carousel .ad-card { --c-card: #131b36; --c-border: #24304f; --c-hover: #1a2444; --c-text: #eef2fb; --c-muted: #a7b2cc;
    box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3); }
}
.ad-carousel .ad-media { height: 130px; background: var(--c-hover); display: grid; place-items: center; }
.ad-carousel .ad-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-carousel .ad-placeholder { display: flex; align-items: center; justify-content: center; gap: 10px; color: rgba(255,255,255,.85); }
.ad-carousel .ad-placeholder .ad-initial { font-size: 42px; font-weight: 800; color: #fff; line-height: 1; }
.ad-carousel .ad-body { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-carousel .ad-headline { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-carousel .ad-product, .ad-carousel .ad-advertiser { font-size: 13px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.45em; }
.ad-carousel .ad-price { font-size: 13px; color: var(--c-muted); min-height: 1.45em; }
.ad-carousel .ad-price b { color: var(--c-text); }
.ad-carousel .ad-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px 12px; margin-top: auto; min-height: 42px; }
.ad-carousel .ad-why { display: inline-flex; align-items: center; gap: 4px; color: var(--c-muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.ad-carousel .ad-why:hover { text-decoration: underline; }
.ad-carousel .btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12.5px; border: 1px solid #2f6fed; background: #2f6fed; color: #fff; border-radius: 9px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.ad-carousel .btn:hover { background: #2358c8; }
