/* ==========================================================================
   FBL THEME — Vendor Store (public storefront) — design handoff restyle.
   Reworks the existing .b2b-store-* markup to the "Vendor Store" design:
   slim teal banner, overlapping logo on a white identity band, credential
   stat-tiles, in-store toolbar, product grid. Colours use --fbl-* tokens only
   (admin-editable). Loaded after b2b.css so these overrides win.
   ========================================================================== */

/* ---- Banner ---- */
.b2b-store .b2b-store-cover {
    height: 240px;
    border-radius: 0;
    background-color: var(--fbl-brand-deep);
    background-image: linear-gradient(120deg, var(--fbl-brand-deep), var(--fbl-brand));
    position: relative;
}
/* diagonal stripe overlay */
.b2b-store .b2b-store-cover::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .04) 14px, transparent 14px, transparent 28px);
}
.b2b-store .b2b-store-cover-icon { color: rgba(255, 255, 255, .5); font-size: 44px; position: relative; z-index: 1; }

/* ---- Identity band (full-width white) ---- */
.b2b-store-identity { background: var(--fbl-surface); border-bottom: 1px solid var(--fbl-border); }

.b2b-store .b2b-store-header {
    position: relative; z-index: 2; margin-top: 0;
    padding: 0 0 20px; background: transparent; border: 0; border-radius: 0;
    box-shadow: none; display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap;
}
.b2b-store .b2b-store-logo {
    width: 96px; height: 96px; margin-top: -32px; padding: 8px; flex: 0 0 auto;
    background: var(--fbl-surface); border: 1px solid var(--fbl-border); border-radius: 14px;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--fbl-ink) 8%, transparent);
    display: grid; place-items: center;
}
.b2b-store .b2b-store-logo img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.b2b-store .b2b-store-headmain { padding-top: 18px; min-width: 0; flex: 1 1 320px; }
.b2b-store .b2b-store-headtop { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.b2b-store .b2b-store-name { font-size: 23px; font-weight: 600; letter-spacing: -.01em; color: var(--fbl-ink); margin: 0; }
.b2b-store .b2b-store-desc { font-size: 13px; color: var(--fbl-ink-2); margin: 8px 0 0; line-height: 1.55; }
.b2b-store .b2b-store-headactions { padding-top: 18px; display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; align-items: center; }

/* badges — design recipe (radius 4, 11px/600) */
.b2b-store .b2b-badge-verified {
    display: inline-flex; align-items: center; gap: 4px; background: var(--fbl-brand);
    color: #fff; border-radius: 4px; padding: 4px 9px; font-size: 11px; font-weight: 600;
}
.b2b-store .b2b-badge-verified .material-symbols-outlined { font-size: 13px; }

/* QR icon button — sits inline in the actions row (override b2b.css's absolute top-right) */
.b2b-store .b2b-store-qr-btn {
    position: static; inset: auto; box-shadow: none;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 42px; height: 42px;
    border: 1px solid var(--fbl-border-strong); border-radius: 6px; color: var(--fbl-ink-2); background: var(--fbl-surface);
}
.b2b-store .b2b-store-qr-btn .material-symbols-outlined { font-size: 22px; }
.b2b-store .b2b-store-qr-btn:hover { border-color: var(--fbl-brand); color: var(--fbl-brand); transform: none; }

/* header action buttons follow the design button recipes (b2b-btn maps to tokens) */
/* Uniform height across QR / Contact / Quote / Follow so the actions row reads as one bar. */
.b2b-store .b2b-store-headactions > .b2b-btn,
.b2b-store .b2b-store-headactions > .b2b-store-qr-btn,
.b2b-store .b2b-store-headactions .follow-btn {
    height: 42px; min-height: 42px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
}
.b2b-store .b2b-store-headactions .b2b-btn { border-radius: 6px; font-size: 14px; font-weight: 600; padding: 0 20px; }
.b2b-store .b2b-store-headactions .b2b-btn-accent,
.b2b-store .b2b-store-headactions .b2b-btn-primary { background: var(--fbl-brand); color: #fff !important; border: 0; padding: 11px 22px; }
.b2b-store .b2b-store-headactions .b2b-btn-accent:hover,
.b2b-store .b2b-store-headactions .b2b-btn-primary:hover { background: var(--fbl-brand-deep); }

/* ---- Tabs: segmented pill group (design: grey track, white active pill) ---- */
.b2b-store .b2b-store-tabs {
    display: flex; gap: 6px; margin: 0; padding: 5px;
    background: var(--fbl-neutral-2, #F1F4F3); border: 1px solid var(--fbl-border); border-radius: 10px;
    overflow-x: auto; scrollbar-width: none;
}
.b2b-store .b2b-store-tabs::-webkit-scrollbar { display: none; }
.b2b-store .b2b-store-tabs a {
    flex: 0 0 auto; padding: 9px 16px; border-radius: 7px; border-bottom: 0; background: transparent;
    color: var(--fbl-ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s;
}
.b2b-store .b2b-store-tabs a:hover { color: var(--fbl-brand); }
.b2b-store .b2b-store-tabs a.active { background: var(--fbl-surface); color: var(--fbl-brand); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---- Engine (Store Builder) header: cover + identity + tab bar are separate sections. The
   store header is intentionally NOT sticky — the theme's own site header is sticky-on-scroll
   (.sticky-bar.stick, fixed at top:0), and a store band pinned at top:0 would sit under it. So
   these bands scroll away normally. The identity band drops its border here so it and the tab
   bar read as one white unit with a single bottom rule. ---- */
.b2b-store .sb-section--store-company-summary .b2b-store-identity { border-bottom: 0; box-shadow: none; }
.b2b-store-tabbar {
    background: var(--fbl-surface); border-bottom: 1px solid var(--fbl-border);
}
.b2b-store-tabbar > .b2b-container { padding-top: 4px; padding-bottom: 12px; }

/* Meta row under the store name */
.b2b-store-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; color: var(--fbl-ink-2); }
.b2b-store-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.b2b-store-meta-item .material-symbols-outlined { font-size: 17px; color: var(--fbl-ink-3); }
/* Rating — design gold (star + count) */
.b2b-store-meta-reviews { color: #8A6A1F; font-weight: 600; gap: 3px; }
.b2b-store-meta-reviews .b2b-store-stars { font-size: 14px; }
.b2b-store-meta-reviews a { color: #8A6A1F; text-decoration: underline; text-underline-offset: 2px; }
.b2b-store-meta-reviews a:hover { color: var(--fbl-brand); }

/* Follow button — align to the design's outline CTA (neutral, radius 6, brand hover) so it sits
   flush with Contact supplier / Request quote. .follow-btn keeps its own colour elsewhere. */
.b2b-store-headactions .follow-btn {
    border-radius: 6px; border: 1px solid var(--fbl-border-strong); color: var(--fbl-ink);
    background: var(--fbl-surface); padding: 10px 16px; min-height: 42px; font-size: 14px; font-weight: 600;
}
.b2b-store-headactions .follow-btn:hover { border-color: var(--fbl-brand); color: var(--fbl-brand); }
.b2b-store-headactions .follow-btn.is-following { border-color: var(--fbl-brand); color: var(--fbl-brand); background: var(--fbl-brand-tint, #EFF5F4); }
.b2b-store-headactions .follow-btn.is-following .follow-btn__icon { color: var(--fbl-brand); }

/* ---- Body layout ---- */
.b2b-store .b2b-store-body { grid-template-columns: 280px 1fr; gap: 28px; padding-top: 24px; padding-bottom: 72px; }
.b2b-store .b2b-store-side { position: sticky; top: 16px; gap: 16px; }

/* Sidebar cards */
.b2b-store .b2b-store-card { background: var(--fbl-surface); border: 1px solid var(--fbl-border); border-radius: 10px; padding: 20px; }
.b2b-store .b2b-store-card-title { font-size: 13px; font-weight: 600; color: var(--fbl-ink); margin: 0 0 14px; }

/* Credential stat tiles */
.b2b-store-cred { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; margin-bottom: 16px; }
.b2b-store-cred-tile { background: var(--fbl-bg); border-radius: 6px; padding: 12px 4px; }
.b2b-store-cred-tile strong { display: block; font-size: 17px; font-weight: 700; color: var(--fbl-ink); }
.b2b-store-cred-tile span { font-size: 11px; color: var(--fbl-ink-3); }

/* Business-detail stat tiles */
.b2b-store .b2b-store-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.b2b-store .b2b-store-facts li {
    min-width: 0; min-height: 74px; padding: 12px 8px; border-radius: 6px; background: var(--fbl-bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
}
.b2b-store .b2b-store-facts li strong {
    display: block; width: 100%; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--fbl-ink);
    overflow-wrap: anywhere;
}
.b2b-store .b2b-store-facts li span { display: block; width: 100%; font-size: 11px; line-height: 1.3; color: var(--fbl-ink-3); }

/* Product-category chips */
.b2b-store .b2b-store-cats { border-top: 1px solid var(--fbl-neutral-1); margin-top: 16px; padding-top: 14px; }
.b2b-store .b2b-store-cats-title { font-size: 12.5px; font-weight: 600; color: var(--fbl-ink); margin: 0 0 9px; display: flex; align-items: center; gap: 6px; }
.b2b-store .b2b-store-cats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.b2b-store .b2b-store-cat {
    display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--fbl-border);
    border-radius: 4px; background: var(--fbl-neutral-2); font-size: 11px; font-weight: 500; color: var(--fbl-ink-2);
}
.b2b-store .b2b-store-cat:hover { border-color: var(--fbl-brand); background: var(--fbl-brand-tint); color: var(--fbl-brand); }

/* ---- Products: toolbar + heading ---- */
.b2b-store .b2b-store-toolbar {
    display: flex; align-items: center; gap: 12px; background: var(--fbl-surface);
    border: 1px solid var(--fbl-border); border-radius: 8px; padding: 10px 16px; margin-bottom: 16px;
}
.b2b-store .b2b-store-toolbar .b2b-store-search { flex: 1 1 auto; max-width: none; min-width: 0; margin: 0; }
.b2b-store .b2b-store-toolbar .b2b-store-search input { height: 38px; }
.b2b-store .b2b-store-sort {
    flex: 0 0 auto; border: 1px solid var(--fbl-border-strong); border-radius: 6px; background: var(--fbl-surface);
    color: var(--fbl-ink); padding: 8px 10px; font-size: 13px; font-family: inherit; cursor: pointer; max-width: 190px;
}
.b2b-store .b2b-store-sort:focus { border-color: var(--fbl-brand); outline: none; }

.b2b-store .b2b-store-main-head { justify-content: flex-start; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.b2b-store .b2b-store-main-title { font-size: 17px; font-weight: 600; color: var(--fbl-ink); margin: 0; }
.b2b-store-main-count { font-size: 12.5px; color: var(--fbl-ink-3); }

/* ---- Desktop ---- */
@media (min-width: 992px) {
    .b2b-store-identity > .b2b-container { padding-bottom: 0; }
}

/* ---- Tablet / mobile ---- */
@media (max-width: 991.98px) {
    .b2b-store .b2b-store-body { grid-template-columns: 1fr; }
    .b2b-store .b2b-store-side { position: static; flex-direction: column; }
    .b2b-store-cred { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .b2b-store-cred.b2b-store-cred--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .b2b-store-cred-tile strong { font-size: 15px; }
}

@media (max-width: 768px) {
    /* 100vw includes the desktop-style scrollbar gutter on some mobile browsers, which shifts
       the full storefront off center. At this breakpoint the parent already spans the viewport. */
    .b2b-store {
        width: 100%;
        margin-inline: 0;
    }
    /* Use true outer gutters instead of a 100%-wide padded box. This keeps every storefront
       section centered even when the browser reserves space for its vertical scrollbar. */
    .b2b-store .b2b-container {
        width: auto;
        margin-inline: var(--b2b-margin-mobile);
        padding-inline: 0;
    }
    .b2b-store .b2b-store-side,
    .b2b-store .b2b-store-main {
        width: 100%;
        min-width: 0;
    }
    .b2b-store .b2b-store-side > * {
        flex: 0 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .b2b-store .b2b-store-cover { height: 168px; }
    .b2b-store .b2b-store-header { gap: 14px; padding-bottom: 16px; }
    .b2b-store .b2b-store-logo { width: 72px; height: 72px; margin-top: -28px; border-radius: 12px; }
    .b2b-store .b2b-store-headmain { padding-top: 12px; flex-basis: 100%; }
    .b2b-store .b2b-store-name { font-size: 19px; }
    .b2b-store .b2b-store-headactions { padding-top: 0; flex-basis: 100%; }
    .b2b-store .b2b-store-headactions .b2b-btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
    .b2b-store-cred { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .b2b-store-cred.b2b-store-cred--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .b2b-store-cred-tile { padding: 9px 2px; }
    .b2b-store-cred-tile strong { font-size: 14px; }
    .b2b-store-cred-tile span { font-size: 10px; }
    .b2b-store .b2b-store-toolbar { flex-wrap: wrap; padding: 10px 12px; }
    .b2b-store .b2b-store-sort { flex: 1 1 auto; max-width: none; }

    /* Pill tabs (design mobile: individual chip row on the page — not the desktop grey track) */
    .b2b-store .b2b-store-tabs {
        gap: 6px; padding: 10px 0 2px; background: transparent; border: 0; border-radius: 0;
        overflow-x: auto; scrollbar-width: none;
    }
    .b2b-store .b2b-store-tabs::-webkit-scrollbar { display: none; }
    .b2b-store .b2b-store-tabs a {
        flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border-bottom: 0;
        background: #F1F4F3; border: 1px solid var(--fbl-border); color: var(--fbl-ink-2);
        font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: none;
    }
    .b2b-store .b2b-store-tabs a.active {
        background: var(--fbl-brand); border-color: var(--fbl-brand); color: #fff; border-bottom: 0; font-weight: 600;
    }
    /* On mobile the tall identity + tab bar scroll normally instead of pinning */
    .b2b-store-identity { position: static; box-shadow: none; }
    .b2b-store-tabbar { position: static; box-shadow: none; }
    .b2b-store-tabbar > .b2b-container { padding-top: 0; padding-bottom: 8px; }

    /* Room for the fixed bottom action bar so the last content isn't hidden behind it */
    .b2b-store { padding-bottom: 78px; }
}

/* ---- Sticky bottom action bar (mobile) — design: Vendor Store Mobile.dc.html ---- */
.b2b-store-mobilebar { display: none; }
@media (max-width: 768px) {
    /* The corner FAB is replaced by the full-width bar on mobile */
    .b2b-store .b2b-store-fab { display: none !important; }

    .b2b-store-mobilebar {
        position: fixed; bottom: 0; inset-inline: 0; z-index: 940;
        display: flex; align-items: center; gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--fbl-surface); border-top: 1px solid var(--fbl-border);
        box-shadow: 0 -4px 16px color-mix(in srgb, var(--fbl-ink) 8%, transparent);
    }
    .b2b-store-mobilebar-icon {
        flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center;
        border: 1px solid var(--fbl-border-strong); border-radius: 6px;
        color: var(--fbl-ink); background: var(--fbl-surface);
    }
    .b2b-store-mobilebar-icon .material-symbols-outlined { font-size: 20px; }
    .b2b-store-mobilebar-btn {
        flex: 1 1 0; justify-content: center; min-height: 48px;
        border-radius: 6px; font-size: 14px; font-weight: 600; padding: 0;
    }
    .b2b-store-mobilebar .b2b-btn-outline {
        border: 1.5px solid var(--fbl-brand); color: var(--fbl-brand); background: var(--fbl-surface);
    }
    .b2b-store-mobilebar .b2b-btn-accent { background: var(--fbl-brand); color: #fff !important; border: 0; }
    .b2b-store-mobilebar .b2b-btn-accent:hover { background: var(--fbl-brand-deep); }
}
