/* BSBO mobile conversion improvements v0.2.0 */
@media (max-width: 767px) {
    .bsbo-mobile-header {
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
        position: relative;
        z-index: 1000;
    }

    .bsbo-mobile-header__top {
        min-height: 68px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 15px;
    }

    .bsbo-mobile-header__logo {
        min-width: 0;
        flex: 1 1 auto;
    }

    #header .bsbo-mobile-header__logo .custom-logo {
        float: none;
        display: block;
        width: auto;
        max-width: 190px;
        max-height: 52px;
        padding: 0;
        background: #fff;
        object-fit: contain;
    }

    .bsbo-mobile-header__actions {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
    }

    .bsbo-mobile-action {
        position: relative;
        width: 46px;
        height: 46px;
        border: 0;
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #f4f6f8;
        color: #406da4;
        padding: 0;
        text-decoration: none;
        cursor: pointer;
    }

    .bsbo-mobile-action:hover,
    .bsbo-mobile-action:focus {
        color: #31577f;
        text-decoration: none;
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }

    .bsbo-mobile-cart .fa {
        font-size: 25px;
    }

    .bsbo-mobile-cart__count {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 19px;
        height: 19px;
        padding: 0 4px;
        border-radius: 10px;
        background: #406da4;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 19px;
        text-align: center;
    }

    .bsbo-mobile-menu-toggle {
        flex-direction: column;
        gap: 5px;
    }

    .bsbo-mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: currentColor;
    }

    .bsbo-mobile-search {
        margin: 0;
        padding: 0 15px 10px;
        display: flex;
        width: 100%;
    }

    .bsbo-mobile-search input[type="search"] {
        min-width: 0;
        flex: 1 1 auto;
        height: 44px;
        margin: 0;
        border: 1px solid #b8c0c8;
        border-right: 0;
        border-radius: 4px 0 0 4px;
        padding: 0 12px;
        font-size: 16px;
        background: #fff;
    }

    .bsbo-mobile-search button {
        flex: 0 0 48px;
        height: 44px;
        margin: 0;
        border: 1px solid #406da4;
        border-radius: 0 4px 4px 0;
        background: #406da4;
        color: #fff;
        font-size: 18px;
    }

    .bsbo-mobile-trust {
        background: #406da4;
        color: #fff;
        padding: 6px 15px;
        text-align: center;
        font-size: 12px;
        line-height: 1.35;
        font-weight: 600;
    }

    .bsbo-mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 9999999;
        visibility: hidden;
        pointer-events: none;
    }

    .bsbo-mobile-menu.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    .bsbo-mobile-menu__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0;
        transition: opacity .2s ease;
    }

    .bsbo-mobile-menu.is-open .bsbo-mobile-menu__backdrop {
        opacity: 1;
    }

    .bsbo-mobile-menu__panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(88vw, 360px);
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,.18);
    }

    .bsbo-mobile-menu.is-open .bsbo-mobile-menu__panel {
        transform: translateX(0);
    }

    .bsbo-mobile-menu__heading {
        min-height: 64px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        border-bottom: 1px solid #e5e5e5;
        color: #333;
        font-size: 20px;
    }

    .bsbo-mobile-menu__close {
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        color: #406da4;
        font-size: 34px;
        line-height: 1;
    }

    .bsbo-mobile-menu__nav .bsbo-mobile-menu__list,
    .bsbo-mobile-menu__nav .sub-menu {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .bsbo-mobile-menu__nav .menu-item {
        position: relative;
        border-bottom: 1px solid #ececec;
        padding: 0;
        float: none;
        text-align: left;
    }

    .bsbo-mobile-menu__nav .menu-item > a {
        display: block;
        min-height: 50px;
        padding: 14px 58px 14px 16px;
        color: #333;
        font-size: 16px;
        font-weight: 700;
        line-height: 22px;
        text-transform: none;
        float: none;
    }

    .bsbo-mobile-menu__nav .menu-item > a:hover,
    .bsbo-mobile-menu__nav .menu-item > a:focus {
        color: #406da4;
        background: #f6f8fa;
        text-decoration: none;
    }

    .bsbo-submenu-toggle {
        position: absolute;
        top: 4px;
        right: 6px;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        color: #406da4;
        font-size: 18px;
    }

    .bsbo-submenu-toggle::before {
        content: "\f078";
        font-family: FontAwesome;
    }

    .bsbo-submenu-toggle[aria-expanded="true"]::before {
        content: "\f077";
    }

    .bsbo-mobile-menu__nav .sub-menu {
        display: none;
        background: #f6f8fa;
        border-top: 1px solid #ececec;
    }

    .bsbo-mobile-menu__nav .menu-item.is-submenu-open > .sub-menu {
        display: block;
    }

    .bsbo-mobile-menu__nav .sub-menu .menu-item > a {
        padding-left: 30px;
        font-size: 15px;
        font-weight: 600;
    }

    .bsbo-mobile-menu__utilities {
        padding: 14px 16px 28px;
    }

    .bsbo-mobile-menu__utilities a {
        display: block;
        padding: 11px 0;
        color: #406da4;
        font-size: 15px;
        font-weight: 700;
    }

    body.bsbo-menu-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* BSBO mobile catalogue controls v0.3.0 */
@media (max-width: 767px) {
    .bsbo-mobile-catalogue-tools {
        margin: 0 0 18px;
        padding: 0;
    }

    .bsbo-mobile-catalogue-tools .woocommerce-result-count {
        display: block !important;
        float: none;
        margin: 0 0 10px;
        color: #555;
        font-size: 14px;
        line-height: 1.4;
    }

    .bsbo-mobile-catalogue-tools__buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .bsbo-mobile-filter-toggle,
    .bsbo-mobile-sort .woocommerce-ordering select {
        width: 100%;
        min-height: 46px;
        border: 1px solid #406da4;
        border-radius: 4px;
        background: #fff;
        color: #31577f;
        font-size: 14px;
        font-weight: 700;
    }

    .bsbo-mobile-filter-toggle {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 8px 10px;
    }

    .bsbo-mobile-filter-count {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: #406da4;
        color: #fff;
        font-size: 11px;
        line-height: 20px;
        text-align: center;
    }

    .bsbo-mobile-sort .woocommerce-ordering {
        display: block !important;
        float: none;
        margin: 0;
        width: 100%;
    }

    .bsbo-mobile-sort .woocommerce-ordering select {
        margin: 0;
        padding: 0 32px 0 10px;
        text-transform: none;
    }

    .bsbo-mobile-active-filters {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 7px;
        margin-top: 10px;
    }

    .bsbo-mobile-filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 6px 10px;
        border-radius: 17px;
        background: #eef3f8;
        color: #31577f;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
    }

    .bsbo-mobile-clear-filters {
        padding: 6px 2px;
        color: #555;
        font-size: 13px;
        text-decoration: underline;
    }

    .bsbo-mobile-filters {
        position: fixed;
        inset: 0;
        z-index: 9999999;
        visibility: hidden;
        pointer-events: none;
    }

    .bsbo-mobile-filters.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    .bsbo-mobile-filters__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0;
        transition: opacity .2s ease;
    }

    .bsbo-mobile-filters.is-open .bsbo-mobile-filters__backdrop {
        opacity: 1;
    }

    .bsbo-mobile-filters__panel {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        width: min(92vw, 390px);
        height: 100%;
        background: #fff;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,.18);
    }

    .bsbo-mobile-filters.is-open .bsbo-mobile-filters__panel {
        transform: translateX(0);
    }

    .bsbo-mobile-filters__heading {
        min-height: 64px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        padding: 10px 16px;
        border-bottom: 1px solid #e5e5e5;
        color: #333;
        font-size: 20px;
    }

    .bsbo-mobile-filters__close {
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        color: #406da4;
        font-size: 34px;
        line-height: 1;
    }

    .bsbo-mobile-filters__content {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 16px 18px;
    }

    .bsbo-mobile-filter-group {
        margin: 0;
        padding: 15px 0;
        border-bottom: 1px solid #e8e8e8;
    }

    .bsbo-mobile-filter-group__title {
        margin: 0 0 10px;
        color: #333;
        font-size: 16px;
        line-height: 1.3;
    }

    .bsbo-mobile-filter-group ul,
    .bsbo-mobile-filter-group .woocommerce-widget-layered-nav-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .bsbo-mobile-filter-group li,
    .bsbo-mobile-filter-group .woocommerce-widget-layered-nav-list__item {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .bsbo-mobile-filter-group li a {
        display: block;
        min-height: 42px;
        padding: 10px 8px;
        border-radius: 3px;
        color: #333;
        font-size: 15px;
        line-height: 22px;
    }

    .bsbo-mobile-filter-group li.chosen a,
    .bsbo-mobile-filter-group li a:hover,
    .bsbo-mobile-filter-group li a:focus {
        background: #eef3f8;
        color: #31577f;
        text-decoration: none;
    }

    .bsbo-mobile-filter-group .count {
        color: #777;
        font-size: 12px;
    }

    .bsbo-mobile-filters__footer {
        flex: 0 0 auto;
        display: flex;
        gap: 10px;
        padding: 12px 16px;
        border-top: 1px solid #e5e5e5;
        background: #fff;
    }

    .bsbo-mobile-filters__clear,
    .bsbo-mobile-filters__show {
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        border-radius: 4px;
        padding: 8px 12px;
        font-size: 14px;
        font-weight: 700;
        text-align: center;
    }

    .bsbo-mobile-filters__clear {
        border: 1px solid #b8c0c8;
        background: #fff;
        color: #444;
    }

    .bsbo-mobile-filters__show {
        border: 1px solid #406da4;
        background: #406da4;
        color: #fff;
    }

    body.bsbo-filter-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* BSBO richer mobile product filters v0.3.2 */
@media (max-width: 767px) {
    .bsbo-mobile-filter-form {
        display: flex;
        min-height: 0;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .bsbo-mobile-filter-select,
    .bsbo-mobile-filter-input {
        width: 100%;
        min-height: 46px;
        margin: 0;
        border: 1px solid #b8c0c8;
        border-radius: 4px;
        background: #fff;
        color: #333;
        padding: 8px 10px;
        font-size: 16px;
        line-height: 1.3;
    }

    .bsbo-mobile-filter-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bsbo-mobile-filter-options--compact {
        grid-template-columns: 1fr 1fr;
    }

    .bsbo-mobile-filter-option {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 44px;
        margin: 0;
        padding: 8px 10px;
        border: 1px solid #e1e5e9;
        border-radius: 4px;
        background: #fff;
        color: #333;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

    .bsbo-mobile-filter-option input {
        width: 20px;
        height: 20px;
        margin: 0;
        flex: 0 0 auto;
    }

    .bsbo-mobile-filter-option:has(input:checked) {
        border-color: #406da4;
        background: #eef3f8;
        color: #31577f;
    }

    .bsbo-mobile-filter-help {
        margin: 7px 0 0;
        color: #666;
        font-size: 12px;
        line-height: 1.45;
    }

    .bsbo-mobile-filter-group fieldset,
    fieldset.bsbo-mobile-filter-group {
        min-width: 0;
    }

    legend.bsbo-mobile-filter-group__title {
        width: auto;
        border: 0;
        padding: 0;
    }
}

/* Measurement selector and deduplicated blade widths v0.3.4 */
@media (max-width: 767px) {
    .bsbo-mobile-unit-group {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .bsbo-mobile-unit-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .bsbo-mobile-unit-toggle__button {
        min-height: 44px;
        margin: 0;
        border: 1px solid #b8c0c8;
        border-radius: 4px;
        background: #fff;
        color: #444;
        padding: 8px 10px;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.25;
    }

    .bsbo-mobile-unit-toggle__button.is-active {
        border-color: #406da4;
        background: #406da4;
        color: #fff;
    }

    .bsbo-mobile-unit-toggle__button:focus {
        outline: 2px solid #406da4;
        outline-offset: 2px;
    }
}

/* BSBO 0.4.0: reduce non-shopping content before product results on mobile. */
@media (max-width: 767px) {
  .bsbo-commerce-content {
    padding-top: 0;
  }

  .woocommerce-products-header {
    margin-bottom: 12px;
  }

  .woocommerce-products-header .page-title {
    margin-top: 20px;
    margin-bottom: 14px;
  }

  body.tax-product_cat .term-description,
  body.post-type-archive-product .page-description {
    position: relative;
  }

  body.tax-product_cat .term-description.bsbo-description-collapsible,
  body.post-type-archive-product .page-description.bsbo-description-collapsible {
    max-height: 150px;
    overflow: hidden;
  }

  body.tax-product_cat .term-description.bsbo-description-collapsible:after,
  body.post-type-archive-product .page-description.bsbo-description-collapsible:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%);
  }

  body.tax-product_cat .term-description.bsbo-description-expanded,
  body.post-type-archive-product .page-description.bsbo-description-expanded {
    max-height: none;
  }

  body.tax-product_cat .term-description.bsbo-description-expanded:after,
  body.post-type-archive-product .page-description.bsbo-description-expanded:after {
    display: none;
  }

  .bsbo-description-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 0;
    margin: 0 0 12px;
    border: 0;
    background: transparent;
    color: #3f70aa;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
  }

  .bsbo-conversion-page .page-header {
    margin-top: 15px;
  }
}


/* BSBO 0.4.2: trust-bar wrapping, cleaner archive-description fade and
 * less non-shopping space at the top of the mobile homepage. */
@media (max-width: 767px) {
  .bsbo-mobile-trust {
    white-space: normal;
    line-height: 1.35;
    padding-left: 10px;
    padding-right: 10px;
  }

  body.tax-product_cat .term-description.bsbo-description-collapsible:after,
  body.post-type-archive-product .page-description.bsbo-description-collapsible:after {
    height: 72px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.96) 58%, #fff 78%);
  }

  body.home #slider-wrap {
    display: none !important;
  }

  body.home .content-strip {
    padding-top: 18px;
    padding-bottom: 24px;
  }

  body.home .content-strip .page-header {
    margin-top: 0;
    margin-bottom: 16px;
  }

  body.home .content-strip .page-header h1 {
    margin-top: 0;
  }
}

