.mahamu-cart-shipping-status,
.mahamu-promptpay-state,
.omise.mahamu-promptpay-details-enhanced,
#omise-offline-payment-result {
    font-family: var(--wp--custom--font--family--ui);
}

.mahamu-product-page {
    font-family: var(--wp--custom--font--family--ui);
}

.mahamu-cart-shipping-status,
.mahamu-product-shipping-summary {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--editorial);
    color: var(--wp--custom--color--text--primary);
}

.mahamu-product-shipping-summary {
    margin-top: 18px;
}

.mahamu-cart-shipping-status p,
.mahamu-product-shipping-summary p {
    margin: 8px 0 0;
    line-height: 1.5;
}

.mahamu-shipping-provider {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.mahamu-shipping-provider img {
    display: block;
    width: 72px;
    height: auto;
}

.mahamu-shipping-policy,
.mahamu-shipping-link {
    color: var(--wp--custom--color--text--secondary);
    font-size: 13px;
}

.mahamu-shipping-link a {
    color: var(--wp--custom--color--action--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mahamu-product-buy-panel .wp-block-post-title {
    font-family: var(--wp--custom--font--family--display);
    font-weight: 600;
    line-height: 1.2;
}

.mahamu-product-buy-panel .wp-block-post-excerpt {
    max-width: 40rem;
    line-height: 1.6;
}

.mahamu-product-buy-panel .wp-block-woocommerce-product-price,
.mahamu-product-buy-panel .woocommerce-variation-price {
    font-variant-numeric: tabular-nums;
}

.mahamu-product-buy-panel .wp-block-woocommerce-product-price {
    color: var(--wp--custom--color--text--primary);
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 600;
}

.mahamu-product-buy-panel .variations {
    width: 100%;
    margin: 0 0 14px;
}

.mahamu-product-buy-panel .variations th,
.mahamu-product-buy-panel .variations td {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
}

.mahamu-product-buy-panel .variations th.label {
    margin: 0 0 8px;
    color: var(--wp--custom--color--text--primary);
    font-size: 15px;
    font-weight: 600;
}

.mahamu-product-buy-panel form.mahamu-has-variation-chips .variations select {
    position: absolute !important;
    width: 1px !important;
    min-width: 0 !important;
    max-width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.mahamu-variation-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.mahamu-variation-chip {
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--wp--custom--color--border--control);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--transaction);
    color: var(--wp--custom--color--text--primary);
    font: inherit;
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard), border-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard), color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.mahamu-variation-chip:hover:not(:disabled) {
    border-color: var(--wp--custom--color--action--primary);
}

.mahamu-variation-chip.is-selected {
    border-color: var(--wp--custom--color--action--primary);
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
    font-weight: 600;
}

.mahamu-variation-chip.is-selected::before {
    content: "✓ ";
}

.mahamu-variation-chip.is-unavailable,
.mahamu-variation-chip:disabled {
    border-color: var(--wp--custom--color--border--subtle);
    background: var(--wp--custom--color--surface--canvas);
    color: var(--wp--custom--color--text--secondary);
    cursor: not-allowed;
    text-decoration: line-through;
}

.mahamu-variation-chip:focus-visible,
.mahamu-product-buy-panel .single_add_to_cart_button:focus-visible,
.mahamu-product-buy-panel .wc-block-components-quantity-selector__button:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.mahamu-product-buy-panel .reset_variations {
    display: inline-block;
    margin-top: 8px;
    color: var(--wp--custom--color--text--secondary);
    font-size: 13px;
    text-underline-offset: 3px;
}

.mahamu-product-buy-panel .single_variation_wrap {
    margin-top: 10px;
}

.mahamu-product-buy-panel .woocommerce-variation.single_variation {
    margin-bottom: 8px;
}

.mahamu-product-buy-panel .variations_button {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 10px;
    align-items: stretch;
}

.mahamu-product-buy-panel .variations_button .quantity {
    grid-column: 1 !important;
    margin: 0 !important;
    min-height: var(--wp--custom--size--control-min-height);
}

.mahamu-product-buy-panel .variations_button .single_add_to_cart_button {
    grid-column: 2 !important;
    width: 100%;
    min-height: var(--wp--custom--size--control-min-height);
    margin: 0;
    padding: 10px 16px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
    font-weight: 600;
    line-height: 1.3;
    box-shadow: var(--wp--custom--shadow--none);
}

.mahamu-product-buy-panel .variations_button .single_add_to_cart_button:hover:not(:disabled) {
    background: var(--wp--custom--color--action--primary-hover);
    border-color: var(--wp--custom--color--action--primary-hover);
}

.mahamu-product-buy-panel .variations_button .single_add_to_cart_button.disabled,
.mahamu-product-buy-panel .variations_button .single_add_to_cart_button:disabled,
.mahamu-product-buy-panel .variations_button .single_add_to_cart_button[aria-disabled="true"] {
    border-color: var(--wp--custom--color--border--control);
    background: var(--wp--custom--color--border--subtle);
    color: var(--wp--custom--color--text--disabled);
    cursor: not-allowed;
    opacity: 1;
}

.mahamu-product-buy-panel .wc-block-components-quantity-selector {
    min-height: var(--wp--custom--size--control-min-height);
    border-color: var(--wp--custom--color--border--control);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--transaction);
}

