/* C#110.8: carrinho e checkout (cupom, avisos, ícones de pagamento, recomendações). */

/* Avisos: o ícone não pode ficar sobre o texto ("Tem um cupom?", "Seu carrinho está vazio", "já está no carrinho"). */
body.engeduca-woo-cart .woocommerce-message,
body.engeduca-woo-cart .woocommerce-info,
body.engeduca-woo-cart .woocommerce-error,
body.engeduca-woo-checkout .woocommerce-message,
body.engeduca-woo-checkout .woocommerce-info,
body.engeduca-woo-checkout .woocommerce-error {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    min-height: 48px;
    padding: 12px 18px 12px 52px !important;
    box-sizing: border-box;
}
body.engeduca-woo-cart .woocommerce-message::before,
body.engeduca-woo-cart .woocommerce-info::before,
body.engeduca-woo-cart .woocommerce-error::before,
body.engeduca-woo-checkout .woocommerce-message::before,
body.engeduca-woo-checkout .woocommerce-info::before,
body.engeduca-woo-checkout .woocommerce-error::before {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    line-height: 1;
}
body.engeduca-woo-cart .woocommerce-message .button,
body.engeduca-woo-cart .woocommerce-info .button { margin-left: auto; float: none; }
body.engeduca-woo-cart .cart-empty { text-align: left; }

/* Cupom do carrinho: campo largo o bastante para o código digitado. */
body.engeduca-woo-cart .coupon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body.engeduca-woo-cart .coupon label { display: none; }
body.engeduca-woo-cart .coupon #coupon_code,
body.engeduca-woo-cart .coupon .input-text {
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 360px;
    width: auto;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    box-sizing: border-box;
}
body.engeduca-woo-cart .coupon .button { flex: 0 0 auto; }
body.engeduca-woo-cart td.actions { padding: 16px; }
@media (max-width: 640px) {
    body.engeduca-woo-cart .coupon { flex-direction: column; align-items: stretch; }
    /* Em coluna o flex-basis vira ALTURA: sem isto o campo ficava com 260px de altura no celular (C#121.7). */
    body.engeduca-woo-cart .coupon #coupon_code,
    body.engeduca-woo-cart .coupon .input-text { flex: 0 0 auto !important; height: 48px !important; min-width: 0; max-width: none; width: 100% !important; }
    body.engeduca-woo-cart .coupon .button { width: 100% !important; justify-content: center; text-align: center; }
}

/* Coluna de quantidade vazia (curso é venda individual). */
body.engeduca-woo-cart table.shop_table th.product-quantity,
body.engeduca-woo-cart table.shop_table td.product-quantity { display: none; }

/* "Você pode se interessar por…": sem texto justificado. */
body.engeduca-woo-cart .cross-sells h2,
body.engeduca-woo-cart .cross-sells .woocommerce-loop-product__title {
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
    hyphens: manual;
}

/* C#250.58 (pedido do cliente, 19/11): título "Você pode se interessar por…" visualmente abaixo do destaque de "Seu pedido" (28px) e do "Total no carrinho";
   no checkout o bloco fica logo abaixo de "Seu pedido", antes das formas de pagamento. */
body.engeduca-woo-cart .cross-sells h2,
body.engeduca-woo-checkout .cross-sells h2 {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 16px;
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
    hyphens: manual;
}
body.engeduca-woo-checkout .cross-sells {
    margin: 28px 0 24px;
    clear: both;
}
body.engeduca-woo-checkout .cross-sells .woocommerce-loop-product__title {
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
    hyphens: manual;
}
@media (max-width: 600px) {
    body.engeduca-woo-cart .cross-sells h2,
    body.engeduca-woo-checkout .cross-sells h2 { font-size: 20px; }
}