/* BSBO 0.4.3: keep the mobile homepage focused on product discovery. */
@media (max-width: 767px) {
    body.home .bsbo-home-intro {
        position: relative;
        max-height: 220px;
        overflow: hidden;
    }

    body.home .bsbo-home-intro::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 54px;
        pointer-events: none;
        background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 82%);
    }

    body.home .bsbo-home-intro.bsbo-home-intro--expanded {
        max-height: none;
        overflow: visible;
    }

    body.home .bsbo-home-intro.bsbo-home-intro--expanded::after {
        display: none;
    }

    body.home .bsbo-home-intro-toggle {
        appearance: none;
        border: 0;
        background: transparent;
        color: #406da4;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.4;
        padding: 8px 0 4px;
        text-decoration: underline;
        cursor: pointer;
    }

    body.home .bsbo-home-intro-toggle:focus {
        outline: 2px solid #406da4;
        outline-offset: 2px;
    }

    body.home .bsbo-home-intro-wrap {
        margin-bottom: 14px;
    }

    body.home .content-strip:first-of-type {
        padding-top: 12px;
        padding-bottom: 18px;
    }

    body.home .content-strip:first-of-type .page-header {
        margin-bottom: 10px;
    }

    body.home .content-strip:first-of-type .page-header h1 {
        margin-top: 0;
        margin-bottom: 10px;
    }
}

