/*
 * Miner House — Cart & Checkout Styles
 * Loaded only on WooCommerce cart/checkout pages from child theme.
 */

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-order-received {
    --mh-primary: #0a1a33;
    --mh-accent: #1a6fe0;
    --mh-success: #1a8a3c;
    --mh-surface: #ffffff;
    --mh-surface-alt: #f8f9fb;
    --mh-border: #e2e6ea;
    --mh-text: #1a1a2e;
    --mh-text-muted: #6b7280;
    --mh-radius: 8px;
    --mh-shadow-sm: 0 1px 4px rgba(0,0,0,.08);
}

/* Clean extra spacing caused by mixed Elementor + shortcode content */
.woocommerce-cart .entry-content > p:empty,
.woocommerce-cart .entry-content > br,
.woocommerce-checkout .entry-content > p:empty,
.woocommerce-checkout .entry-content > br {
    display: none;
}

/* Cart table card */
.woocommerce-cart .woocommerce-cart-form {
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--mh-shadow-sm);
}

.woocommerce-cart table.shop_table {
    border: 0;
    margin: 0;
}

.woocommerce-cart table.shop_table th,
.woocommerce-cart table.shop_table td {
    border-color: var(--mh-border);
    vertical-align: middle;
}

.woocommerce-cart .product-name a {
    color: var(--mh-primary);
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-cart .product-thumbnail img {
    border-radius: 6px;
    border: 1px solid var(--mh-border);
}

/* Quantity field */
.woocommerce-cart .quantity .qty {
    width: 78px;
    min-height: 38px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    text-align: center;
}

/* Coupon + update actions */
.woocommerce-cart .actions .coupon .input-text,
.woocommerce-cart .actions .coupon input[type="text"] {
    min-height: 40px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    padding: 0 10px;
}

.woocommerce-cart .actions .button,
.woocommerce-cart .button,
.woocommerce-checkout .button,
.woocommerce-checkout button.button,
.woocommerce-checkout #payment #place_order {
    border-radius: 6px;
    font-weight: 700;
}

.woocommerce-cart .actions .coupon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.woocommerce-cart .actions .button[name="update_cart"] {
    display: none;
}

.woocommerce-cart a.checkout-button.button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout #payment #place_order {
    background: var(--mh-primary) !important;
    color: #fff !important;
    border: 0;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.woocommerce-cart a.checkout-button.button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-checkout #payment #place_order:hover {
    background: var(--mh-accent) !important;
}

/* Cart totals box */
.woocommerce-cart .cart-collaterals .cart_totals {
    background: var(--mh-surface);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 18px;
    box-shadow: var(--mh-shadow-sm);
    max-width: none;
    width: 100%;
}

.woocommerce-cart .cart-collaterals {
    display: block;
    margin-top: 14px;
}

.woocommerce-cart .cart_totals h2 {
    font-size: 1.2rem;
    color: var(--mh-primary);
    margin: 0 0 20px;
}

.woocommerce-cart .cart_totals .shop_table th {
    width: 36%;
    color: var(--mh-primary);
    font-weight: 700;
}

.woocommerce-cart .cart_totals .shop_table td,
.woocommerce-cart .cart_totals .shop_table th {
    padding: 12px 8px;
}

.woocommerce-cart .cart_totals .shop_table {
    background: var(--mh-surface-alt);
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.woocommerce-cart .woocommerce-shipping-methods {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.woocommerce-cart .woocommerce-shipping-methods li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #fff;
}

.woocommerce-cart .woocommerce-shipping-methods label {
    margin: 0;
    color: var(--mh-text);
    line-height: 1.45;
}

.woocommerce-cart .woocommerce-shipping-destination {
    margin: 10px 0 8px;
    color: var(--mh-text-muted);
    font-size: 0.92rem;
}

.woocommerce-cart .shipping-calculator-button {
    display: inline-block;
    font-weight: 600;
    color: var(--mh-accent);
    text-decoration: none;
}

.woocommerce-cart .mh-pickup-map-link,
.woocommerce-checkout .mh-pickup-map-link {
    display: inline-block;
    margin-left: 6px;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--mh-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.woocommerce-cart .mh-pickup-map-link:hover,
.woocommerce-checkout .mh-pickup-map-link:hover {
    text-decoration: none;
    opacity: 0.82;
}

.woocommerce-cart .shipping-calculator-button:hover {
    text-decoration: underline;
}

.woocommerce-cart .shipping-calculator-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--mh-border);
}