.mahamu-product-buy-panel .wc-block-components-product-stock-indicator {
    font-weight: 500;
}

.mahamu-product-buy-panel .wc-block-components-product-stock-indicator--in-stock {
    color: var(--wp--custom--color--state--success);
}

.mahamu-product-buy-panel .wc-block-components-product-stock-indicator--out-of-stock {
    color: var(--wp--custom--color--state--error);
}

.mahamu-phone-helper {
    margin: 6px 0 0;
    color: var(--wp--custom--color--text--secondary);
    font-size: 13px;
    line-height: 1.5;
}

.mahamu-promptpay-state {
    max-width: 680px;
    margin: 24px auto;
    padding: 20px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--editorial);
    color: var(--wp--custom--color--text--primary);
    text-align: center;
}

.mahamu-promptpay-state h2 {
    margin: 6px 0 8px;
    color: var(--wp--custom--color--text--primary);
    font-family: var(--wp--custom--font--family--ui);
    font-weight: 500;
    line-height: 1.15;
}

.mahamu-promptpay-state p {
    margin: 6px 0;
    line-height: 1.55;
}

.mahamu-promptpay-eyebrow,
.mahamu-promptpay-meta {
    color: var(--wp--custom--color--text--secondary);
    font-size: 14px;
}

.mahamu-promptpay-state.is-success {
    border-color: var(--wp--custom--color--action--primary);
}

.mahamu-promptpay-state.is-expired {
    background: var(--wp--custom--color--surface--canvas);
}

.omise.mahamu-promptpay-details-enhanced {
    max-width: 680px;
    margin: 0 auto 24px;
    padding: 22px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--transaction);
    color: var(--wp--custom--color--text--primary);
    text-align: center;
    box-shadow: none;
}

.omise.mahamu-promptpay-details-enhanced .omise-qr-image svg {
    width: min(300px, 82vw);
    height: auto;
}

#omise-download-promptpay-qr.omise-download-promptpay-qr,
.omise.omise-promptpay-details .qr-alert-box {
    display: none !important;
}

#omise-offline-payment-refresh-status:focus-visible,
.mahamu-save-qr:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.mahamu-promptpay-actions {
    max-width: 680px;
    margin: 0 auto 24px;
    padding: 0 22px 22px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-top: 0;
    border-radius: 0 0 var(--wp--custom--radius--control) var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--transaction);
    color: var(--wp--custom--color--text--primary);
    text-align: center;
}

.mahamu-save-qr.wp-element-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
    text-decoration: none;
    font-weight: 500;
    box-shadow: none;
}

.mahamu-promptpay-instructions {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--wp--custom--color--border--subtle);
    text-align: left;
}

.mahamu-promptpay-instructions ol {
    margin: 10px 0 0 1.3em;
}

.mahamu-promptpay-instructions li {
    margin: 6px 0;
    line-height: 1.5;
}

.mahamu-payment-note {
    margin-top: 12px !important;
    color: var(--wp--custom--color--text--secondary);
    font-size: 13px;
}

#omise-offline-payment-refresh-status {
    min-height: var(--wp--custom--size--tap-target-min);
    padding: 9px 14px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: transparent;
    color: var(--wp--custom--color--action--primary);
    font: inherit;
}

#omise-offline-payment-result {
    max-width: 680px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--editorial);
    color: var(--wp--custom--color--text--primary);
    text-align: center;
}

.mahamu-promptpay-retry {
    max-width: 680px;
    margin: 24px auto !important;
    padding: 20px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--editorial);
    text-align: center;
}

