/* Sales Bar for WooCommerce — bar.css v7 */

/* ── Bar wrapper ────────────────────────────────────────── */
#sbw-bar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--sbw-h, 48px);
    background: var(--sbw-bg, #1a1a2e);
    color: var(--sbw-tc, #fff);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    /* Start visible — JS handles close animation only */
}

/* Dismiss animation */
#sbw-bar.sbw-dismissing {
    transform: translateY(-110%);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
}

/* ── Progress strip ─────────────────────────────────────── */
#sbw-prog-track {
    height: 3px;
    width: 100%;
    background: rgba(255,255,255,.15);
    flex-shrink: 0;
}
#sbw-prog-fill {
    height: 100%;
    background: var(--sbw-prog, #22c55e);
    width: 0;
    transition: width .6s ease;
    box-shadow: 0 0 8px var(--sbw-prog, #22c55e);
}

/* ── Inner row ──────────────────────────────────────────── */
#sbw-inner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

/* ── Message ────────────────────────────────────────────── */
#sbw-msg {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 20px);
    transition: opacity .15s ease;
}
#sbw-msg.sbw-fading { opacity: 0; }
#sbw-msg strong { font-weight: 700; }
#sbw-msg:hover  { text-decoration: underline; text-underline-offset: 3px; }

/* Highlight colour for {remaining} and amounts */
.sbw-hi { color: var(--sbw-hi, #f5a623); }

/* ── Close button ───────────────────────────────────────── */
#sbw-close {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    opacity: .45;
    cursor: pointer;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: opacity .2s, background .2s;
    flex-shrink: 0;
}
#sbw-close:hover {
    opacity: 1;
    background: rgba(255,255,255,.15);
}

/* ── Body offset ────────────────────────────────────────── */
body.sbw-active {
    padding-top: var(--sbw-h, 48px) !important;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    #sbw-msg   { font-size: 12px; }
    #sbw-inner { padding: 0 30px; }
    #sbw-close { right: 6px; width: 22px; height: 22px; }
}
