/* MorgenCraft TR + EN mobile cart/checkout corrections. */

body.mcmco-cart-checkout a[href*="wa.me"],
body.mcmco-cart-checkout a[href*="api.whatsapp"],
body.mcmco-cart-checkout a[href*="whatsapp.com"],
body.mcmco-cart-checkout [class*="whatsapp" i],
body.mcmco-cart-checkout [id*="whatsapp" i],
body.mcmco-cart-checkout [class*="joinchat" i],
body.mcmco-cart-checkout [id*="joinchat" i] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* TR VAT stays in WooCommerce calculations; only the separate visual tax row is hidden. */
body.mcmco-cart-checkout.mcmco-lang-tr .woocommerce-cart-form tr.tax-rate,
body.mcmco-cart-checkout.mcmco-lang-tr .cart_totals tr.tax-rate,
body.mcmco-cart-checkout.mcmco-lang-tr .cart_totals tr.tax-total,
body.mcmco-cart-checkout.mcmco-lang-tr .woocommerce-checkout-review-order-table tr.tax-rate,
body.mcmco-cart-checkout.mcmco-lang-tr .woocommerce-checkout-review-order-table tr.tax-total,
body.mcmco-cart-checkout.mcmco-lang-tr .wc-block-components-totals-taxes {
    display: none !important;
}

body.mcmco-cart-checkout .mcmco-hidden-duplicate,
body.mcmco-cart-checkout .mcmco-hidden-gateway {
    display: none !important;
}

body.mcmco-cart-checkout .woocommerce-privacy-policy-text,
body.mcmco-cart-checkout .wc-block-checkout__terms {
    margin: 12px 0 !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
}

body.mcmco-cart-checkout .woocommerce form .form-row {
    margin-bottom: 12px;
}

body.mcmco-cart-checkout .woocommerce form .form-row label {
    margin-bottom: 4px;
    font-weight: 600;
}

body.mcmco-cart-checkout .woocommerce form .form-row input.input-text,
body.mcmco-cart-checkout .woocommerce form .form-row textarea,
body.mcmco-cart-checkout .woocommerce form .form-row select,
body.mcmco-cart-checkout .select2-container .select2-selection--single {
    min-height: 44px;
    border-radius: 8px;
}

body.mcmco-cart-checkout .woocommerce-checkout-review-order,
body.mcmco-cart-checkout .cart_totals,
body.mcmco-cart-checkout .wc-block-components-sidebar,
body.mcmco-cart-checkout #payment,
body.mcmco-cart-checkout .woocommerce-checkout-payment {
    border-radius: 12px;
}

body.mcmco-cart-checkout #place_order,
body.mcmco-cart-checkout .wc-block-components-checkout-place-order-button {
    width: 100%;
    min-height: 50px;
    border-radius: 9px;
    font-weight: 700;
}

