/**
 * BazaarMed Product Contract v2 — final UI normalisation.
 * Loaded after the established product-detail stylesheet.
 */
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-pd2-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-pd2-media-card,
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-pd2-info-column {
    min-width: 0 !important;
    height: 100% !important;
    align-self: stretch !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-main-seller-badge-v23-wrap,
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-main-seller-badge-after-price,
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-main-seller-badge {
    display: none !important;
}

.bm-pd2-commerce-card {
    display: none;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(14, 116, 144, .14);
}

.bm-pd2-commerce-card[data-bm-mounted="1"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

.bm-pd2-commerce-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}

.bm-pd2-commerce-status,
.bm-pd2-seller-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #cfe3ef;
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    color: #0b4f8a;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.65;
}

.bm-pd2-seller-chip > *,
.bm-pd2-commerce-status {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bm-pd2-seller-chip > span {
    color: #64748b;
    font-weight: 700;
}

.bm-pd2-commerce-card[data-bm-commerce-state="vendor"] .bm-pd2-commerce-status {
    border-color: #a7e6cc;
    background: #edfff8;
    color: #087a55;
}

.bm-pd2-commerce-card[data-bm-commerce-state="own-unavailable"] .bm-pd2-commerce-status {
    border-color: #f4d7a0;
    background: #fff9ec;
    color: #9a5a00;
}

html.bm-sitewide-final-v1[data-bm-commerce-state="own-unavailable"]
#hikashop_product_quantity_main button[data-addtocart],
html.bm-sitewide-final-v1[data-bm-commerce-state="own-unavailable"]
#hikashop_product_quantity_main .uk-button-primary {
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: .58 !important;
    box-shadow: none !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2]
.hikashop_product_page :is(.bm-main-seller-badge-v23, .bm-main-seller-badge) {
    max-width: 100% !important;
    min-width: 0 !important;
    width: auto !important;
}

@media (max-width: 899px) {
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .bm-pd2-hero-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .bm-pd2-commerce-copy {
        align-items: stretch;
        flex-direction: column;
    }
    .bm-pd2-commerce-status,
    .bm-pd2-seller-chip {
        width: 100%;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bm-pd2-commerce-card,
    .bm-pd2-commerce-card * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* BazaarMed product price layout v1 — visual-only, shared by all product details. */
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-content: center !important;
    align-items: center !important;
    gap: 8px 12px !important;
    min-height: 96px !important;
    padding: 12px 16px !important;
    direction: rtl !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main::after {
    display: none !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-pd2-price-label {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .hikashop_product_price_full,
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-main-price-fallback {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    white-space: nowrap !important;
    direction: rtl !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main .hikashop_product_price,
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main .bm-main-price-fallback {
    display: inline !important;
    white-space: nowrap !important;
    font-size: clamp(17px, 2vw, 25px) !important;
    line-height: 1.35 !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-pd2-commerce-card[data-bm-mounted="1"] {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main .bm-pd2-commerce-copy {
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    min-width: 0 !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main :is(.bm-pd2-commerce-status, .bm-pd2-seller-chip) {
    width: auto !important;
    max-width: 100% !important;
    min-height: 28px !important;
    padding: 4px 9px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 1.55 !important;
}

@media (max-width: 480px) {
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 5px !important;
    }
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-pd2-price-label {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .hikashop_product_price_full,
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-main-price-fallback {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main > .bm-pd2-commerce-card[data-bm-mounted="1"] {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }
}

/* BazaarMed seller-row v2 — align approved-offer and seller chips as one row. */
html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main .bm-pd2-commerce-copy {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    column-gap: 7px !important;
    row-gap: 5px !important;
    direction: rtl !important;
}

html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main :is(.bm-pd2-commerce-status, .bm-pd2-seller-chip) {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 30px !important;
    white-space: nowrap !important;
    line-height: 1.45 !important;
}

@media (max-width: 480px) {
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main .bm-pd2-commerce-copy {
        column-gap: 5px !important;
    }
    html.bm-sitewide-final-v1[data-bm-product-detail-v2] .hikashop_product_page #hikashop_product_price_main :is(.bm-pd2-commerce-status, .bm-pd2-seller-chip) {
        padding-inline: 6px !important;
        font-size: 10.5px !important;
    }
}
