/* 
   Advanced Checkout for WooCommerce - Frontend Styles
   Versão Final: "Nuclear" + Cupom Unificado (Visitante/Logado) + Ajustes Visuais
*/

/* --- SISTEMA DE LOGIN NO CHECKOUT --- */
.email-exists-alert {
    background-color: #fff;
    border: 1px dashed #d1d5db;
    color: #374151;
    padding: 10px 15px;
    font-size: 13px;
    border-radius: 8px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: fadeIn 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.btn-login-inline {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
}

.btn-login-inline:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #111;
}

/* --- OCULTAR LINHA DA TAXA --- */
#order_review tr.fee,
.cart_totals tr.fee,
.woocommerce-checkout-review-order-table tr.fee {
    display: none !important;
    visibility: hidden !important;
}

/* --- BOTÃO VOLTAR PARA LOJA --- */
.btn-voltar-loja {
    display: table;
    margin: 10px auto 25px auto;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.btn-voltar-loja:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
    text-decoration: none;
}

/* --- BOTÕES DE QUANTIDADE --- */
.qty-actions-wrapper {
    gap: 8px !important;
    justify-content: flex-end !important;
}

.qty-pill-v12 {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    height: 36px !important;
}

.qty-btn-v12 {
    width: 36px !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    font-size: 20px !important;
    transition: background 0.2s;
}

.qty-btn-v12:hover {
    background-color: #f3f4f6;
    color: #000;
}

.qty-val-v12 {
    padding: 0 8px !important;
    font-size: 15px !important;
    font-weight: 700;
    min-width: 25px;
    text-align: center;
}

.custom-remove-item {
    font-size: 12px !important;
    color: #ef4444 !important;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    padding: 5px;
    margin-right: 0 !important;
}

/* --- BOTÕES PRINCIPAIS --- */
.btn-next,
#place_order,
button#place_order,
.woocommerce-checkout #payment #place_order {
    width: 100% !important;
    background: #00C058 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    height: 52px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0, 192, 88, 0.3) !important;
    transition: all 0.2s !important;
    text-transform: uppercase !important;
}

.btn-next:hover,
#place_order:hover {
    background: #00A84D !important;
}

#place_order:disabled {
    background-color: #ccc !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake-anim {
    animation: shake 0.4s ease-in-out;
}

/* --- LAYOUT BÁSICO DO CHECKOUT --- */
html,
body {
    background-color: #F4F6F8 !important;
}

form.checkout {
    display: block !important;
    opacity: 1 !important;
    max-width: 500px;
    margin: 0 auto 50px auto !important;
    background: #fff;
    padding: 25px 20px !important;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    position: relative;
    z-index: 100;
}

.address-locked {
    display: none;
}

.hidden-field-wrapper {
    display: none !important;
    visibility: hidden;
}

/* ESCONDER ELEMENTOS DO TEMA */
header,
footer,
.site-header,
.site-footer,
.elementor-location-header,
.elementor-location-footer,
#ast-mobile-header,
.ast-mobile-menu-buttons,
.woocommerce-billing-fields > h3,
.woocommerce-shipping-fields > h3,
.woocommerce-additional-fields > h3,
#order_review_heading,
.woocommerce-column__title,
#billing_country_field,
.select2-container--default .select2-selection--single,
tr.cart-subtotal,
.cart-subtotal,
#order_review tr.cart-subtotal,
tr.order-subtotal,
th.product-total,
.e-checkout__container,
.elementor-widget-woocommerce-checkout {
    display: none !important;
}

/* ESTILO REVIEW ORDER */
#order_review,
.review-order-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.review-order-section {
    background: #F9FAFB;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

#order_review table.shop_table {
    display: block !important;
    width: 100% !important;
    border: none !important;
    margin: 0 !important;
}

#order_review table.shop_table tbody {
    display: block !important;
    width: 100% !important;
    border: none !important;
    margin: 0 !important;
}