/* BSBO 0.4.4: move the existing homepage montage above the intro on mobile. */
.bsbo-home-montage-mobile {
    display: none;
}

@media (max-width: 767px) {
    body.home .bsbo-home-montage-mobile {
        display: block;
        width: 100%;
        overflow: hidden;
        background: #f5f5f5;
        aspect-ratio: 16 / 9;
    }

    body.home .bsbo-home-montage-mobile__image {
        display: block;
        width: 100%;
        height: 100% !important;
        max-width: none;
        object-fit: cover;
        object-position: center;
    }

    body.home .bsbo-home-montage-original {
        display: none !important;
    }

    body.home .content-strip:first-of-type {
        padding-top: 14px;
    }
}


/* BSBO mobile homepage header order v0.4.5 */
@media (max-width: 767px) {
    #header .bsbo-mobile-header {
        display: flex;
        flex-direction: column;
    }

    #header .bsbo-mobile-trust {
        order: 1;
    }

    #header .bsbo-home-montage-mobile {
        order: 2;
        width: 100%;
        margin: 0;
        overflow: hidden;
        background: #f3f3f3;
    }

    #header .bsbo-home-montage-mobile__image {
        display: block;
        width: 100%;
        height: auto;
        max-height: 330px;
        object-fit: cover;
        margin: 0;
    }

    #header .bsbo-mobile-header__top {
        order: 3;
        margin-top: 0;
    }

    #header .bsbo-mobile-search {
        order: 4;
    }

    body.home #main,
    body.page-template-template-homepage #main {
        padding-top: 0;
    }
}