.woocommerce-cart .shipping-calculator-form .form-row {
    margin-bottom: 10px;
}

.woocommerce-cart .shipping-calculator-form .form-row label {
    margin-bottom: 6px;
    display: block;
    color: var(--mh-primary);
    font-weight: 600;
}

.woocommerce-cart .shipping-calculator-form .input-text,
.woocommerce-cart .shipping-calculator-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    padding: 0 10px;
    background: #fff;
}

.woocommerce-cart .wc-proceed-to-checkout p {
    margin: 0;
}

.woocommerce-cart .wc-proceed-to-checkout {
    margin-top: 10px;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    width: 100%;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button br {
    display: none;
}

.woocommerce-cart .order-total th,
.woocommerce-cart .order-total td {
    font-size: 1.06rem;
    font-weight: 700;
}

.woocommerce-cart .order-total td .amount {
    color: var(--mh-primary);
}

.woocommerce-cart .mh-cart-help-box {
    margin: 0 0 16px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #f8fbff;
    padding: 12px 14px;
}

.woocommerce-cart .mh-cart-help-box__title {
    color: var(--mh-primary);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.woocommerce-cart .mh-cart-help-box__phone {
    display: inline-block;
    margin-left: 6px;
    color: var(--mh-accent);
    text-decoration: none;
    white-space: nowrap;
}

.woocommerce-cart .mh-cart-help-box__phone:hover {
    text-decoration: underline;
}

.woocommerce-cart .mh-cart-help-box__text {
    margin: 0 0 8px;
    color: var(--mh-text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.woocommerce-cart .mh-cart-help-box__list {
    margin: 0;
    padding-left: 16px;
    color: var(--mh-text);
    font-size: 0.86rem;
    line-height: 1.5;
}

.woocommerce-cart .mh-cart-help-box__list li {
    margin-bottom: 4px;
}

@keyframes mh-card-select {
    0%   { box-shadow: 0 0 0 5px rgba(26,111,224,0.35), 0 0 0 rgba(26,111,224,0); }
    55%  { box-shadow: 0 0 0 2px rgba(26,111,224,0.12), 0 4px 16px rgba(26,111,224,0.14); }
    100% { box-shadow: 0 6px 22px rgba(26,111,224,0.18), 0 0 0 rgba(26,111,224,0); }
}

/* Cart: Mining Setup Calculator */
.mh-mining-mode-box {
    margin: 0 0 16px;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    background: #fff;
    padding: 20px;
}

.mh-mmb-header { margin-bottom: 16px; }

.mh-mmb-title {
    margin: 0 0 4px;
    color: var(--mh-primary);
    font-size: 1rem;
    font-weight: 700;
}

.mh-mmb-based-on {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    background: #f0f6ff;
    border-left: 3px solid var(--mh-accent);
    border-radius: 0 5px 5px 0;
    padding: 8px 12px;
    margin: 0;
    line-height: 1.4;
}

.mh-mmb-based-on__label {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--mh-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.mh-mmb-based-on__items {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--mh-primary);
}

.mh-mmb-based-on__watts {
    font-size: 0.8rem;
    color: var(--mh-text-muted);
    white-space: nowrap;
}

.mh-mmb-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.mh-mmb-card {
    border: 1.5px solid #e2e6ea;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    background-color: #ffffff;
    box-shadow: 0 0 0 rgba(26, 111, 224, 0);
    transform: translateY(0);
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.mh-mmb-card:hover { border-color: #b0c8f0; }

.mh-mmb-card.is-selected {
    border-color: var(--mh-accent);
    background-color: #e8f2ff;
    box-shadow: 0 6px 22px rgba(26, 111, 224, 0.18);
    transform: translateY(-4px);
    animation: mh-card-select 0.45s ease-out;
}

.mh-mmb-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mh-mmb-card__head svg {
    width: 18px;
    height: 18px;
    color: var(--mh-accent);
    flex-shrink: 0;
}

.mh-mmb-card__name {
    font-weight: 700;
    color: var(--mh-primary);
    font-size: 0.95rem;
}

.mh-mmb-card__save {
    margin-left: auto;
    background: #e6f6eb;
    color: #1a8a3c;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.mh-mmb-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mh-mmb-list li {
    padding-left: 18px;
    position: relative;
    line-height: 1.35;
    color: var(--mh-text);
}

.mh-mmb-list--pro li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #1a8a3c;
    font-weight: 700;
}

.mh-mmb-list--con li::before {
    content: '\2717';
    position: absolute;
    left: 0;
    color: #b91c1c;
    font-weight: 700;
}

.mh-mmb-list--con li { color: var(--mh-text-muted); }

.mh-mmb-card__nums {
    border-top: 1px solid #eef2f7;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.mh-mmb-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.83rem;
}

.mh-mmb-card__row > span {
    color: var(--mh-text-muted);
    font-weight: 500;
}

.mh-mmb-card__row > strong {
    color: var(--mh-primary);
    font-weight: 700;
}

.mh-mmb-card__net {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f7fa;
    border-radius: 6px;
    padding: 7px 10px;
    margin-top: 2px;
}

.mh-mmb-card__net > span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mh-text-muted);
}

.mh-mmb-card__net .is-positive {
    font-size: 1rem;
    font-weight: 700;
    color: #1a8a3c;
}

.mh-mmb-card__net .is-negative {
    font-size: 1rem;
    font-weight: 700;
    color: #b91c1c;
}

.mh-mmb-card__btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1.5px solid var(--mh-accent);
    background: #fff;
    color: var(--mh-accent);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.mh-mmb-card__btn:hover,
.mh-mmb-card.is-selected .mh-mmb-card__btn {
    background: var(--mh-accent);
    color: #fff;
}

.mh-mmb-card__btn--primary {
    background: var(--mh-accent);
    color: #fff;
}

.mh-mmb-card__btn--primary:hover { background: #155dc8; }

.mh-mining-mode-note {
    margin: 0;
    color: var(--mh-text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* Checkout summary of selected setup - collapsible */
.woocommerce-checkout .mh-checkout-mode-summary {
    margin: 0 0 12px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #f8fbff;
    color: var(--mh-text);
    font-size: 0.9rem;
    overflow: hidden;
}

.woocommerce-checkout .mh-cms-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
    gap: 8px;
}

.woocommerce-checkout .mh-cms-toggle:hover { background: #eef5ff; }

.woocommerce-checkout .mh-cms-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.woocommerce-checkout .mh-cms-info strong {
    color: var(--mh-primary);
    font-weight: 700;
}

.woocommerce-checkout .mh-cms-mode-name {
    color: var(--mh-accent);
    font-weight: 600;
}

.woocommerce-checkout .mh-cms-change-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    color: var(--mh-accent);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.woocommerce-checkout .mh-cms-chevron {
    transition: transform 0.22s ease;
}

.woocommerce-checkout .mh-cms-toggle.is-open .mh-cms-chevron {
    transform: rotate(180deg);
}

.woocommerce-checkout .mh-cms-panel {
    padding: 0;
    border-top: 1px solid var(--mh-border);
}

.woocommerce-checkout .mh-cms-panel[hidden] { display: none; }

.woocommerce-checkout .mh-cms-panel .mh-mining-mode-box {
    margin: 0;
    border: none;
    border-radius: 0;
    background: #fff;
    padding: 20px;
}

/* Notices */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    border-radius: 6px;
    border: 1px solid var(--mh-border);
}

/* Make the custom Elementor promo section look intentional */
.woocommerce-cart .elementor-section.elementor-inner-section {
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    background: var(--mh-surface-alt);
    padding: 12px;
    margin-bottom: 16px;
}

.woocommerce-cart .elementor-widget-text-editor h3 {
    color: var(--mh-primary);
    margin-bottom: 10px;
}

.woocommerce-cart .elementor-widget-text-editor p {
    color: var(--mh-text);
    line-height: 1.6;
}

.woocommerce-cart .elementor-widget-button .elementor-button {
    background: var(--mh-primary);
    border-radius: 6px;
    font-weight: 700;
}

.woocommerce-cart .elementor-widget-button .elementor-button:hover {
    background: var(--mh-accent);
}

/* Requested: remove extra margin from this cart Elementor section */
.woocommerce-cart .elementor-element-49b036a {
    margin: 0 !important;
}


/* =============================================================================
   Checkout page polish (same visual system as cart)
   ============================================================================= */

/* Error messages container */
.woocommerce-checkout .mh-checkout-errors-top {
    width: 100%;
    margin-bottom: 20px;
}

.woocommerce-checkout .mh-checkout-errors-top > div {
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    color: #c62828;
    font-weight: 500;
}

/* Single-column stacked layout: YOUR ORDER on top, billing below */
.woocommerce-checkout form.checkout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    align-items: stretch !important;
}

.woocommerce-checkout form.checkout > * {
    float: none !important;
    width: 100% !important;
    clear: none !important;
    grid-column: unset !important;
    grid-row: unset !important;
    box-sizing: border-box;
}

/* YOUR ORDER heading + table grouped at top */
.woocommerce-checkout #order_review_heading {
    order: 1;
    margin: 0 0 6px;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff !important;
    background: var(--mh-primary) !important;
    border: 2px solid var(--mh-primary) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-checkout #order_review {
    order: 2;
    padding: 0;
    margin-bottom: 20px;
    border: 2px solid var(--mh-primary) !important;
    border-radius: 8px !important;
    background: #ffffff;
    box-shadow: none;
}

/* Billing & Shipping card below */
.woocommerce-checkout #customer_details {
    order: 3;
    padding: 20px;
    background: var(--mh-surface);
    border: 1px solid var(--mh-border) !important;
    border-radius: var(--mh-radius) !important;
    box-shadow: var(--mh-shadow-sm);
    margin-bottom: 20px;
}

.woocommerce-checkout #order_review table.shop_table th {
    background: var(--mh-primary);
    color: #ffffff;
    font-weight: 700;
}

.woocommerce-checkout #order_review table.shop_table td {
    color: var(--mh-text);
    font-weight: 500;
}

