/* METAMINING DYNAMIC PERFORMANCE v1.0.7
   Shop product-grid CSS remains unchanged. */
.mm-miner-overview .mm-perf-efficiency .mm-perf-eff-value {
    overflow-wrap: normal;
}

/* Full exact values can span more than one line. Do not expand the tiles. */
.mm-miner-overview.mm-perf-preview .mm-mo-stats .mm-mo-stat > span:last-child {
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}
.mm-miner-overview.mm-perf-preview .mm-perf-efficiency .mm-perf-eff-value {
    font-size: 11px;
    line-height: 1.35;
}

/* Match the shop's light-grey, white rounded hashrate treatment on the
   main single-product gallery ONLY. Keep all labels on one row. */
body.single-product .product-image-summary .product-labels:has(> .attribute-label),
body.single-product .woocommerce-product-gallery .product-labels:has(> .attribute-label) {
    display: inline-flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: flex-start;
    gap: 2px !important;
    width: max-content !important;
    max-width: calc(100% - 16px);
    padding: 5px 10px !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: 0 1px 5px rgba(25, 42, 68, .09);
    white-space: nowrap;
}
body.single-product .product-image-summary .product-labels > .attribute-label,
body.single-product .woocommerce-product-gallery .product-labels > .attribute-label {
    display: inline !important;
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #87919f !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    white-space: nowrap !important;
}
body.single-product .product-image-summary .product-labels > .attribute-label:has(~ .attribute-label)::after,
body.single-product .woocommerce-product-gallery .product-labels > .attribute-label:has(~ .attribute-label)::after {
    content: ',';
    color: #87919f;
}
@media (max-width: 767px) {
    body.single-product .product-image-summary .product-labels:has(> .attribute-label),
    body.single-product .woocommerce-product-gallery .product-labels:has(> .attribute-label) {
        padding: 4px 7px !important;
        gap: 1px !important;
    }
    body.single-product .product-image-summary .product-labels > .attribute-label,
    body.single-product .woocommerce-product-gallery .product-labels > .attribute-label {
        font-size: 10px !important;
    }
}

/* METAMINING v1.0.7 - WooCommerce variation buttons.
   Existing WoodMart swatches are left alone and styled by the site's Global CSS.
   Only genuine dropdowns are enhanced; original selects remain for WooCommerce. */