/* BSBO 0.4.6: homepage full-bleed hero with floating logo/menu controls. */
@media (max-width: 767px) {
    body.home #header .bsbo-mobile-header--home,
    body.page-template-template-homepage #header .bsbo-mobile-header--home {
        overflow: visible;
        border-bottom: 0;
    }

    body.home #header .bsbo-mobile-header--home .bsbo-mobile-trust,
    body.page-template-template-homepage #header .bsbo-mobile-header--home .bsbo-mobile-trust {
        position: relative;
        z-index: 5;
    }

    body.home #header .bsbo-home-mobile-hero,
    body.page-template-template-homepage #header .bsbo-home-mobile-hero {
        position: relative;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        overflow: hidden;
        background: #f3f3f3;
    }

    body.home #header .bsbo-home-montage-mobile,
    body.page-template-template-homepage #header .bsbo-home-montage-mobile {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        aspect-ratio: auto;
        overflow: hidden;
    }

    body.home #header .bsbo-home-montage-mobile__image,
    body.page-template-template-homepage #header .bsbo-home-montage-mobile__image {
        display: block;
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        max-height: none;
        margin: 0 !important;
        object-fit: contain;
    }

    body.home #header .bsbo-mobile-header__top--overlay,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay {
        position: absolute;
        top: 12px;
        left: 0;
        right: 0;
        z-index: 6;
        min-height: 0;
        padding: 0 14px;
        align-items: flex-start;
        pointer-events: none;
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo,
    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__actions,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__actions {
        pointer-events: auto;
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo {
        flex: 0 0 auto;
        padding: 7px 9px;
        border-radius: 4px;
        background: rgba(255,255,255,.86);
        box-shadow: 0 2px 12px rgba(255,255,255,.55), 0 2px 8px rgba(0,0,0,.12);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo .custom-logo,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo .custom-logo {
        max-width: 118px;
        max-height: 46px;
        background: transparent;
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-menu-toggle,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-menu-toggle {
        background: rgba(255,255,255,.82);
        box-shadow: 0 2px 10px rgba(0,0,0,.12);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    body.home #header .bsbo-mobile-header--home > .bsbo-mobile-search,
    body.page-template-template-homepage #header .bsbo-mobile-header--home > .bsbo-mobile-search,
    body.home #header .bsbo-mobile-header--home .bsbo-mobile-cart,
    body.page-template-template-homepage #header .bsbo-mobile-header--home .bsbo-mobile-cart {
        display: none !important;
    }

    .bsbo-mobile-menu__shopping-tools {
        padding: 14px 16px 16px;
        border-bottom: 1px solid #e5e5e5;
        background: #f7f8fa;
    }

    .bsbo-mobile-menu__basket {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
        padding: 0 13px;
        border: 1px solid #d8dee5;
        border-radius: 4px;
        background: #fff;
        color: #31577f;
        font-size: 15px;
        font-weight: 700;
        text-decoration: none;
    }

    .bsbo-mobile-menu__basket .fa {
        margin-right: 7px;
    }

    .bsbo-mobile-menu__basket-count {
        min-width: 24px;
        height: 24px;
        padding: 0 7px;
        border-radius: 12px;
        background: #406da4;
        color: #fff;
        line-height: 24px;
        text-align: center;
        font-size: 12px;
    }

    .bsbo-mobile-menu__search {
        display: flex;
        width: 100%;
        margin: 0;
    }

    .bsbo-mobile-menu__search input[type="search"] {
        min-width: 0;
        flex: 1 1 auto;
        height: 44px;
        margin: 0;
        padding: 0 12px;
        border: 1px solid #b8c0c8;
        border-right: 0;
        border-radius: 4px 0 0 4px;
        background: #fff;
        font-size: 16px;
    }

    .bsbo-mobile-menu__search button {
        flex: 0 0 48px;
        height: 44px;
        margin: 0;
        border: 1px solid #406da4;
        border-radius: 0 4px 4px 0;
        background: #406da4;
        color: #fff;
        font-size: 18px;
    }
}

/* BSBO 0.4.7: transparent logo treatment and contained menu basket count. */

/* Remove the parent theme's blue border/white box from the logo everywhere. */
#header a.custom-logo-link,
#header .custom-logo-link {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    height: auto !important;
}

#header .custom-logo {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Keep the desktop logo clean while preserving its existing sizing/layout. */
@media (min-width: 768px) {
    #header .middle-wrap .custom-logo-link {
        display: inline-block !important;
        width: auto !important;
        block-size: auto !important;
    }

    #header .middle-wrap .custom-logo {
        max-width: 100%;
        object-fit: contain;
    }
}