.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-checkout form.checkout_coupon {
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--mh-shadow-sm);
}

.woocommerce-checkout form.checkout_coupon {
    padding: 12px;
    margin: 10px 0 14px;
}

.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    width: 100% !important;
    float: none !important;
}

/* 3-column grid for billing fields - wide horizontal layout */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 16px;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-wide,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-wide {
    grid-column: 1 / -1;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-span2,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-span2 {
    grid-column: span 2;
}

/* Override WooCommerce float fallbacks */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-third,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-first,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-last,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-third {
    float: none !important;
    width: auto !important;
    clear: none !important;
    margin-right: 0 !important;
}

.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
    color: var(--mh-primary);
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.woocommerce-checkout .form-row {
    margin-bottom: 12px;
}

.woocommerce-checkout .form-row label {
    color: var(--mh-primary);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.woocommerce-checkout input.input-text,
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.woocommerce-checkout .select2-container .select2-selection--single {
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    min-height: 40px;
    background: #fff;
}

.woocommerce-checkout .select2-container .select2-selection--single {
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.woocommerce-checkout table.shop_table {
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    overflow: hidden;
}

.woocommerce-checkout table.shop_table {
    width: 100%;
}

.woocommerce-checkout table.shop_table th {
    background: var(--mh-primary);
    color: #ffffff;
    font-weight: 700;
    border-color: var(--mh-primary);
    padding: 10px 8px;
    text-align: left;
}

.woocommerce-checkout table.shop_table td {
    border-color: var(--mh-primary);
    padding: 10px 8px;
    font-weight: 500;
    color: var(--mh-text);
    background: #ffffff;
}

.woocommerce-checkout table.shop_table tbody tr:first-child td {
    color: var(--mh-text);
}

.woocommerce-checkout table.shop_table .product-name,
.woocommerce-checkout table.shop_table .product-total {
    color: var(--mh-text);
    font-weight: 600;
}

.woocommerce-checkout .mh-checkout-product-link {
    color: var(--mh-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.woocommerce-checkout .mh-checkout-product-link:hover {
    color: var(--mh-accent);
    text-decoration: underline;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--mh-border);
}

.woocommerce-checkout .woocommerce-privacy-policy-text {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--mh-text-muted);
}

.woocommerce-checkout #payment {
    margin-top: 20px;
    border: 1px solid var(--mh-border);
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
}

.woocommerce-checkout #payment ul.payment_methods {
    border-bottom: 1px solid var(--mh-border);
    padding-bottom: 12px;
    margin: 0;
}

.woocommerce-checkout #payment ul.payment_methods li {
    margin-bottom: 0 !important;
}