#order_review table.shop_table tr.cart_item {
    display: block !important;
    width: 100% !important;
    border-bottom: 1px dashed #E5E7EB !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
}

#order_review table.shop_table td.product-name {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    border: none !important;
}

#order_review table.shop_table td.product-total {
    display: none !important;
}

/* PRODUTO ROW */
.checkout-prod-row {
    display: grid !important;
    grid-template-columns: 90px 1fr !important;
    gap: 15px !important;
    width: 100% !important;
    align-items: center !important;
    margin: 0 !important;
    border: none !important;
}

.cpr-img {
    width: 90px !important;
}

.cpr-img img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    border: 1px solid #eee;
    display: block;
}

.cpr-data {
    width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
}

.cpr-title {
    display: block !important;
    width: 100% !important;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    white-space: normal !important;
    line-height: 1.4 !important;
}

.qty-actions-wrapper {
    width: 100% !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

/* TOTAL E FRETE */
#order_review table.shop_table thead {
    display: none !important;
}

#order_review tfoot {
    display: block !important;
    width: 100% !important;
    margin-top: 0 !important;
}

#order_review tfoot tr {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
}

tr.order-total {
    margin: 0 !important;
    border-top: none !important;
    padding: 4px 0 !important;
}

tr.order-total th,
tr.order-total td {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
    border: none !important;
    font-size: 15px !important;
}

/* ========================================= */
/* LÓGICA DE FRETE (NUCLEAR & DEFINITIVA)    */
/* ========================================= */

.woocommerce-no-shipping-available-html,
.e-checkout-message,
span.woocommerce-no-shipping-available-html {
    display: none !important;
}

tr.woocommerce-shipping-totals,
tr.shipping {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

tr.woocommerce-shipping-totals.force-show-shipping,
tr.shipping.force-show-shipping {
    display: table-row !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* WIZARD STEPS */
.yampi-progress-container {
    width: 100%;
    max-width: 500px;
    margin: 15px auto 20px auto;
    position: relative;
    padding: 0 10px;
    box-sizing: border-box;
    z-index: 999;
}

.progress-track-bg {
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #E5E7EB;
    z-index: 1;
}

.progress-track-fill {
    position: absolute;
    top: 15px;
    left: 40px;
    height: 3px;
    background: #00C058;
    z-index: 2;
    transition: width 0.4s ease;
    width: 0%;
}

.yampi-steps-wrapper {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}

.y-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
}

.y-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    transition: all 0.3s;
}

.y-step-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-align: center;
}

.y-step.active .y-step-circle {
    background: #00C058;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 192, 88, 0.15);
}

.y-step.completed .y-step-circle {
    background: #00C058;
    color: #fff;
}

.y-step.active .y-step-label {
    color: #111;
}

.y-step:hover .y-step-circle {
    transform: scale(1.1);
}

/* CAMPOS */
.step-title {
    font-size: 15px;
    font-weight: 800;
    color: #374151;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

form.checkout .form-row {
    margin-bottom: 12px;
    display: block;
}

form.checkout input.input-text,
form.checkout select {
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    padding: 0 15px !important;
    height: 46px !important;
    font-size: 14px !important;
    color: #333 !important;
    width: 100%;
}

form.checkout input.input-text:focus {
    border-color: #00C058 !important;
    box-shadow: 0 0 0 2px rgba(0,192,88,0.1);
}

form.checkout label {
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
    margin-bottom: 4px;
    display: block;
}

.checkout-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.checkout-step.active {
    display: block;
}

.wizard-nav {
    margin-top: 20px;
}

/* LAYOUT GRID DESKTOP */
@media (min-width: 768px) {
    form.checkout .form-row-first {
        width: 48%;
        float: left;
        margin-right: 4%;
        clear: none;
    }

    form.checkout .form-row-last {
        width: 48%;
        float: right;
        margin-right: 0;
        clear: none;
    }

    form.checkout .form-row-wide {
        width: 100%;
        clear: both;
    }
    
    #billing_first_name_field {
        width: 100% !important;
        float: none !important;
        clear: both !important;
    }

    #billing_address_1_field {
        width: 68% !important;
        margin-right: 2% !important;
        float: left !important;
        clear: both !important;
    }

    #billing_number_field {
        width: 30% !important;
        margin-right: 0 !important;
        float: right !important;
        clear: none !important;
    }

    #billing_address_2_field {
        width: 48% !important;
        float: left !important;
        margin-right: 4% !important;
        clear: both !important;
    }

    #billing_neighborhood_field {
        width: 48% !important;
        float: right !important;
        margin-right: 0 !important;
        clear: none !important;
    }
}