@media (max-width: 767px) {
    /* Homepage: float the transparent artwork itself, not a white card. */
    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo .custom-logo,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-mobile-header__logo .custom-logo {
        width: auto !important;
        max-width: 122px !important;
        height: auto !important;
        max-height: 58px !important;
        filter: drop-shadow(0 1px 3px rgba(255,255,255,.95)) drop-shadow(0 2px 5px rgba(0,0,0,.18));
    }

    /* Keep ordinary mobile-page logos box-free too. */
    #header .bsbo-mobile-header__logo,
    #header .bsbo-mobile-header__logo .custom-logo-link,
    #header .bsbo-mobile-header__logo .custom-logo {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    /* Parent .totalAmount rules position counts absolutely. Reset it in this row. */
    .bsbo-mobile-menu__basket .bsbo-mobile-menu__basket-count,
    .bsbo-mobile-menu__basket .totalAmount {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-width: 24px;
        width: auto !important;
        height: 24px;
        margin: 0 !important;
        padding: 0 7px !important;
        border-radius: 12px;
        background: #406da4 !important;
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 700;
        line-height: 24px !important;
        text-align: center;
        transform: none !important;
    }
}

/* BSBO 0.4.8: supplied transparent logo + trust bar integrated with homepage montage. */
#header .bsbo-brand-logo {
    display: inline-block !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    line-height: 0;
}