/* Meios de pagamento: nome e ícone na mesma linha, sem o ícone sobre o texto. */
body.engeduca-woo-checkout #payment .wc_payment_methods > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
body.engeduca-woo-checkout #payment .wc_payment_methods > li > .payment_box { flex: 1 0 100%; }
body.engeduca-woo-checkout #payment .wc_payment_methods > li > label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap;
    margin: 0;
    line-height: 1.3;
}
body.engeduca-woo-checkout #payment .wc_payment_methods > li > label img {
    height: 22px;
    width: auto;
    max-width: 90px;
    margin: 0;
    float: none;
    position: static;
}
body.engeduca-woo-checkout #payment .wc_payment_methods > li > input[type="radio"] { margin-right: 4px; }

/* C#129 (cliente, 11/11/2026, teste de compra): bloco "Pague seu PIX" do pagbank-connect.
   O rótulo "Código PIX" aparecia partido ("Código" e "PIX" nas pontas) e o botão Copiar ficava deslocado em relação ao campo.
   Rótulo acima do campo, campo e botão na mesma linha, alinhados pela base; no celular o botão desce inteiro, sem cortar. */
.pix-payment .code-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 24px;
}
.pix-payment .code-container label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    text-align: left;
    text-align-last: left;
}
.pix-payment .code-container .pix-code-label {
    display: block;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.pix-payment .code-container .pix-code {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border-radius: 8px;
}
.pix-payment .code-container .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 24px;
    line-height: 1;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .pix-payment .code-container label { align-items: center; text-align: center; text-align-last: center; }
    .pix-payment .code-container .copy-btn { width: 100%; }
}

/* C#225.5 (cliente, 12/11/2026, boleto): mesmo padrão do bloco Pix para "Pague seu Boleto" do pagbank-connect.
   "Código de barras" aparecia com espaçamento excessivo entre as palavras (texto justificado em linha curta) e o texto do
   botão Copiar saía deslocado. Rótulo à esquerda e sem justificar, campo e botão na mesma linha, texto do botão centralizado
   na horizontal e na vertical; no celular o botão desce inteiro. */
.boleto-payment .code-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 20px;
}
.boleto-payment .code-container label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
    word-spacing: normal;
    text-align: left;
    text-align-last: left;
}
.boleto-payment .code-container .pix-code {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border-radius: 8px;
}
.boleto-payment .code-container .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 24px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
}
.boleto-payment .boleto-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 12px;
}
.boleto-payment .boleto-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
    padding: 0 24px;
    line-height: 1.2;
    text-align: center;
}
@media (max-width: 480px) {
    .boleto-payment .code-container label { align-items: center; text-align: center; text-align-last: center; }
    .boleto-payment .code-container .copy-btn { width: 100%; }
    .boleto-payment .boleto-actions .button { width: 100%; }
}

/* C#225 (cliente, 12/11): botões da linha "Ações" do pedido (Cancelar, Ver boleto/Ver Pix, Pagar) com o texto centralizado,
   mesma largura e espaçamento igual entre eles, no computador e no celular. */
.woocommerce-order-details table td a.woocommerce-button.button,
.woocommerce-order-details table td a.button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 240px;
    min-height: 44px;
    margin: 0 0 10px;
    padding: 0 20px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}
.woocommerce-order-details table td a.button:last-child {
    margin-bottom: 0;
}

/* C#250.40: botão "Adicionar ao carrinho" da venda cruzada e do Upsell: texto centralizado, sem justificar ("Adicionar" à esquerda e "ao" à direita). */
body .cross-sells a.button,
body .cross-sells .add_to_cart_button,
body .up-sells a.button,
body .up-sells .add_to_cart_button {
    text-align: center;
    text-align-last: center;
    text-justify: auto;
    word-spacing: normal;
    hyphens: manual;
}

/* C#250.58 (DC visual): quando sobra um só cartão na venda cruzada, ele fica à esquerda (no celular o WooCommerce o põe à direita por ser o 2º da linha). */
body .cross-sells.engeduca-xs-solo ul.products li.product {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