.mahamu-promptpay-retry .button,
.mahamu-promptpay-retry .wp-element-button {
    min-height: 46px;
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
    box-shadow: none;
}

@media (max-width: 767px) {
    .mahamu-product-page .wp-block-columns.alignwide {
        gap: 20px;
    }

    .mahamu-product-buy-panel .wp-block-post-title {
        font-size: clamp(28px, 8vw, 36px);
    }

    .mahamu-product-buy-panel .variations_button {
        grid-template-columns: 104px minmax(0, 1fr) !important;
    }

    .mahamu-variation-chip {
        min-height: var(--wp--custom--size--control-min-height);
        padding-inline: 12px;
    }

    .mahamu-product-shipping-summary {
        margin-top: 16px;
        padding: 14px;
    }
}

@media (max-width: 390px) {
    .mahamu-product-buy-panel .variations_button {
        grid-template-columns: 96px minmax(0, 1fr) !important;
        gap: 8px;
    }

    .mahamu-product-buy-panel .variations_button .single_add_to_cart_button {
        padding-inline: 10px;
        font-size: 14px;
    }

    .mahamu-variation-chips {
        gap: 6px;
    }
}

@media (max-width: 600px) {
    .mahamu-cart-shipping-status,
    .mahamu-promptpay-state,
    .omise.mahamu-promptpay-details-enhanced,
    #omise-offline-payment-result,
    .mahamu-promptpay-retry {
        padding: 16px;
    }

    .mahamu-shipping-provider img {
        width: 64px;
    }
}

.mahamu-atc-feedback {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100000;
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--floating);
    background: var(--wp--custom--color--surface--editorial);
    color: var(--wp--custom--color--text--primary);
    font-family: var(--wp--custom--font--family--ui);
    box-shadow: var(--wp--custom--shadow--floating);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard), transform var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.mahamu-atc-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mahamu-atc-feedback.is-success {
    border-color: var(--wp--custom--color--state--success);
}

.mahamu-atc-feedback.is-error {
    border-color: var(--wp--custom--color--state--error);
}

.mahamu-atc-feedback__message {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.mahamu-atc-feedback__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.mahamu-atc-feedback__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--wp--custom--size--tap-target-min);
    padding: 9px 12px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    color: var(--wp--custom--color--action--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.mahamu-atc-feedback__actions a.is-primary {
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
}

.mahamu-atc-feedback__actions a:focus-visible,
.mahamu-atc-is-busy:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.mahamu-atc-is-busy {
    cursor: progress !important;
    pointer-events: auto;
}

.mahamu-atc-inline-error {
    margin: 0 0 10px;
    color: var(--wp--custom--color--state--error);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .mahamu-atc-feedback {
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
        left: 16px;
        width: auto;
    }
}

/* MAHAMU Cart Stage G: conversion and shipping clarity */
.woocommerce-cart .mahamu-cart-main {
    padding: 40px 16px 64px;
    background: var(--wp--custom--color--surface--transaction);
}

.woocommerce-cart .mahamu-cart-main > .wp-block-post-title {
    margin: 0 0 28px;
    color: var(--wp--custom--color--text--primary);
    font-family: var(--wp--custom--font--family--ui);
    font-weight: 600;
}

.woocommerce-cart .wc-block-cart__main,
.woocommerce-cart .wc-block-cart__sidebar {
    min-width: 0;
}

.woocommerce-cart .wc-block-components-quantity-selector {
    min-height: var(--wp--custom--size--control-min-height);
    border-color: var(--wp--custom--color--border--control);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--transaction);
}

.woocommerce-cart .wc-block-components-quantity-selector__button {
    min-width: var(--wp--custom--size--tap-target-min);
    min-height: var(--wp--custom--size--tap-target-min);
    color: var(--wp--custom--color--text--primary);
}