#header .bsbo-brand-logo__image {
    display: block;
    width: auto;
    height: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

@media (min-width: 768px) {
    #header .middle-wrap .bsbo-brand-logo__image {
        max-width: 100%;
        max-height: 145px;
        object-fit: contain;
    }
}

@media (max-width: 767px) {
    body.home #header .bsbo-home-mobile-hero,
    body.page-template-template-homepage #header .bsbo-home-mobile-hero {
        position: relative;
        padding-top: 0;
    }

    body.home #header .bsbo-mobile-trust--hero,
    body.page-template-template-homepage #header .bsbo-mobile-trust--hero {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 8;
        width: 100%;
        margin: 0;
    }

    body.home #header .bsbo-mobile-header__top--overlay,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay {
        top: 42px;
    }

    body.home #header .bsbo-mobile-header__top--overlay .bsbo-brand-logo__image,
    body.page-template-template-homepage #header .bsbo-mobile-header__top--overlay .bsbo-brand-logo__image {
        width: 126px !important;
        max-width: 126px !important;
        max-height: 64px !important;
        filter: drop-shadow(0 1px 2px rgba(255,255,255,.9)) drop-shadow(0 2px 5px rgba(0,0,0,.2));
    }

    /* Ensure the montage starts at the very top, underneath the trust bar overlay. */
    body.home #header .bsbo-home-montage-mobile,
    body.page-template-template-homepage #header .bsbo-home-montage-mobile {
        margin-top: 0 !important;
    }
}