.woocommerce-checkout #payment ul.payment_methods li label {
    font-weight: 700;
    color: var(--mh-primary);
    margin: 0;
}

.woocommerce-checkout #payment div.payment_box {
    background: #fff;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--mh-text);
}

/* Override WooCommerce core: remove grey background from payment form-row (Place order area) */
#add_payment_method #payment div.form-row,
.woocommerce-cart #payment div.form-row,
.woocommerce-checkout #payment div.form-row {
    background: transparent !important;
    padding: 16px 0 0;
}

/* Hide inline per-field error texts — errors are shown at top of form instead */
.woocommerce-checkout .woocommerce-input-wrapper .description,
.woocommerce-checkout .form-row .woocommerce-error,
.woocommerce-checkout .validate-required.woocommerce-invalid > label .optional,
.woocommerce-checkout span.woocommerce-input-wrapper + .description {
    display: none !important;
}

/* Hide inline field-level error message paragraphs rendered below each input */
.woocommerce-checkout .form-row p.woocommerce-invalid-required-field,
.woocommerce-checkout .checkout-inline-error-message {
    display: none !important;
}

.woocommerce-checkout #payment #place_order {
    width: 100%;
}

/* =============================================================================
   Thank you / order received page polish
   ============================================================================= */

body.woocommerce-order-received .woocommerce-order {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

body.woocommerce-order-received .woocommerce-notice--success.woocommerce-thankyou-order-received {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #cde9d6;
    border-left: 4px solid var(--mh-success);
    border-radius: var(--mh-radius);
    background: #effaf2;
    color: #1d6a33;
    font-size: 0.98rem;
    line-height: 1.5;
    box-shadow: var(--mh-shadow-sm);
}

body.woocommerce-order-received .woocommerce-order-overview.order_details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    border: 0;
}

