.gpst-badge-host {
    position: relative !important;
}

.gpst-badge-stack {
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.gpst-product-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 30px;
    min-width: 78px;
    min-height: 30px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 2px solid #000;
    border-radius: 4px;
    color: var(--gpst-badge-text, #fff) !important;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 5px 5px rgba(0, 0, 0, .72);
}

.gpst-badge-sale {
    background: var(--gpst-sale-badge, #17666f);
}

.gpst-badge-owned {
    background: var(--gpst-owned-badge, #4a1758);
}

.woocommerce span.onsale.gpst-native-sale-badge,
.woocommerce-page span.onsale.gpst-native-sale-badge {
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    width: 78px;
    height: 30px;
    min-width: 78px;
    min-height: 30px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 2px solid #000;
    border-radius: 4px;
    background: var(--gpst-sale-badge, #17666f);
    box-shadow: 0 5px 5px rgba(0, 0, 0, .72);
    color: var(--gpst-badge-text, #fff);
    font-size: 12px;
    line-height: 26px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.gpst-native-badge-hidden {
    display: none !important;
}

@media (max-width: 520px) {
    .gpst-badge-stack {
        top: 6px;
        left: 6px;
        right: auto;
        gap: 4px;
    }

    .gpst-product-badge,
    .woocommerce span.onsale.gpst-native-sale-badge,
    .woocommerce-page span.onsale.gpst-native-sale-badge {
        width: 72px;
        min-width: 72px;
        height: 28px;
        min-height: 28px;
        padding: 0 7px;
        font-size: 11px;
    }

    .woocommerce span.onsale.gpst-native-sale-badge,
    .woocommerce-page span.onsale.gpst-native-sale-badge {
        top: 6px !important;
        left: 6px !important;
        line-height: 24px;
    }
}

/* Grim Press products use a single customer-facing format selector. Keep the
 * technical WooCommerce attribute label available to assistive technology, but
 * remove it from the visual layout. The actual SKU remains in product meta. */
.single-product form.variations_form table.variations th.label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.single-product form.variations_form table.variations td.value {
    padding-left: 0 !important;
}

.single-product form.variations_form table.variations td.value select {
    min-width: 230px;
    max-width: 100%;
}

@media (max-width: 520px) {
    .single-product form.variations_form table.variations td.value select {
        min-width: min(230px, 100%);
    }
}



/* Classic checkout layout: show the order summary before billing/customer fields,
 * while leaving payment, terms, and Place order in WooCommerce's normal flow. */
.woocommerce-checkout form.checkout .gpst-checkout-order-summary {
    display: block;
    width: 100%;
    clear: both;
    margin: 0 0 2rem;
}

.woocommerce-checkout form.checkout .gpst-checkout-order-summary #order_review_heading {
    float: none !important;
    width: 100% !important;
    margin-top: 0;
}

.woocommerce-checkout form.checkout .gpst-checkout-order-summary .woocommerce-checkout-review-order-table {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