/* LAYOUT MOBILE */
@media (max-width: 767px) {
    form.checkout .form-row-first,
    form.checkout .form-row-last,
    form.checkout .form-row-wide {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
    }

    #billing_address_2_field,
    #billing_neighborhood_field {
        width: 100% !important;
        float: none !important;
    }
}

/* --- UI DE PAGAMENTO --- */
#payment ul.payment_methods {
    display: none !important;
}

#custom-payment-ui {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 20px;
}

.pay-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.pay-opt-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
}

.pay-opt-btn:hover {
    border-color: #00C058;
    background: #F0FDF4;
    transform: translateX(5px);
}

.pay-opt-btn.selected {
    background: #00C058;
    color: #fff;
    border-color: #00C058;
    box-shadow: 0 4px 10px rgba(0, 192, 88, 0.2);
}

.pay-icon {
    font-size: 24px;
    line-height: 1;
}

.pay-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

#sub-options-container {
    display: none;
    background: #F9FAFB;
    border-radius: 8px;
    padding: 15px;
    border: 1px dashed #D1D5DB;
    margin-top: 5px;
}

.sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sub-title {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
}

.sub-btn {
    padding: 12px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

.sub-btn:hover {
    border-color: #00C058;
    color: #00C058;
}

.sub-btn.active {
    background: #DCFCE7;
    border-color: #00C058;
    color: #166534;
}

#gateway-message-box {
    margin-top: 15px;
    font-size: 13px;
    color: #4B5563;
    background: #F3F4F6;
    padding: 12px;
    border-radius: 6px;
    display: none;
    border-left: 4px solid #00C058;
}

/* --- MENSAGEM DE ERRO GLOBAL --- */
#global-error-msg {
    background-color: #FEF2F2;
    border: 1px solid #F87171;
    color: #B91C1C;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin: 15px auto;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.4s ease-in-out;
}

#global-error-msg::before {
    content: "⚠️";
    font-size: 16px;
}

/* PÁGINA ÚNICA - CHECKOUT PARA USUÁRIOS LOGADOS */
.acwc-single-page-checkout {
    width: 100%;
}