/* Parent themes often inject clearfix pseudo-elements on order_details.
   In grid layout they become extra (empty) grid items and create a ghost first card. */
body.woocommerce-order-received .woocommerce-order-overview.order_details::before,
body.woocommerce-order-received .woocommerce-order-overview.order_details::after {
    content: none !important;
    display: none !important;
}

body.woocommerce-order-received .woocommerce-order-overview.order_details li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    float: none !important;
    width: auto !important;
    clear: none !important;
    margin: 0;
    padding: 12px;
    border: 1px solid #e2e6ea !important;
    border-radius: 6px;
    background: #ffffff !important;
    color: #6b7280;
    text-transform: none;
    font-size: 0.82rem;
    line-height: 1.35;
}

/* Nuclear override: first card (Order number) sometimes hidden by parent theme */
body.woocommerce-order-received .woocommerce-order-overview.order_details li.woocommerce-order-overview__order,
body.woocommerce-order-received .woocommerce-order-overview.order_details li:first-child {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #ffffff !important;
    border: 1px solid #e2e6ea !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
}

body.woocommerce-order-received .woocommerce-order-overview.order_details li strong {
    display: block;
    margin-top: 6px;
    color: var(--mh-primary);
    font-size: 0.98rem;
    font-weight: 700;
}

body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details {
    background: #fff;
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    box-shadow: var(--mh-shadow-sm);
    padding: 16px;
    margin: 0 !important;
}

