/* The product sub-bar (blog/subbar.py, blog/templates/app/subbar.html, docs/SUBBAR.md).
   Directly below socialify.com's top bar on Pay, Jobs, Meet and Chat pages. Glass card with the brand gradient tint,
   items centred, product pill on the left, active item as a blue->violet pill, sticky under the top bar.
   Phones: one row that scrolls sideways; the rest of the items sit in "More". Never a dark background. */
.sf-subbar {
    --sb-top: 60px;                       /* desktop: the fixed 60px rainbow top bar */
    position: -webkit-sticky; position: sticky; top: var(--sb-top); z-index: 1030;
    width: min(1180px, calc(100% - 24px)); margin: 10px auto 14px; box-sizing: border-box;
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    transition: top .25s ease;
}
.sf-subbar *, .sf-subbar *::before { box-sizing: border-box; }
.sf-subbar-in {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 20px;
    background: linear-gradient(100deg, rgba(240, 62, 155, .13), rgba(196, 78, 230, .10) 35%, rgba(123, 92, 255, .12) 65%, rgba(47, 107, 255, .12)),
                rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .75);
    box-shadow: 0 10px 30px -14px rgba(91, 76, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.sf-subbar-product {
    justify-self: start; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: 15px; letter-spacing: .1px;
    color: #fff !important; text-decoration: none !important;
    background: linear-gradient(115deg, #f03e9b, #c44ee6 55%, #7b5cff);
    box-shadow: 0 6px 16px -6px rgba(196, 78, 230, .65);
}
.sf-subbar-product:hover { filter: brightness(1.06); }
.sf-subbar-items {
    display: flex; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 12px; margin: -8px 0 -12px;   /* room for the active pill's shadow */
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.sf-subbar-items::-webkit-scrollbar { display: none; }
.sf-subbar-items > :first-child { margin-left: auto; }   /* centred, and still scrollable when too wide */
.sf-subbar-items > :last-child { margin-right: auto; }
.sf-subbar-side { justify-self: end; display: flex; align-items: center; }
.sf-subbar-item {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; list-style: none;
    padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14.5px; line-height: 1.2;
    color: #2b2350 !important; text-decoration: none !important; transition: background .15s ease, color .15s ease;
}
.sf-subbar-item::-webkit-details-marker { display: none; }
.sf-subbar-item:hover { background: rgba(123, 92, 255, .12); }
.sf-subbar-item.on {
    color: #fff !important; background: linear-gradient(115deg, #2f6bff, #5b5cff 50%, #7b5cff);
    box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .7);
}
.sf-subbar-item i, .sf-subbar-menu i {
    font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
    background: rgba(123, 92, 255, .14); color: #5b4cff;
}
.sf-subbar-item.on i { background: rgba(255, 255, 255, .25); color: #fff; }
.sf-subbar-more { position: relative; }
.sf-subbar-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: 16px;
    background: rgba(255, 255, 255, .97); border: 1px solid #ebe7fb; box-shadow: 0 18px 40px -12px rgba(60, 20, 120, .35);
    display: flex; flex-direction: column; gap: 2px; z-index: 5;
}
.sf-subbar-menu a {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
    color: #2b2350 !important; text-decoration: none !important;
}
.sf-subbar-menu a:hover { background: rgba(123, 92, 255, .10); }
.sf-subbar-menu a.on { color: #fff !important; background: linear-gradient(115deg, #2f6bff, #7b5cff); }

/* Sticky needs a page that is not its own scroll box (some product pages set overflow-x: hidden on html/body) */
html:has(.sf-subbar), body:has(.sf-subbar) { overflow-x: clip !important; }

/* Phones and tablets: under the app bar (it slides away on scroll, so the sub-bar moves up with it), one row */
@media (max-width: 1199.98px) {
    .sf-subbar { --sb-top: calc(var(--sf-bar-h, 58px) + var(--sf-safe-top, 0px)); width: calc(100% - 16px); margin: 8px auto 10px; }
    body.sf-bar-hidden .sf-subbar { --sb-top: var(--sf-safe-top, 0px); }
    .sf-subbar-in { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; padding: 6px; border-radius: 18px; }
    .sf-subbar-product { padding: 7px 12px; font-size: 14px; }
    .sf-subbar-item { padding: 7px 11px; font-size: 13.5px; }
    .sf-subbar-items { mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
                       -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
    .sf-subbar-items.at-end { mask-image: none; -webkit-mask-image: none; }
    .sf-subbar-side:empty { display: none; }
}
@media (max-width: 340px) {
    .sf-subbar-product b { display: none; }               /* just the icon: more room for the menu */
    .sf-subbar-more summary { padding: 7px 10px; }
}