.acwc-checkout-block {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

/* HEADER DO BLOCO: ALINHAMENTO SPACE-BETWEEN */
.acwc-block-header {
    background: #fff;
    padding: 14px 18px;
    border-bottom: 1px solid #E5E7EB;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.acwc-block-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

/* BOTÃO EDITAR - FLEXBOX E EMOJI */
.acwc-edit-btn {
    display: inline-flex !important; /* Alinha ícone e texto */
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important; /* Espaço entre o emoji e o texto */
    background-color: #F9FAFB !important;
    border: 1px solid #E5E7EB !important;
    color: #6B7280 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 6px 14px !important;
    border-radius: 16px !important;
    letter-spacing: 0.3px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    line-height: 1 !important; /* Remove altura de linha extra */
    height: auto !important;
    text-transform: uppercase !important;
}

.acwc-edit-btn img.emoji,
.acwc-edit-btn img {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    border: none !important;
    box-shadow: none !important;
}

.acwc-edit-btn:hover {
    background-color: #F3F4F6 !important;
    border-color: #D1D5DB !important;
    color: #4B5563 !important;
}

.acwc-edit-btn.acwc-save-btn {
    background-color: #F0FDF4 !important;
    border-color: #BBF7D0 !important;
    color: #059669 !important;
}

.acwc-edit-btn.acwc-save-btn:hover {
    background-color: #DCFCE7 !important;
    border-color: #86EFAC !important;
    color: #047857 !important;
}

.acwc-block-content {
    padding: 18px;
}

/* CAMPOS COMPACTOS - CHECKOUT LOGADO */
body.logged-in.woocommerce-checkout .acwc-field-static {
    padding: 7px 0 !important;
}

body.logged-in.woocommerce-checkout .acwc-field-static label {
    font-size: 11px !important;
    min-width: 95px !important;
    color: #6B7280;
    font-weight: 600;
}

body.logged-in.woocommerce-checkout .acwc-field-static span {
    font-size: 12px !important;
    color: #374151 !important;
}

body.logged-in.woocommerce-checkout input.input-text[readonly],
body.logged-in.woocommerce-checkout input.input-text[disabled],
body.logged-in.woocommerce-checkout .acwc-edit-fields input.input-text {
    height: 38px !important;
    font-size: 13px !important;
    padding: 0 12px !important;
}

body.logged-in.woocommerce-checkout #billing_email_field input {
    font-size: 11px !important;
}

body.logged-in.woocommerce-checkout .acwc-block-content {
    padding: 14px !important;
}

body.logged-in.woocommerce-checkout .acwc-checkout-block {
    margin-bottom: 12px !important;
}

@media (max-width: 767px) {
    body.logged-in.woocommerce-checkout .acwc-field-static {
        padding: 6px 0 !important;
    }
    
    body.logged-in.woocommerce-checkout .acwc-field-static label {
        font-size: 10px !important;
        min-width: 75px !important;
    }
    
    body.logged-in.woocommerce-checkout .acwc-field-static span {
        font-size: 11px !important;
    }
    
    body.logged-in.woocommerce-checkout input.input-text {
        height: 36px !important;
        font-size: 12px !important;
        padding: 0 10px !important;
    }
    
    body.logged-in.woocommerce-checkout #billing_email_field input {
        font-size: 10px !important;
    }
}

/* CAMPOS ESTÁTICOS (VISUALIZAÇÃO) */
.acwc-static-fields {
    display: block;
}

.acwc-field-static {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px dashed #E5E7EB;
}

.acwc-field-static:last-child {
    border-bottom: none;
}

.acwc-field-static label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    min-width: 150px;
    margin: 0;
}

.acwc-field-static span {
    font-size: 14px;
    font-weight: 400;
    color: #111;
}

/* CAMPOS EDITÁVEIS (MODO EDIÇÃO) */
.acwc-edit-fields {
    display: none;
}

.acwc-block-content.acwc-edit-mode .acwc-static-fields {
    display: none;
}

.acwc-block-content.acwc-edit-mode .acwc-edit-fields {
    display: block;
}

.acwc-edit-fields .form-row {
    margin-bottom: 15px;
}

.acwc-edit-fields input.input-text,
.acwc-edit-fields select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
}

.acwc-edit-fields input.input-text:focus {
    border-color: #00C058;
    box-shadow: 0 0 0 2px rgba(0, 192, 88, 0.1);
}

.acwc-edit-fields label {
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
    margin-bottom: 6px;
    display: block;
}

/* BOTÕES ÁREA DO CLIENTE - TOM CINZA SUAVE */
.woocommerce-account .woocommerce-Button,
.woocommerce-account button.button,
.woocommerce-ResetPassword button,
.woocommerce-ResetPassword .button {
    background: #F9FAFB !important;
    border: 1px solid #E5E7EB !important;
    color: #4B5563 !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: none !important;
}

