/* Store top bar (Zee 2026-11-26): the STL shop's bar (.stb, templates/shop/_topbar.html), the red
   "Sale on now" strip (.sale-strip, both shops) and the fixed/hide-on-scroll behaviour shared with the
   dealer stores (.autobar-*, static/js/store_bar.js). */

/* ── Shared: fixed to the top once store_bar.js runs; slides away and back ── */
.autobar-on {
    position: fixed; top: 0; left: 0; right: 0; z-index: 950;
    transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .2s;
    will-change: transform;
}
.autobar-on.autobar-scrolled:not(.autobar-hidden) { box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .autobar-on { transition: none; } }
[id] { scroll-margin-top: 76px; }   /* a #catalog jump lands below the bar */

/* ── Shared: the red sale strip ── */
.sale-strip {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px;
    padding: 7px 16px; background: #d7261e; color: #fff; text-decoration: none;
    font-size: 13.5px; font-weight: 600; line-height: 1.3; text-align: center;
}
.sale-strip:hover { color: #fff; text-decoration: none; background: #c11f18; }
.sale-strip-tag {
    background: #fff; color: #c11f18; padding: 2px 9px; border-radius: 3px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.sale-strip-go { font-weight: 800; white-space: nowrap; }
.sale-strip:hover .sale-strip-go { text-decoration: underline; }

/* ── STL shop bar ── */
.stb-bar {
    display: flex; align-items: center; gap: 18px; height: 60px;
    padding: 0 max(20px, calc((100% - 1280px) / 2));      /* contents line up with the page (1280 wide) */
    background: rgba(13, 13, 13, .82);
    backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    color: var(--text);
}
html[data-theme="light"] .stb-bar { background: rgba(255, 255, 255, .88); border-bottom-color: rgba(0, 0, 0, .08); }
.stb .promo-banner-link { padding-left: 16px; }        /* the round menu button no longer sits on it */
.stb a { text-decoration: none; }

.stb-menu {
    display: none; flex: none; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: var(--text);
    align-items: center; justify-content: center; cursor: pointer;
}
html[data-theme="light"] .stb-menu { border-color: rgba(0, 0, 0, .14); background: rgba(0, 0, 0, .03); }

.stb-brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.stb-brand:hover { color: var(--text); }
.stb-brand img { width: 34px; height: 34px; object-fit: contain; }

.stb-cats {
    display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none; white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
.stb-cats::-webkit-scrollbar { display: none; }
.stb-cats a {
    flex: none; padding: 7px 12px; border-radius: 999px; color: var(--text-muted);
    font-size: 14px; font-weight: 600; transition: color .15s, background .15s;
}
.stb-cats a:hover { color: var(--text); background: rgba(127, 127, 127, .12); }
.stb-cats a[aria-current="page"] { color: var(--text); background: rgba(127, 127, 127, .18); }

.stb-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.stb-sale {
    display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px;
    background: #d7261e; color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .02em;
    box-shadow: 0 6px 16px -8px rgba(215, 38, 30, .8);
}
.stb-sale:hover, .stb-sale[aria-current="page"] { background: #c11f18; color: #fff; }
.stb-cart {
    position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    border-radius: 999px; background: var(--green); color: #0d0d0d; font-size: 14px; font-weight: 800;
}
.stb-cart:hover { color: #0d0d0d; filter: brightness(1.06); }
html[data-theme="light"] .stb-cart, html[data-theme="light"] .stb-cart:hover { color: #fff; }
.stb .stb-badge {
    position: static; width: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: #0d0d0d; color: var(--green); font-size: 12px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
html[data-theme="light"] .stb .stb-badge { background: #fff; color: var(--green-dim); }
.stb .stb-badge.hidden { display: none; }

/* the pulse when something is added (both shops) */
[data-bar-cart].bar-pulse { animation: bar-pulse .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bar-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(57, 255, 20, .55); }
    35% { transform: scale(1.12); }
    100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(57, 255, 20, 0); }
}

/* desktop: the bar starts beside the side menu's column, like the page does */
@media (min-width: 820px) {
    .stb.autobar-on { left: 112px; }
}
/* phones and small tablets: menu button, logo, Sale, Cart. Categories stay in the menu. */
@media (max-width: 819px) {
    .has-stb .gs-menu { display: none; }               /* the bar's own menu button replaces it */
    body.has-stb { padding-top: 0; }                    /* the room kept for that floating button (glass_sidebar.css) */
    .stb-bar { gap: 10px; padding: 0 12px; height: 58px; }
    .stb-menu { display: inline-flex; }
    .stb-cats { display: none; }
    .stb-brand span { display: none; }
    .stb-actions { gap: 8px; }
}
@media (max-width: 380px) {
    .stb-cart-word { display: none; }
    .stb-sale { padding: 0 12px; }
}

/* ── Dealer stores: the Sale button beside the store's own Cart button ── */
.dealer-top .dealer-nav-links a.dbar-sale, .dealer-top a.dbar-sale {
    display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 6px;
    background: #d7261e; color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .02em;
    text-decoration: none; white-space: nowrap;
}
.dealer-top a.dbar-sale:hover { background: #c11f18; color: #fff; }
.dealer-top .dealer-nav-links { margin-left: auto; }
.dealer-top .dealer-mobile-menu { max-height: calc(100vh - 64px); overflow-y: auto; }
@media (max-width: 768px) {
    .dealer-top .dealer-header-inner { gap: 8px; padding: 0 12px; }
    .dealer-top .dealer-brand .dname { font-size: 15px; }
    .dealer-top .dealer-brand .dtag { display: none; }
    .dealer-top .dealer-nav-links { gap: 8px; }
    .dealer-top .dealer-nav-links a.dbar-sale { padding: 7px 11px; font-size: 13px; }
    .dealer-top .dealer-cart-btn { padding: 7px 11px; }
}
