/* Smart Banner – Frontend Styles v1.3.0 */

.smart-banner {
    position: fixed;
    left: 0; right: 0;
    z-index: 99999;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    /* Height driven by CSS custom property, set per-breakpoint */
    height: var(--sb-h-desktop, 90px);
}

/* ── Position ───────────────────────────────────────────────── */
.smart-banner--top    { top: 0; }
.smart-banner--bottom { bottom: 0; }
.admin-bar .smart-banner--top { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .smart-banner--top { top: 46px; }
}

/* ── Per-device height via media queries ─────────────────────── */
@media (max-width: 767px) {
    .smart-banner { height: var(--sb-h-mobile, 60px); }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .smart-banner { height: var(--sb-h-tablet, 80px); }
}
@media (min-width: 1025px) {
    .smart-banner { height: var(--sb-h-desktop, 90px); }
}

/* ── Body push — use CSS vars matching per-device heights ────── */
body.smart-banner-top-offset {
    margin-top: var(--sb-h-desktop, 90px);
}
body.smart-banner-bottom-offset {
    margin-bottom: var(--sb-h-desktop, 90px);
}
@media (max-width: 767px) {
    body.smart-banner-top-offset    { margin-top:    var(--sb-h-mobile, 60px); }
    body.smart-banner-bottom-offset { margin-bottom: var(--sb-h-mobile, 60px); }
}
@media (min-width: 768px) and (max-width: 1024px) {
    body.smart-banner-top-offset    { margin-top:    var(--sb-h-tablet, 80px); }
    body.smart-banner-bottom-offset { margin-bottom: var(--sb-h-tablet, 80px); }
}

/* ── Track ──────────────────────────────────────────────────── */
.smart-banner__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 6px 16px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.smart-banner__track::-webkit-scrollbar { display: none; }

/* ── Alignment ──────────────────────────────────────────────── */
.smart-banner--align-left   .smart-banner__track { justify-content: flex-start; }
.smart-banner--align-center .smart-banner__track { justify-content: center; }
.smart-banner--align-right  .smart-banner__track { justify-content: flex-end; }
@media (max-width: 767px) {
    .smart-banner__track { justify-content: flex-start !important; }
}

/* ── Items ──────────────────────────────────────────────────── */
.smart-banner__item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 100%;
}
.smart-banner__item + .smart-banner__item {
    border-left: 1px solid rgba(255,255,255,.2);
    margin-left: 12px;
    padding-left: 12px;
}

/* ── Figure & link — KEY FIX: link must not stretch ─────────── */
.smart-banner__figure {
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    /* Prevents figure from growing beyond content */
    width: auto;
}

/* The anchor wraps only the img + caption, does NOT stretch */
.smart-banner__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    text-decoration: none;
    /* Critical: do not grow to fill container */
    flex: 0 0 auto;
    width: auto;
}

.smart-banner__img {
    display: block;
    width: auto;
    /* Height fills banner minus padding */
    height: calc(100% - 12px);
    max-height: 100%;
    max-width: none;
    object-fit: contain;
    flex-shrink: 0;
}

.smart-banner__caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* ── Device visibility ───────────────────────────────────────── */
@media (max-width: 767px) {
    .smart-banner.sb-hide-mobile { display: none !important; }
    body.smart-banner-top-offset.sb-hide-mobile-body    { margin-top: 0 !important; }
    body.smart-banner-bottom-offset.sb-hide-mobile-body { margin-bottom: 0 !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .smart-banner.sb-hide-tablet { display: none !important; }
    body.smart-banner-top-offset.sb-hide-tablet-body    { margin-top: 0 !important; }
    body.smart-banner-bottom-offset.sb-hide-tablet-body { margin-bottom: 0 !important; }
}
@media (min-width: 1025px) {
    .smart-banner.sb-hide-desktop { display: none !important; }
    body.smart-banner-top-offset.sb-hide-desktop-body    { margin-top: 0 !important; }
    body.smart-banner-bottom-offset.sb-hide-desktop-body { margin-bottom: 0 !important; }
}

/* ── Mobile tweaks ───────────────────────────────────────────── */
@media (max-width: 767px) {
    .smart-banner__track { padding: 4px 10px; }
    .smart-banner__item + .smart-banner__item { margin-left: 8px; padding-left: 8px; }
    .smart-banner__caption { font-size: 11px; }
}