.woocommerce-account .woocommerce-Button:hover,
.woocommerce-account button.button:hover,
.woocommerce-ResetPassword button:hover,
.woocommerce-ResetPassword .button:hover {
    background: #F3F4F6 !important;
    border-color: #D1D5DB !important;
    color: #111 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* TOGGLE SENHA - MINHA CONTA (LOGIN) */
.woocommerce-form-login .form-row-wide {
    position: relative !important;
}

.toggle-pwd-myaccount {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer !important;
    color: #6B7280 !important;
    transition: color 0.2s !important;
    user-select: none !important;
    z-index: 9999 !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: auto !important;
}

.toggle-pwd-myaccount:hover {
    color: #00C058 !important;
}

.toggle-pwd-myaccount svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
}

.woocommerce-form-login input[name="password"] {
    padding-right: 45px !important;
}

/* TOGGLE SENHA - FORMULÁRIO TROCAR SENHA */
.woocommerce-ResetPassword .form-row {
    position: relative !important;
}

.toggle-pwd-reset {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer !important;
    color: #6B7280 !important;
    transition: color 0.2s !important;
    user-select: none !important;
    z-index: 9999 !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: auto !important;
}

.toggle-pwd-reset:hover {
    color: #00C058 !important;
}

.toggle-pwd-reset svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
}

.woocommerce-ResetPassword input[type="password"],
.woocommerce-ResetPassword input[type="text"] {
    padding-right: 45px !important;
}

/* TOGGLE SENHA - INLINE */
.toggle-pwd-inline {
    transition: color 0.2s !important;
    user-select: none !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.toggle-pwd-inline:hover {
    color: #00C058 !important;
}

.toggle-pwd-inline svg {
    display: block !important;
    pointer-events: none !important;
}

/* THANK YOU PAGE + MINHA CONTA - CSS COMPLETO */
.woocommerce-order > *:not(.custom-thankyou-wrapper),
.woocommerce-order p.woocommerce-notice,
.woocommerce-order .woocommerce-order-details,
.woocommerce-customer-details {
    display: none !important;
}

.woocommerce-account header.entry-header,
.woocommerce-account .entry-header,
header.entry-header.ast-no-thumbnail {
    display: none !important;
}

.woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.custom-thankyou-wrapper {
    width: 90% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    padding-top: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-bottom: 50px;
    color: #333;
    box-sizing: border-box;
}

.custom-thankyou-wrapper > .ty-card,
.custom-thankyou-wrapper > a.btn-access-account {
    margin-top: 10px;
}

.ty-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
}

.ty-card-header {
    padding: 15px 20px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
}

.password-card {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pwd-grp {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.pwd-grp input.ty-input {
    flex: 1;
    margin-bottom: 0 !important;
    background: #fff;
    border-color: #86EFAC;
}

.pwd-grp input.ty-input:focus {
    outline: none;
    border-color: #00C058;
    box-shadow: 0 0 0 3px rgba(0, 192, 88, 0.1);
}

.pwd-grp button.ty-btn {
    width: auto;
    padding: 0 12px;
    font-size: 12px;
    height: 40px;
}

.status-cancelled {
    opacity: 0.6;
    filter: grayscale(90%);
    pointer-events: none;
}

.status-cancelled .ty-actions-row {
    display: none;
}

.ty-icon-circle {
    width: 60px;
    height: 60px;
    background: #00C058;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
}

.ty-check {
    color: #fff;
    font-size: 30px;
    font-weight: bold;
}

.ty-order-number {
    background: #F3F4F6;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    display: inline-block;
}

.summary-card {
    padding: 0;
    overflow: hidden;
}

.ty-prod-row {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px dashed #E5E7EB;
    align-items: center;
}

.ty-totals {
    padding: 15px 20px 5px 20px;
}

.ty-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.ty-payment-box {
    margin-top: 15px;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.ty-pm-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #047857;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ty-pm-val {
    font-size: 16px;
    font-weight: 800;
    color: #064e3b;
}

.ty-troco-val {
    font-size: 13px;
    color: #059669;
    margin-top: 8px;
    border-top: 1px dashed #6ee7b7;
    padding-top: 8px;
}

.ty-input {
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 0 15px;
    height: 48px;
    font-size: 14px;
    background: #fff;
}

.ty-btn {
    background: #00C058;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 192, 88, 0.2);
}

.btn-access-account {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #4B5563;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
    transition: all 0.2s;
    font-size: 14px;
    box-sizing: border-box;
}

.btn-access-account:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    color: #111;
    text-decoration: none;
}

/* --- BOTÕES DE AÇÃO (PEDIDOS) - ATUALIZADO --- */
.ty-actions-row {
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    align-items: center;
}

.ty-sm-btn {
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    color: #4B5563;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    text-decoration: none !important;
    white-space: nowrap; /* CRITICAL */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    height: 36px;
    flex: 1; /* Tenta ocupar espaço igual */
}

.ty-sm-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111;
}

