/* Keep WooCommerce pages inside the visual rhythm of the current theme. */
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
body.woocommerce-account .woocommerce {
    box-sizing: border-box;
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto !important;
    margin-top: 36px !important;
    margin-bottom: 64px !important;
}

/* Prevent notices from sticking to viewport edges. */
body.woocommerce-cart .woocommerce-notices-wrapper,
body.woocommerce-checkout .woocommerce-notices-wrapper,
body.woocommerce-account .woocommerce-notices-wrapper,
body.woocommerce-cart .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-components-notice-banner,
body.woocommerce-account .wc-block-components-notice-banner {
    box-sizing: border-box;
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto !important;
    border-radius: 12px;
}

/* Inputs and buttons should feel consistent and not touch card edges. */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-combobox-control input,
body.woocommerce-account .woocommerce input.input-text {
    min-height: 48px;
    border-radius: 10px !important;
}

body.woocommerce-cart .wc-block-components-button,
body.woocommerce-checkout .wc-block-components-button,
body.woocommerce-account .woocommerce button.button,
body.woocommerce-account .woocommerce a.button {
    min-height: 48px;
    border-radius: 10px !important;
}

/* Give checkout/cart sidebars breathing room. */
body.woocommerce-cart .wc-block-cart__sidebar,
body.woocommerce-checkout .wc-block-checkout__sidebar {
    border-radius: 16px;
    overflow: hidden;
}

body.woocommerce-checkout .wc-block-components-radio-control__option {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 16px !important;
    margin-bottom: 12px;
}

body.woocommerce-checkout .abrha-wcf-payment-description {
    margin-top: 8px;
    line-height: 1.9;
}

/* Login/Register page: keep forms readable instead of full-bleed. */
body.woocommerce-account .u-columns.col2-set {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

body.woocommerce-account .u-columns.col2-set .u-column1,
body.woocommerce-account .u-columns.col2-set .u-column2 {
    float: none !important;
    width: auto !important;
}

body.woocommerce-account form.login,
body.woocommerce-account form.register {
    padding: 24px !important;
    border-radius: 16px !important;
}

/* Checkout Block needs country internally for locale resolution.
   Keep its value in state while removing the visible selector. */
body.woocommerce-checkout .wc-block-components-address-form__country {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 767px) {
    body.woocommerce-cart .wp-block-woocommerce-cart,
    body.woocommerce-checkout .wp-block-woocommerce-checkout,
    body.woocommerce-account .woocommerce,
    body.woocommerce-cart .woocommerce-notices-wrapper,
    body.woocommerce-checkout .woocommerce-notices-wrapper,
    body.woocommerce-account .woocommerce-notices-wrapper,
    body.woocommerce-cart .wc-block-components-notice-banner,
    body.woocommerce-checkout .wc-block-components-notice-banner,
    body.woocommerce-account .wc-block-components-notice-banner {
        width: min(100% - 24px, 1180px);
    }

    body.woocommerce-cart .wp-block-woocommerce-cart,
    body.woocommerce-checkout .wp-block-woocommerce-checkout,
    body.woocommerce-account .woocommerce {
        margin-top: 24px !important;
        margin-bottom: 40px !important;
    }

    body.woocommerce-account .u-columns.col2-set {
        grid-template-columns: 1fr;
    }
}

/* Order received / thank-you page */
body.woocommerce-order-received .woocommerce {
    box-sizing: border-box;
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto !important;
    margin-top: 36px !important;
    margin-bottom: 64px !important;
}

body.woocommerce-order-received .woocommerce-order {
    display: grid;
    gap: 24px;
}

body.woocommerce-order-received .woocommerce-thankyou-order-received {
    margin: 0 !important;
    padding: 20px 24px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    background: #fff;
    font-size: 16px;
    line-height: 1.9;
}

body.woocommerce-order-received .woocommerce-order-overview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

body.woocommerce-order-received .woocommerce-order-overview li {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 18px 20px !important;
    border-inline-end: 1px solid rgba(15, 23, 42, 0.10);
    border-bottom: 0 !important;
    line-height: 1.8;
}

body.woocommerce-order-received .woocommerce-order-overview li:last-child {
    border-inline-end: 0;
}

body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details {
    margin: 0 !important;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    background: #fff;
}

body.woocommerce-order-received .woocommerce-order-details__title,
body.woocommerce-order-received .woocommerce-customer-details > h2 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
}

body.woocommerce-order-received table.woocommerce-table {
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
    border-radius: 12px;
    overflow: hidden;
}

body.woocommerce-order-received table.woocommerce-table th,
body.woocommerce-order-received table.woocommerce-table td {
    padding: 14px 16px !important;
}

body.woocommerce-order-received .woocommerce-customer-details address {
    margin: 0 !important;
    padding: 18px 20px !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
    border-radius: 12px !important;
    line-height: 2;
}

@media (max-width: 991px) {
    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.woocommerce-order-received .woocommerce-order-overview li {
        border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
    }
}

@media (max-width: 767px) {
    body.woocommerce-order-received .woocommerce {
        width: min(100% - 24px, 1180px);
        margin-top: 24px !important;
        margin-bottom: 40px !important;
    }

    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: 1fr;
    }

    body.woocommerce-order-received .woocommerce-order-overview li {
        border-inline-end: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
    }

    body.woocommerce-order-received .woocommerce-order-overview li:last-child {
        border-bottom: 0 !important;
    }

    body.woocommerce-order-received .woocommerce-order-details,
    body.woocommerce-order-received .woocommerce-customer-details,
    body.woocommerce-order-received .woocommerce-thankyou-order-received {
        padding: 18px;
    }
}