body.single-product form.variations_form select.mm-perf-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
}
body.single-product form.variations_form .mm-perf-choices {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 112px !important;
    max-width: 100% !important;
    width: max-content !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border: 1px solid #D9DCE3 !important;
    border-radius: var(--btn-shop-brd-radius, var(--btn-default-brd-radius, 5px)) !important;
    background: #FFFFFF !important;
    color: #242424 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    box-shadow: 0 2px 5px rgba(0,0,0,.04) !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice::before {
    content: '' !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
    border: 2px solid #A8ADB5 !important;
    border-radius: 50% !important;
    background: transparent !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice::after {
    content: none !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice:not(:disabled):not(.mm-is-active):hover {
    border-color: var(--mm-blue, #2B68E2) !important;
    background: #F4F8FF !important;
    box-shadow: 0 3px 10px rgba(43,104,226,.12) !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice.mm-is-active {
    background: var(--mm-blue, #2B68E2) !important;
    border-color: var(--mm-blue, #2B68E2) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 7px rgba(43,104,226,.18) !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice.mm-is-active::before {
    border-color: #FFFFFF !important;
    background: radial-gradient(circle, #FFFFFF 0 3px, transparent 3.5px) !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice:focus-visible {
    outline: 2px solid var(--mm-blue, #2B68E2) !important;
    outline-offset: 3px !important;
}
body.single-product form.variations_form .mm-perf-choices .mm-perf-choice:disabled {
    opacity: .45 !important;
    cursor: not-allowed !important;
}
body.single-product form.variations_form table.variations tr:has(label[for="pa_condition"]) .mm-perf-choice,
body.single-product form.variations_form table.variations tr:has(label[for="pa_warranty"]) .mm-perf-choice {
    min-width: 155px !important;
}
body.single-product form.variations_form table.variations tr:has(label[for="pa_delivery-batch"]) .mm-perf-choice {
    min-width: 155px !important;
}
/* The old Global CSS's negative margin was tuned for WoodMart swatches.
   Avoid pulling our fallback buttons into the Delivery Batch label. */
body.single-product form.variations_form table.variations tr:has(.mm-perf-choices):has(label[for="pa_delivery-batch"]) > td.value {
    margin-top: 0 !important;
}
@media (max-width: 767px) {
    body.single-product form.variations_form .mm-perf-choices { gap: 8px !important; }
    body.single-product form.variations_form .mm-perf-choices .mm-perf-choice { min-width: 100px !important; padding: 0 10px !important; }
    body.single-product form.variations_form table.variations tr:has(label[for="pa_condition"]) .mm-perf-choice,
    body.single-product form.variations_form table.variations tr:has(label[for="pa_warranty"]) .mm-perf-choice,
    body.single-product form.variations_form table.variations tr:has(label[for="pa_delivery-batch"]) .mm-perf-choice { min-width: 135px !important; }
}

/* METAMINING v1.0.7 - Reliable labels and equal spacing.
   WooCommerce often uses TH.label while some WoodMart templates use TD.label.
   v1.0.6 targeted TD.label only, so labels/colons and gaps survived.
   data-mm-label comes from the unchanged original select/heading. */
body.single-product form.variations_form.mm-perf-ready table.variations tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr + tr {
    margin-top: 14px !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label, td.value) {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    vertical-align: top !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label)[data-mm-label] {
    position: relative !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    font-size: 0 !important;
    line-height: 0 !important;
}
/* Create a single visual heading without a colon, even if WoodMart wraps the
   original text in spans or appends the colon in a pseudo-element. */
body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label)[data-mm-label]::before {
    content: attr(data-mm-label) !important;
    display: block !important;
    position: static !important;
    width: max-content !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 20px !important;
    color: #242424 !important;
    text-transform: none !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label)[data-mm-label]::after {
    content: none !important;
    display: none !important;
}
/* Keep the real WooCommerce label in the accessibility tree but not in layout;
   it remains associated with the WooCommerce select (the source of truth). */
body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label)[data-mm-label] > label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    pointer-events: none !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr > td.value {
    min-height: 0 !important;
    height: auto !important;
    line-height: normal !important;
    margin-top: 0 !important;  /* also cancels legacy Delivery Batch -20px */
    margin-bottom: 0 !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations tr > td.value > :is(.wd-swatches-product, .mm-perf-choices) {
    display: flex !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.single-product form.variations_form.mm-perf-ready {
    --mm-choice-width: 140px;
}
/* Same width and height, regardless of variation name or label length. */
body.single-product form.variations_form.mm-perf-ready table.variations tr > td.value .wd-swatches-product .wd-swatch,
body.single-product form.variations_form.mm-perf-ready table.variations .mm-perf-choices .mm-perf-choice {
    box-sizing: border-box !important;
    flex: 0 0 var(--mm-choice-width) !important;
    width: var(--mm-choice-width) !important;
    min-width: var(--mm-choice-width) !important;
    max-width: var(--mm-choice-width) !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}
body.single-product form.variations_form.mm-perf-ready table.variations .wd-swatches-product .wd-swatch span {
    white-space: normal !important;
}
@media (max-width: 767px) {
    body.single-product form.variations_form.mm-perf-ready { --mm-choice-width: 135px; }
    body.single-product form.variations_form.mm-perf-ready table.variations tr > :is(th.label, td.label)[data-mm-label]::before {
        font-size: 14px !important;
    }
    body.single-product form.variations_form.mm-perf-ready table.variations tr > td.value > :is(.wd-swatches-product, .mm-perf-choices) {
        gap: 8px !important;
    }
}
@media (max-width: 330px) {
    body.single-product form.variations_form.mm-perf-ready { --mm-choice-width: 120px; }
}