@media (max-width: 767px) {
    /* Stable mobile header layout. */
    body.mcmco-cart-checkout .site-mobile-header-wrap,
    body.mcmco-cart-checkout .site-mobile-header-wrap .site-header-row,
    body.mcmco-cart-checkout .site-mobile-header-wrap .site-header-row-container-inner {
        min-height: 58px !important;
        max-height: 64px !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .site-header-row {
        position: relative !important;
        align-items: center !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .site-header-section,
    body.mcmco-cart-checkout .site-mobile-header-wrap .site-header-item {
        align-items: center !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .mc-mobile-icons {
        position: absolute !important;
        right: 12px !important;
        left: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 30 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 7px !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .mc-mobile-cart,
    body.mcmco-cart-checkout .site-mobile-header-wrap .mc-mobile-account {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 1 !important;
        border-radius: 50% !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .mc-mobile-cart svg,
    body.mcmco-cart-checkout .site-mobile-header-wrap .mc-mobile-account svg {
        width: 21px !important;
        height: 21px !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap:has(.mc-mobile-icons) .header-cart-wrap,
    body.mcmco-cart-checkout .site-mobile-header-wrap:has(.mc-mobile-icons) .header-account-wrap,
    body.mcmco-cart-checkout .site-mobile-header-wrap:has(.mc-mobile-icons) .site-header-cart,
    body.mcmco-cart-checkout .site-mobile-header-wrap:has(.mc-mobile-icons) .site-header-account {
        display: none !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .mobile-toggle-open-container,
    body.mcmco-cart-checkout .site-mobile-header-wrap .menu-toggle-open {
        position: absolute !important;
        left: 10px !important;
        right: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 30 !important;
        margin: 0 !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .site-branding,
    body.mcmco-cart-checkout .site-mobile-header-wrap .site-branding a,
    body.mcmco-cart-checkout .site-mobile-header-wrap .site-brand-logo-wrap {
        max-height: 48px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    body.mcmco-cart-checkout .site-mobile-header-wrap .site-branding img,
    body.mcmco-cart-checkout .site-mobile-header-wrap .custom-logo {
        max-height: 44px !important;
        width: auto !important;
    }

    body.mcmco-cart-checkout .content-area,
    body.mcmco-cart-checkout .site-main,
    body.mcmco-cart-checkout .entry-content-wrap {
        margin-top: 0 !important;
        padding-top: 8px !important;
    }

    body.mcmco-cart-checkout .woocommerce-billing-fields > h3,
    body.mcmco-cart-checkout #order_review_heading,
    body.mcmco-cart-checkout .cart_totals > h2 {
        margin-top: 12px !important;
        margin-bottom: 12px !important;
        font-size: 22px !important;
    }

    body.mcmco-cart-checkout .woocommerce-checkout-review-order-table th,
    body.mcmco-cart-checkout .woocommerce-checkout-review-order-table td,
    body.mcmco-cart-checkout .shop_table th,
    body.mcmco-cart-checkout .shop_table td {
        padding: 10px 7px !important;
    }

    body.mcmco-cart-checkout #payment ul.payment_methods,
    body.mcmco-cart-checkout #payment .place-order,
    body.mcmco-cart-checkout .woocommerce-checkout-payment ul.payment_methods {
        padding: 14px !important;
    }

    body.mcmco-cart-checkout .woocommerce .col2-set .col-1,
    body.mcmco-cart-checkout .woocommerce .col2-set .col-2,
    body.mcmco-cart-checkout .woocommerce-page .col2-set .col-1,
    body.mcmco-cart-checkout .woocommerce-page .col2-set .col-2 {
        float: none !important;
        width: 100% !important;
    }

    body.mcmco-cart-checkout .wc-block-checkout,
    body.mcmco-cart-checkout .wc-block-cart {
        margin-top: 0 !important;
    }

    /* Woo message buttons must not float over the message text. */
    body.mcmco-cart-checkout .woocommerce-message .button,
    body.mcmco-cart-checkout .woocommerce-info .button {
        float: none !important;
        display: block !important;
        width: 100% !important;
        margin: 0 0 10px !important;
        box-sizing: border-box !important;
    }

    /* Coupon and Update cart are independent rows in TR and EN. */
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 12px 7px !important;
        box-sizing: border-box !important;
    }

    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon {
        float: none !important;
        clear: both !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(118px, 0.82fr) !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        box-sizing: border-box !important;
    }

    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon::before,
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon::after {
        display: none !important;
        content: none !important;
    }

    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon .input-text,
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon input[name="coupon_code"] {
        float: none !important;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }

    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon button,
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon .button {
        float: none !important;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        box-sizing: border-box !important;
    }

    body.mcmco-cart-checkout .woocommerce-cart-form td.actions > button[name="update_cart"],
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions > input[name="update_cart"],
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions > .button[name="update_cart"] {
        float: none !important;
        clear: both !important;
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 380px) {
    body.mcmco-cart-checkout .woocommerce-cart-form td.actions .coupon {
        grid-template-columns: 1fr !important;
    }
}
