:root {
    --pmg-primary: #0d285c;
    --pmg-primary-dark: #081e49;
    --pmg-primary-soft: #eef4ff;
    --pmg-success: #16834a;
    --pmg-success-bg: #edf9f1;
    --pmg-danger: #d7262e;
    --pmg-danger-bg: #fff0f1;
    --pmg-border: #d8dee8;
    --pmg-text: #18202b;
    --pmg-muted: #667085;
}

/* Produto grande: o formulário de compra só aparece depois de CEP válido. */
body.pmg-large-product form.cart {
    display: none !important;
}

body.pmg-large-product.pmg-cep-ok form.cart {
    display: block !important;
}

.pmg-validator {
    width: 100%;
    box-sizing: border-box;
    margin: 14px 0 18px;
    padding: 16px;
    border: 1px solid var(--pmg-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pmg-text);
    box-shadow: 0 2px 10px rgba(13, 40, 92, .05);
}

.pmg-validator__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--pmg-primary-dark);
    font-size: 16px;
    line-height: 1.3;
}

.pmg-icon-truck {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pmg-primary-soft);
    color: var(--pmg-primary);
    font-size: 12px;
}

.pmg-validator__instruction {
    margin: 0 0 10px;
    color: var(--pmg-muted);
    font-size: 13px;
    line-height: 1.45;
}

.pmg-validator__form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pmg-validator .pmg-cep-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid #cfd6e2;
    border-radius: 4px;
    background: #fff;
    color: var(--pmg-text);
    outline: none;
    font-size: 15px;
}

.pmg-validator .pmg-cep-input:focus {
    border-color: var(--pmg-primary);
    box-shadow: 0 0 0 2px rgba(13, 40, 92, .10);
}

.pmg-validator .pmg-validate-button,
.pmg-validator .pmg-validate-button.button {
    min-width: 112px;
    height: 44px;
    padding: 0 18px;
    border: 0 !important;
    border-radius: 4px !important;
    background: var(--pmg-primary) !important;
    color: #fff !important;
    font-weight: 700;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    box-shadow: none !important;
}

.pmg-validator .pmg-validate-button:hover,
.pmg-validator .pmg-validate-button.button:hover {
    background: var(--pmg-primary-dark) !important;
}

.pmg-validator .pmg-validate-button[disabled] {
    opacity: .65;
    cursor: wait;
}

.pmg-validator__status {
    display: block;
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: 6px;
    background: var(--pmg-primary-soft);
    color: var(--pmg-primary-dark);
    font-size: 13px;
    line-height: 1.4;
}

.pmg-validator__status.is-success {
    background: var(--pmg-success-bg);
    color: var(--pmg-success);
}

.pmg-validator__status.is-error {
    background: var(--pmg-danger-bg);
    color: var(--pmg-danger);
}

.pmg-validator__status.is-loading {
    background: #f5f7fa;
    color: var(--pmg-muted);
}

.pmg-whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 11px 16px;
    border-radius: 4px;
    background: var(--pmg-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.pmg-whatsapp-button:hover {
    background: var(--pmg-primary-dark);
    color: #fff !important;
}

.pmg-whatsapp-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.pmg-whatsapp-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pmg-whatsapp-label {
    display: inline-block;
}

.pmg-cart-validator {
    max-width: 620px;
    margin: 0 0 20px;
}

.pmg-checkout-guard {
    margin: 0 0 16px;
}

.pmg-checkout-guard .pmg-checkout-box {
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.pmg-checkout-guard .pmg-checkout-box.is-error {
    border: 1px solid #f4b8bc;
    background: var(--pmg-danger-bg);
    color: #9c1c23;
}

.pmg-checkout-guard .pmg-checkout-box.is-success {
    border: 1px solid #bfe5cc;
    background: var(--pmg-success-bg);
    color: #116b3c;
}

.pmg-checkout-guard .pmg-checkout-box.is-info {
    border: 1px solid #cbd8ef;
    background: var(--pmg-primary-soft);
    color: var(--pmg-primary-dark);
}

.pmg-checkout-guard .pmg-checkout-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    padding: 9px 14px;
    border-radius: 4px;
    background: var(--pmg-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.woocommerce-error a.pmg-inline-whatsapp {
    margin-left: 5px;
    font-weight: 700;
}

body.pmg-cart-has-large .checkout-button.pmg-blocked,
body.pmg-cart-has-large #place_order.pmg-blocked {
    opacity: .5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

@media (max-width: 600px) {
    .pmg-validator {
        padding: 14px;
    }

    .pmg-validator__form {
        flex-direction: column;
    }

    .pmg-validator .pmg-validate-button,
    .pmg-validator .pmg-validate-button.button {
        width: 100%;
    }
}


/* Aviso de CEP também no topo do checkout */
.pmg-checkout-guard-top {
    max-width: 1180px;
    margin: 0 auto 18px;
}

.pmg-checkout-guard-top:empty {
    display: none;
}