.woocommerce-cart .wc-block-components-quantity-selector__button:focus-visible,
.woocommerce-cart .wc-block-cart-item__remove-link:focus-visible,
.woocommerce-cart .wc-block-components-totals-coupon-link:focus-visible,
.woocommerce-cart .wc-block-cart__submit-button:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.woocommerce-cart .wc-block-cart-item__remove-link {
    min-height: var(--wp--custom--size--tap-target-min);
    padding: 8px 0;
    color: var(--wp--custom--color--text--secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.woocommerce-cart .wc-block-components-totals-coupon {
    margin-top: 8px;
}

.woocommerce-cart .wc-block-components-totals-coupon-link {
    color: var(--wp--custom--color--text--secondary);
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.woocommerce-cart .wc-block-components-totals-footer-item {
    padding-top: 18px;
    border-top: 1px solid var(--wp--custom--color--border--control);
    color: var(--wp--custom--color--text--primary);
    font-weight: 600;
}

.woocommerce-cart .wc-block-cart__submit-container {
    margin-top: 18px;
}

.woocommerce-cart .wc-block-cart__submit-button {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
    font-weight: 600;
    box-shadow: none;
}

.woocommerce-cart .wc-block-cart__submit-button:hover {
    border-color: var(--wp--custom--color--action--primary-hover);
    background: var(--wp--custom--color--action--primary-hover);
    color: var(--wp--custom--color--text--inverse);
}

.mahamu-shipping-progress-copy {
    margin-bottom: 10px !important;
}

.mahamu-shipping-progress {
    position: relative;
    width: 100%;
    height: 6px;
    margin: 10px 0 0;
    overflow: hidden;
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--border--subtle);
}

.mahamu-shipping-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--wp--custom--color--action--primary);
    transition: width var(--wp--custom--motion--duration-normal) var(--wp--custom--motion--ease-standard);
}

@media (max-width: 767px) {
    .woocommerce-cart .mahamu-cart-main {
        padding: 28px 16px 48px;
    }

    .woocommerce-cart .mahamu-cart-main > .wp-block-post-title {
        margin-bottom: 20px;
    }

    .woocommerce-cart .wc-block-cart__submit-button {
        min-height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mahamu-variation-chip,
    .mahamu-atc-feedback,
    .mahamu-shipping-progress > span {
        transition: none;
    }
}

/* Woo Blocks ATC: preserve native state; MAHAMU only adds checkout shortcut and tap guard. */
.wc-block-components-product-button .mahamu-atc-native-actions:not([hidden]) {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.wc-block-components-product-button .mahamu-atc-native-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--wp--custom--size--tap-target-min);
    padding: 8px 12px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    color: var(--wp--custom--color--action--primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.wc-block-components-product-button .mahamu-atc-native-actions .mahamu-atc-native-checkout {
    background: var(--wp--custom--color--action--primary);
    color: var(--wp--custom--color--text--inverse);
}

.wc-block-components-product-button .mahamu-atc-native-actions a:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.add_to_cart_button.wc-interactive.mahamu-atc-click-guard {
    cursor: progress;
    opacity: 0.82;
}

@media (max-width: 390px) {
    .wc-block-components-product-button .mahamu-atc-native-actions:not([hidden]) {
        display: flex;
        width: 100%;
    }

    .wc-block-components-product-button .mahamu-atc-native-actions a {
        flex: 1 1 0;
    }
}

.mahamu-cart-recovery {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    font-family: var(--wp--custom--font--family--ui);
}

.mahamu-cart-recovery__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--wp--custom--color--border--subtle);
    border-radius: var(--wp--custom--radius--control);
    background: var(--wp--custom--color--surface--editorial);
    color: var(--wp--custom--color--text--primary);
}

.mahamu-cart-recovery__item.is-error {
    border-color: var(--wp--custom--color--state--error);
}

.mahamu-cart-recovery__message {
    min-width: 0;
    line-height: 1.5;
}

.mahamu-cart-recovery__undo {
    flex: 0 0 auto;
    min-height: var(--wp--custom--size--tap-target-min);
    padding: 8px 12px;
    border: 1px solid var(--wp--custom--color--action--primary);
    border-radius: var(--wp--custom--radius--control);
    background: transparent;
    color: var(--wp--custom--color--action--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.mahamu-cart-recovery__undo:hover:not(:disabled) {
    background: var(--wp--custom--color--surface--canvas);
}

.mahamu-cart-recovery__undo:focus-visible {
    outline: 2px solid var(--wp--custom--color--accent--focus);
    outline-offset: 2px;
}

.mahamu-cart-recovery__undo:disabled {
    border-color: var(--wp--custom--color--border--control);
    color: var(--wp--custom--color--text--secondary);
    cursor: progress;
}

@media (max-width: 390px) {
    .mahamu-cart-recovery__item {
        align-items: stretch;
        flex-direction: column;
    }

    .mahamu-cart-recovery__undo {
        width: 100%;
        min-height: var(--wp--custom--size--control-min-height);
    }
}