/*
 * Mr B's Extracts — Mobile Visual Polish 1.0.3
 * Presentation only. Deliberately scoped to <= 849px.
 * 1.0.3 restores a conventional Flatsome right-side off-canvas mobile menu.
 */

@media screen and (max-width: 849px) {
    :root {
        --mrbs-black: #0b0a08;
        --mrbs-black-soft: #15120d;
        --mrbs-amber: #d99a25;
        --mrbs-amber-soft: #e6ad3f;
        --mrbs-cream: #f4efe4;
        --mrbs-cream-deep: #ece3d3;
        --mrbs-ink: #171109;
        --mrbs-muted: #8b765b;
    }

    /* ---------- Mobile header: hamburger belongs at the far-right edge ---------- */
    #header,
    #header .header-wrapper,
    #header .header-main,
    #header .header-bottom {
        background-color: var(--mrbs-black) !important;
    }

    #header .header-top {
        background-color: var(--mrbs-amber) !important;
        color: var(--mrbs-black) !important;
        min-height: 23px !important;
    }

    #header .header-top,
    #header .header-top a,
    #header .header-top .nav > li > a {
        color: var(--mrbs-black) !important;
    }

    #header .header-main .header-inner {
        min-height: 54px !important;
        padding-left: 10px !important;
        padding-right: 4px !important;
    }

    #header .header-main .flex-right {
        margin-left: auto !important;
        padding-right: 0 !important;
    }

    #header ul.mobile-nav.nav-right {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }

    #header .header-main .nav > li > a,
    #header .header-main .nav-icon a,
    #header .header-main .icon-menu,
    #header .header-main .icon-search,
    #header .header-main .icon-shopping-cart {
        color: var(--mrbs-cream) !important;
    }

    #header .header-main .nav > li > a:hover,
    #header .header-main .nav-icon a:hover {
        color: var(--mrbs-amber-soft) !important;
    }

    #header .mrbs-mobile-menu-trigger-item {
        order: 9999 !important;
        flex: 0 0 auto !important;
        margin-left: 1px !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }

    #header .mrbs-mobile-menu-trigger {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #header .mrbs-mobile-menu-trigger .icon-menu,
    #header .mrbs-mobile-menu-trigger i {
        margin: 0 !important;
    }

    /* ---------- Normal mobile menu: native-style right off-canvas drawer ---------- */
    html.mrbs-mobile-menu-open,
    body.mrbs-mobile-menu-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    /* Only the backdrop belonging to the open #main-menu popup is changed. */
    .mrbs-main-menu-backdrop {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #000 !important;
        opacity: 0 !important;
        transition: opacity .24s ease !important;
        z-index: 10420 !important;
    }

    body.mrbs-mobile-menu-open .mrbs-main-menu-backdrop {
        opacity: .66 !important;
    }

    /* The popup shell fills the viewport, but it stays transparent. The drawer is .mfp-content. */
    .mrbs-main-menu-popup {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        z-index: 10430 !important;
    }

    .mrbs-main-menu-popup .mfp-container {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        background: transparent !important;
    }

    .mrbs-main-menu-popup .mfp-container::before {
        display: none !important;
    }

    .mrbs-main-menu-popup .mfp-content {
        -webkit-overflow-scrolling: touch;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background: var(--mrbs-black) !important;
        color: var(--mrbs-cream) !important;
        opacity: 1 !important;
        box-shadow: -14px 0 38px rgba(0, 0, 0, .38) !important;
        transform: translateX(100%) !important;
        transition: transform .24s ease !important;
        vertical-align: top !important;
    }

    body.mrbs-mobile-menu-open .mrbs-main-menu-popup .mfp-content {
        transform: translateX(0) !important;
    }

    .mrbs-main-menu-popup.mfp-removing .mfp-content {
        transform: translateX(100%) !important;
    }

    .mrbs-main-menu-popup #main-menu,
    .mrbs-main-menu-popup #main-menu.mobile-sidebar,
    .mrbs-main-menu-popup .mrbs-mobile-menu-drawer {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: var(--mrbs-black) !important;
        color: var(--mrbs-cream) !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .mrbs-main-menu-popup #main-menu .sidebar-menu {
        box-sizing: border-box !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        width: 100% !important;
        margin: 0 !important;
        padding: max(64px, calc(env(safe-area-inset-top) + 54px)) 0 max(28px, env(safe-area-inset-bottom)) !important;
        background: var(--mrbs-black) !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar,
    .mrbs-main-menu-popup #main-menu .nav-sidebar > li,
    .mrbs-main-menu-popup #main-menu .nav-sidebar ul,
    .mrbs-main-menu-popup #main-menu .nav-sidebar .sub-menu {
        background: transparent !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar > li > a,
    .mrbs-main-menu-popup #main-menu .nav-sidebar .sub-menu li > a {
        justify-content: flex-start !important;
        text-align: left !important;
        color: var(--mrbs-cream) !important;
        border-color: rgba(244, 239, 228, .11) !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar > li > a {
        min-height: 50px !important;
        padding: 14px 22px !important;
        font-size: 16px !important;
        line-height: 1.25 !important;
        font-weight: 720 !important;
        letter-spacing: .01em !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar .sub-menu li > a {
        padding: 11px 22px 11px 34px !important;
        font-size: 14px !important;
        color: rgba(244, 239, 228, .82) !important;
    }

    .mrbs-main-menu-popup #main-menu .nav-sidebar > li.active > a,
    .mrbs-main-menu-popup #main-menu .nav-sidebar > li.current-menu-item > a,
    .mrbs-main-menu-popup #main-menu .nav-sidebar a:hover,
    .mrbs-main-menu-popup #main-menu .nav-sidebar a:focus-visible {
        color: var(--mrbs-amber-soft) !important;
        background: rgba(217, 154, 37, .07) !important;
    }

    .mrbs-main-menu-popup #main-menu .toggle,
    .mrbs-main-menu-popup #main-menu .icon-angle-down,
    .mrbs-main-menu-popup #main-menu .icon-angle-right {
        color: var(--mrbs-cream) !important;
    }

    /* Close button belongs to the drawer's upper-right corner. */
    .mrbs-main-menu-popup .mfp-close {
        position: fixed !important;
        top: max(12px, env(safe-area-inset-top)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
        left: auto !important;
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--mrbs-cream) !important;
        background: transparent !important;
        border: 1px solid rgba(244, 239, 228, .28) !important;
        border-radius: 999px !important;
        opacity: 1 !important;
        z-index: 10440 !important;
    }

    /* Floating support controls return immediately when the drawer closes. */
    body.mrbs-mobile-menu-open .mrbs-community-mobile-pill,
    body.mrbs-mobile-menu-open .chatway--container,
    body.mrbs-mobile-menu-open .mrbs-chatway-shell {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* ---------- Homepage hero: preserve impact but improve small-screen balance ---------- */
    body.home #main h1 {
        line-height: 0.96 !important;
        letter-spacing: -0.035em !important;
        text-wrap: balance;
    }

    body.home #main .button,
    body.home #main a.button {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ---------- Product archives/categories: one coherent card system ---------- */
    body.post-type-archive-product .products .product-small .col-inner,
    body.tax-product_cat .products .product-small .col-inner,
    body.woocommerce-shop .products .product-small .col-inner {
        height: 100% !important;
        background: var(--mrbs-cream) !important;
        border: 1px solid rgba(217, 154, 37, 0.19) !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
    }

    body.post-type-archive-product .products .product-small .box,
    body.tax-product_cat .products .product-small .box,
    body.woocommerce-shop .products .product-small .box {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        background: transparent !important;
    }

    body.post-type-archive-product .products .product-small .box-image,
    body.tax-product_cat .products .product-small .box-image,
    body.woocommerce-shop .products .product-small .box-image {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 !important;
        overflow: hidden !important;
        background: var(--mrbs-cream-deep) !important;
        border-radius: 0 !important;
    }

    body.post-type-archive-product .products .product-small .box-image .image-cover,
    body.post-type-archive-product .products .product-small .box-image .image-fade_in_back,
    body.tax-product_cat .products .product-small .box-image .image-cover,
    body.tax-product_cat .products .product-small .box-image .image-fade_in_back,
    body.woocommerce-shop .products .product-small .box-image .image-cover,
    body.woocommerce-shop .products .product-small .box-image .image-fade_in_back {
        height: 100% !important;
        padding-top: 0 !important;
    }

    body.post-type-archive-product .products .product-small .box-image img,
    body.tax-product_cat .products .product-small .box-image img,
    body.woocommerce-shop .products .product-small .box-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    body.post-type-archive-product .products .product-small .box-text,
    body.tax-product_cat .products .product-small .box-text,
    body.woocommerce-shop .products .product-small .box-text {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: var(--mrbs-cream) !important;
        color: var(--mrbs-ink) !important;
        padding: 11px 10px 14px !important;
        text-align: center !important;
    }

    body.post-type-archive-product .products .product-small .category,
    body.tax-product_cat .products .product-small .category,
    body.woocommerce-shop .products .product-small .category {
        color: var(--mrbs-muted) !important;
        font-size: 9.5px !important;
        line-height: 1.25 !important;
        font-weight: 650 !important;
        letter-spacing: 0.08em !important;
        text-transform: uppercase !important;
        margin-bottom: 5px !important;
    }

    body.post-type-archive-product .products .product-small .name,
    body.post-type-archive-product .products .product-small .product-title,
    body.tax-product_cat .products .product-small .name,
    body.tax-product_cat .products .product-small .product-title,
    body.woocommerce-shop .products .product-small .name,
    body.woocommerce-shop .products .product-small .product-title {
        color: var(--mrbs-ink) !important;
        font-size: 14px !important;
        line-height: 1.24 !important;
        font-weight: 750 !important;
        min-height: 3.72em !important;
        margin-bottom: 6px !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        overflow: hidden !important;
    }

    body.post-type-archive-product .products .product-small .name a,
    body.post-type-archive-product .products .product-small .product-title a,
    body.tax-product_cat .products .product-small .name a,
    body.tax-product_cat .products .product-small .product-title a,
    body.woocommerce-shop .products .product-small .name a,
    body.woocommerce-shop .products .product-small .product-title a {
        color: var(--mrbs-ink) !important;
    }

    body.post-type-archive-product .products .product-small .price,
    body.tax-product_cat .products .product-small .price,
    body.woocommerce-shop .products .product-small .price {
        color: var(--mrbs-ink) !important;
        font-size: 13.5px !important;
        line-height: 1.3 !important;
        font-weight: 800 !important;
        margin-top: auto !important;
        min-height: 1.3em !important;
    }

    body.post-type-archive-product .products .product-small .star-rating,
    body.tax-product_cat .products .product-small .star-rating,
    body.woocommerce-shop .products .product-small .star-rating {
        color: var(--mrbs-amber) !important;
        margin-top: 2px !important;
        margin-bottom: 5px !important;
    }

    /* Replace theme/plugin-blue promo circles with the site's own amber language. */
    body.post-type-archive-product .products .product-small .badge-inner,
    body.tax-product_cat .products .product-small .badge-inner,
    body.woocommerce-shop .products .product-small .badge-inner,
    body.post-type-archive-product .products .product-small .onsale,
    body.tax-product_cat .products .product-small .onsale,
    body.woocommerce-shop .products .product-small .onsale {
        background: var(--mrbs-amber) !important;
        color: var(--mrbs-black) !important;
        border: 0 !important;
        border-radius: 999px !important;
        font-size: 10px !important;
        line-height: 1.1 !important;
        font-weight: 850 !important;
        letter-spacing: 0.01em !important;
        min-width: 0 !important;
        min-height: 0 !important;
        width: auto !important;
        height: auto !important;
        padding: 6px 8px !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22) !important;
    }

    body.post-type-archive-product .products .product-small .badge-container,
    body.tax-product_cat .products .product-small .badge-container,
    body.woocommerce-shop .products .product-small .badge-container {
        top: 8px !important;
        left: 8px !important;
        margin: 0 !important;
    }

    /* Wishlist control: readable without introducing another unrelated color. */
    body.post-type-archive-product .products .product-small .wishlist-button,
    body.tax-product_cat .products .product-small .wishlist-button,
    body.woocommerce-shop .products .product-small .wishlist-button {
        color: var(--mrbs-cream) !important;
        background: rgba(11, 10, 8, 0.76) !important;
        border-color: rgba(244, 239, 228, 0.2) !important;
    }

    /* Archive controls should look intentional on the dark canvas. */
    body.post-type-archive-product .woocommerce-ordering select,
    body.tax-product_cat .woocommerce-ordering select,
    body.woocommerce-shop .woocommerce-ordering select {
        color: var(--mrbs-cream) !important;
        background: var(--mrbs-black-soft) !important;
        border: 1px solid rgba(217, 154, 37, 0.42) !important;
        border-radius: 9px !important;
    }

    /* ---------- Floating community bar: keep it, but stop it covering products/chat ---------- */
    .mrbs-community-mobile-pill {
        left: 10px !important;
        right: auto !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: min(168px, 46vw) !important;
        min-width: 0 !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 999px !important;
        overflow: hidden !important;
        z-index: 9998 !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26) !important;
    }

    .mrbs-community-mobile-pill,
    .mrbs-community-mobile-pill * {
        font-size: 10px !important;
        line-height: 1.15 !important;
    }

    .mrbs-community-mobile-pill a,
    a.mrbs-community-mobile-pill {
        min-height: 34px !important;
        padding: 7px 11px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    /* Accessibility: retain visible keyboard focus against dark/cream surfaces. */
    #main-menu a:focus-visible,
    .products .product-small a:focus-visible,
    #header a:focus-visible {
        outline: 2px solid var(--mrbs-amber-soft) !important;
        outline-offset: 2px !important;
    }
}

@media screen and (max-width: 549px) {
    body.home #main h1 {
        font-size: clamp(34px, 10.5vw, 42px) !important;
    }

    body.post-type-archive-product .products.row-small > .product-small.col,
    body.tax-product_cat .products.row-small > .product-small.col,
    body.woocommerce-shop .products.row-small > .product-small.col {
        padding-left: 6px !important;
        padding-right: 6px !important;
        padding-bottom: 12px !important;
    }

    body.post-type-archive-product .products .product-small .box-text,
    body.tax-product_cat .products .product-small .box-text,
    body.woocommerce-shop .products .product-small .box-text {
        padding: 10px 9px 13px !important;
    }
}

/* Respect reduced-motion preference; this plugin adds no mandatory animation. */
@media screen and (max-width: 849px) and (prefers-reduced-motion: reduce) {
    .mrbs-community-mobile-pill,
    #main-menu.mobile-sidebar,
    .mrbs-main-menu-popup .mfp-content,
    .mrbs-main-menu-backdrop {
        transition: none !important;
        animation: none !important;
    }
}
