/*
 * Alfa Printi Suite 4.10.29 — refinamentos finais de layout.
 *
 * 1. Mantém a área entre o cabeçalho e o conteúdo com o mesmo fundo azul-claro
 *    das páginas comerciais controladas pelo plugin.
 * 2. Posiciona e dimensiona o progresso do carrinho exatamente como no checkout.
 * 3. Restaura, somente no mobile, a semântica de tabela do bloco “Seu pedido”,
 *    fazendo conteúdo e separadores ocuparem toda a largura útil do card.
 */

/* Fundo contínuo após o cabeçalho, sem faixa branca entre o shell e a página. */
html body.apcsu-plugin-owned-surface,
html body.apcsu-plugin-owned-surface #page,
html body.apcsu-plugin-owned-surface #content,
html body.apcsu-plugin-owned-surface .site-content,
html body.apcsu-plugin-owned-surface #primary,
html body.apcsu-plugin-owned-surface .content-area,
html body.apcsu-plugin-owned-surface main.site-main,
html body.apcsu-plugin-owned-surface article.page,
html body.apcsu-plugin-owned-surface article.type-page,
html body.apcsu-plugin-owned-surface .entry-content {
    background-color: var(--apcsu-ui-owned-bg, var(--apcsu-ui-cart-page-bg, #f5f7fb)) !important;
}

/* O stepper do carrinho usa a mesma medida, centralização e três colunas do checkout. */
html body.apcsu-surface-cart.apcsu-plugin-owned-surface .apcsu-prod-checkout-steps {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    justify-content: center !important;
    justify-items: stretch !important;
    float: none !important;
    clear: both !important;
    width: min(100%, 840px) !important;
    max-width: 840px !important;
    min-width: 0 !important;
    min-height: 82px !important;
    margin: 0 auto 26px !important;
    padding: 14px 0 8px !important;
    grid-column: 1 / -1 !important;
    justify-self: center !important;
}

html body.apcsu-surface-cart.apcsu-plugin-owned-surface .apcsu-prod-checkout-step {
    width: 100% !important;
    min-width: 0 !important;
    place-items: start center !important;
    text-align: center !important;
}

/*
 * Mobile — neutraliza os modos responsivos que transformavam linhas/células do
 * resumo em blocos estreitos. A tabela volta a ocupar integralmente o card.
 */
@media (max-width: 767px) {
    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        .apcsu-checkout-right-v4106,
    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review,
    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        .woocommerce-checkout-review-order {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review {
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-right: 16px !important;
        padding-left: 16px !important;
        overflow: hidden !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table {
        display: table !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 18px !important;
        padding: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        box-sizing: border-box !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table > thead {
        display: table-header-group !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table > tbody {
        display: table-row-group !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table > tfoot {
        display: table-footer-group !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table :is(thead, tbody, tfoot) > tr {
        display: table-row !important;
        float: none !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table :is(th, td) {
        display: table-cell !important;
        float: none !important;
        clear: none !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        vertical-align: top !important;
        box-sizing: border-box !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table :is(th.product-name, td.product-name) {
        width: 68% !important;
        padding-right: 10px !important;
        padding-left: 3px !important;
        text-align: left !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table :is(th.product-total, td.product-total) {
        width: 32% !important;
        padding-right: 3px !important;
        padding-left: 8px !important;
        text-align: right !important;
    }

    html body:not(.wp-admin).apcsu-surface-checkout.apcsu-plugin-owned-surface
        #order_review .woocommerce-checkout-review-order-table td::before {
        display: none !important;
        content: none !important;
    }
}
