/* BazaarMed navigation, cart and dashboard corrective layer — v1.5.0 */

/* Sidebar state is resolved from the current Joomla route, not inherited Itemid. */
html.bm-profile-dashboard-preview-v1
[data-bm-profile-menu-v1="1"]
> li:is(.active, .current, .uk-active):not([data-bm-profile-menu-route-active-v15="1"])
> a {
    border-color: transparent !important;
    color: #526b82 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html.bm-profile-dashboard-preview-v1
[data-bm-profile-menu-v1="1"]
> [data-bm-profile-menu-route-active-v15="1"]
> a {
    border-color: rgba(24, 131, 93, .18) !important;
    color: #0d694a !important;
    background: linear-gradient(135deg, #eef9f5, #f2f8fd) !important;
    box-shadow: inset -3px 0 0 #20a373 !important;
}

/* Keep the right dashboard card inside the viewport and its grid track. */
html.bm-profile-dashboard-preview-v1 [data-bm-profile-layout-v1="1"] {
    min-width: 0 !important;
    isolation: isolate;
}

html.bm-profile-dashboard-preview-v1 [data-bm-profile-sidebar-v1="1"] {
    align-self: start !important;
    max-height: calc(100vh - var(--bm2-preview-bar-height, 42px) - 116px);
    max-height: calc(100dvh - var(--bm2-preview-bar-height, 42px) - 116px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

html.bm-profile-dashboard-preview-v1 [data-bm-profile-sidebar-v1="1"] > * {
    min-width: 0;
    max-width: 100%;
}

[data-bm-route-deduplicated-v15="1"] {
    display: none !important;
}

/* Cart: retain the real HikaShop form/actions while presenting the final UI. */
html.bm-final-route-cart-v15 body {
    background:
        radial-gradient(circle at 9% 8%, rgba(38, 174, 126, .07), transparent 23rem),
        radial-gradient(circle at 92% 18%, rgba(23, 112, 178, .08), transparent 24rem),
        #f3f7fb !important;
}

html.bm-final-route-cart-v15 main {
    min-width: 0;
    padding-block: clamp(28px, 5vw, 64px) !important;
}

html.bm-final-route-cart-v15 #hikashop_show_cart_form[data-bm-cart-final-v15="1"] {
    width: min(calc(100% - 32px), 1220px);
    margin-inline: auto;
    padding: 0 !important;
}

html.bm-final-route-cart-v15 #hikashop_show_cart_form > .uk-container {
    width: 100%;
    max-width: none;
    padding: clamp(18px, 3vw, 30px) !important;
    border: 1px solid #dce7f0;
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 48px rgba(13, 53, 93, .09);
}

html.bm-final-route-cart-v15 #hikashop_show_cart_form h1 {
    position: relative;
    margin: 0 0 26px !important;
    padding-inline-start: 18px;
    color: #0d3557 !important;
    font-size: clamp(25px, 4vw, 38px) !important;
    font-weight: 900 !important;
    line-height: 1.55;
}

html.bm-final-route-cart-v15 #hikashop_show_cart_form h1::before {
    position: absolute;
    inset-block: .22em;
    inset-inline-start: 0;
    width: 4px;
    border-radius: 99px;
    background: linear-gradient(180deg, #28ae7e, #1476b8);
    content: "";
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing {
    min-width: 0;
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing .cartRowWrapper {
    align-items: center;
    margin: 0 !important;
    padding: 15px !important;
    border: 1px solid #e0e9f1;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(13, 53, 93, .045);
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing .cartRowWrapper img {
    width: 100%;
    max-width: 112px;
    aspect-ratio: 1;
    padding: 6px;
    border: 1px solid #e4edf4;
    border-radius: 14px;
    object-fit: contain;
    background: #f9fbfd;
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing .productNameColumn a {
    color: #123b60 !important;
    font-weight: 850;
    line-height: 1.8;
    text-decoration: none;
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing :is(
    .productPriceColumn,
    .hikashop_product_price_full,
    .hikashop_product_price
) {
    color: #0d5c9e !important;
    font-variant-numeric: tabular-nums;
    font-weight: 900 !important;
}

html.bm-final-route-cart-v15 #hikashop_cart_product_listing :is(
    input.hikashop_show_cart_quantity,
    input[name*="quantity"],
    select[name*="quantity"]
) {
    min-width: 58px;
    min-height: 44px;
    border: 1px solid #c9dce9;
    border-radius: 11px;
    color: #103c60;
    background: #fff;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

html.bm-final-route-cart-v15 .checkoutSummeryWrapper {
    padding: 21px !important;
    border: 1px solid #d8e6ef !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #fff, #f5fbff) !important;
    box-shadow: 0 12px 30px rgba(13, 53, 93, .08) !important;
}

html.bm-final-route-cart-v15 .checkoutSummeryWrapper .checkoutTitle {
    margin-bottom: 14px;
    color: #0d3557;
    font-size: 18px;
    font-weight: 900;
}

html.bm-final-route-cart-v15 .checkoutSummeryWrapper li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-block: 11px;
    border-bottom: 1px solid #e4edf4;
}

html.bm-final-route-cart-v15 .checkoutSummeryWrapper .uk-button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 15px;
    border: 0;
    border-radius: 12px;
    color: #fff !important;
    background: linear-gradient(135deg, #159563, #0c7a52) !important;
    box-shadow: 0 10px 24px rgba(21, 149, 99, .18);
    font-weight: 900;
}

html.bm-final-route-cart-v15 :is(a, button, input, select):focus-visible {
    outline: 3px solid rgba(1, 175, 253, .32) !important;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    html.bm-profile-dashboard-preview-v1 [data-bm-profile-sidebar-v1="1"] {
        position: relative !important;
        top: auto !important;
        max-height: none;
        overflow: visible !important;
        scrollbar-gutter: auto;
    }

    html.bm-final-route-cart-v15 #hikashop_show_cart_form > .uk-container {
        padding: 18px !important;
        border-radius: 20px;
    }
}

@media (max-width: 639px) {
    html.bm-final-route-cart-v15 #hikashop_show_cart_form[data-bm-cart-final-v15="1"] {
        width: min(calc(100% - 24px), 1220px);
    }

    html.bm-final-route-cart-v15 #hikashop_cart_product_listing .cartRowWrapper {
        padding: 13px !important;
    }

    html.bm-final-route-cart-v15 #hikashop_cart_product_listing .cartRowWrapper img {
        max-width: 96px;
    }

    html.bm-final-route-cart-v15 #hikashop_cart_product_listing :is(
        .cartQuantityColumn,
        .productPriceColumn
    ) {
        justify-content: space-between !important;
        min-height: 44px;
        padding-top: 8px;
        border-top: 1px solid #edf3f7;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.bm-final-route-cart-v15 *,
    html.bm-profile-dashboard-preview-v1 * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* BMED_CANONICAL_PROFILE_SIDEBAR_NOWRAP_V120 START
 * Final-loaded desktop override: this file is enqueued after the base profile
 * design, so route-specific CSS cannot return the sidebar to 270px.
 */
@media (min-width: 960px) {
    html.bm-profile-dashboard-preview-v1 [data-bm-profile-layout-v1="1"] {
        grid-template-columns: minmax(0, 1fr) 310px !important;
    }

    html.bm-profile-dashboard-preview-v1 [data-bm-profile-sidebar-v1="1"] {
        width: 310px !important;
        min-width: 310px !important;
        max-width: 310px !important;
    }

    html.bm-profile-dashboard-preview-v1
    [data-bm-profile-menu-v1="1"] > li > a,
    html.bm-profile-dashboard-preview-v1
    [data-bm-profile-menu-v1="1"] > li > a > span,
    html.bm-profile-dashboard-preview-v1
    [data-bm-profile-menu-v1="1"] > li > span,
    html.bm-profile-dashboard-preview-v1
    [data-bm-profile-sidebar-v1="1"] .bmed-buyer-org-sidebar-link {
        max-width: none !important;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
}
/* BMED_CANONICAL_PROFILE_SIDEBAR_NOWRAP_V120 END */

/* BMED_PROFILE_SIDEBAR_DOUBLE_BORDER_FIX_V130 START
 * The canonical aside owns the outer border. Remove the legacy child borders
 * that otherwise draw a second vertical hairline inside the card.
 */
html.bm-profile-dashboard-preview-v1
[data-bm-profile-sidebar-v1="1"] > [data-uk-sticky] > .loggedUserInfo,
html.bm-profile-dashboard-preview-v1
[data-bm-profile-sidebar-v1="1"] .loggedUserInfo {
    border: 0 !important;
    border-bottom: 1px solid #e5edf3 !important;
    border-radius: 0 !important;
}

html.bm-profile-dashboard-preview-v1
[data-bm-profile-sidebar-v1="1"] .userMenu {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
/* BMED_PROFILE_SIDEBAR_DOUBLE_BORDER_FIX_V130 END */