body.woocommerce-order-received .woocommerce-order-details__title,
body.woocommerce-order-received .woocommerce-column__title {
    margin: 0 0 12px;
    color: var(--mh-primary);
    font-size: 1.06rem;
    font-weight: 700;
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table {
    width: 100%;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table thead th {
    background: var(--mh-primary);
    color: #fff;
    border-color: var(--mh-primary);
    font-weight: 700;
    padding: 10px 8px;
    text-align: left;
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table td {
    border: 0;
    border-top: 1px solid #e2e6ea;
    color: #1a1a2e;
    background: #fff;
    padding: 10px 8px;
    font-weight: 500;
    vertical-align: middle;
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table thead th + th,
body.woocommerce-order-received .woocommerce-table--order-details.shop_table tbody td + td,
body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot td {
    border-left: 1px solid #e2e6ea;
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot tr {
    border-top: 1px solid var(--mh-border);
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot th {
    background: var(--mh-surface-alt);
    color: var(--mh-text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 9px 8px;
    text-align: left;
    width: 38%;
    border-color: var(--mh-border);
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot td {
    font-size: 0.9rem;
    padding: 9px 8px;
    background: #fff;
    color: var(--mh-text);
}

body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot .order-total th,
body.woocommerce-order-received .woocommerce-table--order-details.shop_table tfoot .order-total td {
    font-weight: 700;
    color: var(--mh-primary);
    font-size: 0.98rem;
    border-top: 2px solid var(--mh-border);
}

body.woocommerce-order-received .woocommerce-table--order-details .product-name a {
    color: var(--mh-primary);
    font-weight: 600;
    text-decoration: none;
}

body.woocommerce-order-received .woocommerce-table--order-details .product-name a:hover {
    color: var(--mh-accent);
    text-decoration: underline;
}

body.woocommerce-order-received .woocommerce-customer-details address {
    margin: 0;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #f8fbff;
    padding: 12px;
    color: var(--mh-text);
    line-height: 1.65;
}

body.woocommerce-order-received .woocommerce-customer-details--phone,
body.woocommerce-order-received .woocommerce-customer-details--email {
    margin: 8px 0 0;
    color: var(--mh-primary);
    font-weight: 600;
}

body.woocommerce-order-received .mh-thankyou-next-steps {
    margin-top: 14px;
    border: 1px solid var(--mh-border);
    border-radius: 6px;
    background: #f8fbff;
    padding: 14px;
}

body.woocommerce-order-received .mh-thankyou-next-steps h3 {
    margin: 0 0 8px;
    color: var(--mh-primary);
    font-size: 1rem;
    font-weight: 700;
}

body.woocommerce-order-received .mh-thankyou-next-steps ul {
    margin: 0;
    padding-left: 18px;
    color: var(--mh-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

body.woocommerce-order-received .mh-thankyou-next-steps li {
    margin-bottom: 6px;
}

body.woocommerce-order-received .mh-thankyou-next-steps__actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.woocommerce-order-received .mh-thankyou-next-steps__actions .button {
    border-radius: 6px;
    font-weight: 700;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: var(--mh-primary);
    color: #fff;
    border: 0;
    text-decoration: none;
}

body.woocommerce-order-received .mh-thankyou-next-steps__actions .button.alt {
    background: #fff;
    color: var(--mh-primary);
    border: 1px solid var(--mh-border);
}

body.woocommerce-order-received .mh-thankyou-next-steps__actions .button:hover {
    background: var(--mh-accent);
    color: #fff;
}

body.woocommerce-order-received .mh-thankyou-next-steps__actions .button.alt:hover {
    border-color: var(--mh-accent);
}

@media screen and (max-width: 768px) {
    .woocommerce-cart .woocommerce-cart-form,
    .woocommerce-cart .cart-collaterals .cart_totals {
        padding: 12px;
    }

    .woocommerce-cart .cart-collaterals {
        justify-content: stretch;
    }

    .woocommerce-cart .cart-collaterals .cart_totals {
        max-width: none;
    }

    .woocommerce-cart .woocommerce-shipping-methods {
        grid-template-columns: 1fr;
    }

    .woocommerce-cart table.shop_table_responsive tr td {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .woocommerce-cart .actions .coupon {
        width: 100%;
        margin-bottom: 10px;
    }

    .woocommerce-cart .actions .coupon .input-text {
        width: 100%;
        margin: 0 0 8px;
    }

    .mh-mmb-cards {
        grid-template-columns: 1fr;
    }

    .woocommerce-checkout form.checkout {
        grid-template-columns: 1fr !important;
    }

    .woocommerce-checkout #customer_details,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        grid-column: auto;
        grid-row: auto;
    }

    .woocommerce-checkout #customer_details,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.woocommerce-order-received .woocommerce-order-overview.order_details {
        grid-template-columns: 1fr;
    }

    body.woocommerce-order-received .woocommerce-order-details,
    body.woocommerce-order-received .woocommerce-customer-details {
        padding: 12px;
    }

    body.woocommerce-order-received .mh-thankyou-next-steps__actions .button {
        width: 100%;
    }
}