.ty-sm-btn.btn-whats {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}

.ty-sm-btn.btn-whats:hover {
    background: #128C7E;
    border-color: #128C7E;
}

.ty-sm-btn.btn-whats svg {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    fill: currentColor;
    position: relative;
    top: -1px;
}

/* --- MOBILE: FORÇAR LINHA ÚNICA --- */
@media (max-width: 480px) {
    .ty-actions-row {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        justify-content: space-between;
        padding: 10px 15px;
        gap: 5px;
    }
    
    .ty-sm-btn {
        padding: 0 5px;
        font-size: 10px !important;
        min-width: fit-content;
        flex: 1;
    }
    
    .ty-sm-btn.btn-whats svg {
        margin-right: 3px;
        width: 14px;
        height: 14px;
    }
}

/* DASHBOARD NAVIGATION - TONS SUAVES */
.dash-nav {
    display: flex;
    gap: 5px;
    background: #F9FAFB;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #F3F4F6;
}

.dash-nav button {
    flex: 1;
    background: transparent;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #9CA3AF;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.dash-nav button.active {
    background: #fff;
    color: #4B5563;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dash-nav button:hover {
    background: #F3F4F6;
    color: #6B7280;
}

.dash-panel {
    display: none;
}

.dash-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dash-msg {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.dash-msg.success {
    background: #DCFCE7;
    color: #166534;
}

.dash-msg.error {
    background: #FEE2E2;
    color: #991B1B;
}

.woocommerce-ResetPassword input {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 0 15px;
    height: 48px;
    margin-bottom: 15px;
}

.woocommerce-ResetPassword button {
    background: #00C058;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 100%;
    height: 48px;
    font-weight: 800;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- REMOVER MENSAGENS DE SUCESSO/ALERTA DO WOOCOMMERCE --- */
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-message[role="alert"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
}

/* --- CUPOM DE DESCONTO: UNIFICADO (VISITANTE E LOGADO) --- */

/* 1. GARANTIR VISIBILIDADE DO TOGGLE (LINK) */
.woocommerce-form-coupon-toggle {
    display: block !important;
    width: 100% !important;
    margin: 15px 0 !important;
}

/* Esconde qualquer mensagem de "você tem um cupom?" padrão do tema e deixa só o link limpo */
.woocommerce-form-coupon-toggle .woocommerce-info {
    font-size: 13px !important;
    color: #9CA3AF !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    text-align: center !important; /* Centraliza o link */
    line-height: 1.4 !important;
    font-weight: 400 !important;
    display: block !important;
    width: 100% !important;
    box-shadow: none !important;
}

/* Remove ícones/bordas padrão do tema no toggle */
.woocommerce-form-coupon-toggle .woocommerce-info::before,
.woocommerce-form-coupon-toggle .woocommerce-info::after { 
    display: none !important; 
}

/* Estilo do Link "Clique aqui" */
.woocommerce-form-coupon-toggle .showcoupon {
    color: #3B82F6 !important;
    text-decoration: underline !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    margin-left: 3px !important;
    display: inline !important;
    float: none !important;
}

/* 2. FORMULÁRIO (CONTAINER FLEX) */
form.checkout_coupon {
    display: none; /* JS controla o show/hide */
    position: relative !important;
    margin-top: 10px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Quando visível, ativa o layout linha única */
form.checkout_coupon[style*="block"],
form.checkout_coupon.show {
    display: flex !important;
    flex-wrap: nowrap !important; /* Força linha única */
    justify-content: space-between !important;
    align-items: center !important;
    gap: 2% !important; /* Espaço entre input e botão */
}

/* 3. INPUT WRAPPER (63%) */
form.checkout_coupon p.form-row-first,
form.checkout_coupon p:first-child {
    width: 63% !important;
    flex: 0 0 63% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* 4. BOTÃO WRAPPER (35%) */
form.checkout_coupon p.form-row-last,
form.checkout_coupon p:last-child {
    width: 35% !important;
    flex: 0 0 35% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    text-align: right !important;
}

/* 5. INPUT FIELD (ESTILO VISUAL) */
form.checkout_coupon input.input-text {
    width: 100% !important;
    height: 40px !important;
    line-height: normal !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 20px !important;
    padding: 0 15px !important;
    font-size: 13px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    outline: none !important;
}

/* 6. BOTÃO APLICAR (ESTILO VISUAL) */
form.checkout_coupon button.button {
    width: 100% !important;
    height: 40px !important;
    line-height: 38px !important; /* Centraliza texto verticalmente */
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    color: #6b7280 !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: block !important;
    transition: all 0.2s !important;
}

form.checkout_coupon button.button:hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

/* 7. MENSAGEM DE ERRO (ABSOLUTE NO TOPO) */
form.checkout_coupon:has(#coupon-error-notice),
form.checkout_coupon:has(.coupon-error-notice) {
    padding-top: 35px !important; /* Espaço exato para o texto não sobrepor */
    align-items: flex-end !important; /* Alinha os campos na base */
    position: relative !important; /* Referência para o absolute */
    min-height: 80px !important; /* Garante altura */
}

#coupon-error-notice,
.coupon-error-notice {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    text-align: center !important;
    color: #ef4444 !important; /* Vermelho erro */
    font-size: 12px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 5px !important;
    background: transparent !important;
    border: none !important;
    z-index: 10 !important;
    line-height: 1.3 !important;
    display: block !important;
}

.coupon-error-notice {
    animation: fadeIn 0.3s ease-in-out;
}

/* Link Remover Cupom - Lateral Esquerda */
.woocommerce-remove-coupon {
    color: #EF4444 !important;
    font-size: 12px !important;
    text-decoration: underline !important;
    background: transparent !important;
    border: none !important;
    display: inline-block !important;
    margin-right: 8px !important;       /* CORREÇÃO: margin-right ao invés de left */
    cursor: pointer !important;
    transition: color 0.2s !important;
    vertical-align: middle !important;
    float: left !important;              /* ADIÇÃO: força para o lado esquerdo */
}

.woocommerce-remove-coupon:hover {
    color: #DC2626 !important;
    text-decoration: none !important;
}



/* ========================================
   VALIDAÇÃO VIP - CAMPO DE WHATSAPP (Estilo Discreto)
   ======================================== */

.vip-validation-box {
    background: #FAFAFA;
    border: 2px dashed #9CA3AF;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    animation: slideDown 0.3s ease-out;
}

.vip-validation-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 6px 0;
    text-align: center;
}

.vip-validation-desc {
    font-size: 12px;
    color: #6B7280;
    margin: 0 0 15px 0;
    text-align: center;
}

.vip-validation-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.vip-validation-input-group input {
    flex: 1;
    height: 44px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 0 15px;
    font-size: 14px;
    background: #fff;
    color: #1F2937;
}

.vip-validation-input-group input:focus {
    border-color: #6B7280;
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* Botão Validar - Estilo Ajustado */
.btn-validate-vip {
    /* Estrutura e Alinhamento */
    display: inline-flex;      /* Essencial para centralizar verticalmente */
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;           /* Aumentado: 0px deixaria o texto espremido */
    
    /* Visual "Pílula" */
    background: #FFFFFF !important; /* Fundo branco ou #F3F4F6 se quiser cinza claro */
    color: #6B7280 !important;
    border: 1px solid #E5E7EB !important; /* Corrigido: faltava 'solid' e a cor */
    border-radius: 5px !important;       /* Corrigido: 99px cria o efeito redondo total */
    
    /* Tipografia */
    font-size: 13px;
    font-weight: 600;          /* 400 é muito fino, 600 melhora a leitura */
    text-transform: uppercase; /* Geralmente esses botões usam caixa alta */
    letter-spacing: 0.5px;
    
    /* Comportamento */
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Efeito Hover (Ao passar o mouse) */
.btn-validate-vip:hover {
    background: #F9FAFB !important;
    color: #374151 !important; /* Texto fica levemente mais escuro */
    border-color: #D1D5DB !important;
}


.btn-validate-vip:disabled {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: not-allowed;
}

/* Cancelar como texto/link - CENTRALIZADO */
.btn-cancel-vip {
    display: block;
    width: 100%;
    background: transparent !important;
    border: none !important;
    color: #6B7280 !important;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    text-decoration: underline;
    padding: 0px 0;
    margin-top: 0px;
    transition: color 0.2s;
    box-shadow: none !important;
}


.vip-validation-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* --- UPSELL CHECKOUT --- */

tr.upsell-row-container td {
    margin-top: -30px !important; 
}


/* 1. Container Principal (Ajustado para colar na tabela acima sem cortar) */
.checkout-upsell-wrapper {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    /* Remove borda superior para parecer continuação da tabela */
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin-top: 0 !important; /* Cola no elemento de cima */
}

/* 2. Título (Ajuste de margem) */
.upsell-title {
    text-align: left;
    font-size: 13px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    color: #374151;
    font-weight: 700;
}

/* 3. Slider e Itens */
.upsell-swiper-checkout {
    width: 100%;
    padding-bottom: 5px;
}

.upsell-slide-item {
    height: auto; 
    display: flex;
}

/* 4. Caixa do Produto (Card) */
.upsell-box {
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.upsell-box a {
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.upsell-box img {
    height: 70px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 8px;
    display: block;
    object-fit: contain;
}

/* 5. Nome do Produto (Completo) */
.upsell-name {
    font-size: 11px;
    line-height: 1.35;
    margin: 0 0 8px;
    font-weight: 600;
    color: #1f2937;
    height: auto;
    max-height: none;
    overflow: visible;
    white-space: normal;
    display: block;
}

/* 6. Preço */
.upsell-price {
    display: block;
    font-size: 12px;
    color: #059669;
    font-weight: bold;
    margin-bottom: 10px;
    margin-top: auto;
}

/* 7. Botão Adicionar */
.upsell-add-btn {
    width: 100%;
    font-size: 11px !important;
    padding: 8px !important;
    min-height: auto !important;
    background-color: #10b981 !important;
    color: white !important;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upsell-add-btn:hover {
    background-color: #059669 !important;
}

.upsell-add-btn.loading {
    opacity: 0.7;
    cursor: wait;
    background-color: #6b7280 !important;
}

/* --- REGRAS DE ESPAÇAMENTO E OCULTAÇÃO --- */

/* Remove padding da célula da tabela onde o upsell está */
tr.upsell-row-container td {
    padding-top: 0 !important;
    padding-bottom: 15px !important; /* Espaço para o bloco de baixo */
    border: none !important;
}

/* Remove padding inferior da tabela de produtos para colar no upsell */
.woocommerce-checkout-review-order-table tr.cart_item:last-child td {
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* Ocultar mensagem de entrega APENAS dentro do upsell (se existir) */
.checkout-upsell-wrapper .delivery-forecast-msg, 
.checkout-upsell-wrapper .shipping-estimate {
    display: none !important;
}