/*
 * Visual único das telas de pagamento (checkout da loja, cobranças do
 * painel do cliente e link público de cobrança) — as três usam as mesmas
 * classes para não divergir visualmente. A cor de destaque vem da variável
 * --pay-primary, definida por cada página (config_get('site_cor_primaria')).
 */
.pay-panel {
    border: none;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .07);
    overflow: hidden;
}
.pay-panel__header {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--pay-primary, #0d6efd) 10%, white), color-mix(in srgb, var(--pay-primary, #0d6efd) 3%, white));
    border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.pay-panel__icon {
    width: 46px;
    height: 46px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--pay-primary, #0d6efd);
    color: #fff;
    font-size: 1.35rem;
}
.pay-panel__title {
    font-weight: 700;
    margin-bottom: .1rem;
}
.pay-panel__subtitle {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
}
.pay-panel__body {
    padding: 1.75rem;
}
.pay-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-size: .78rem;
    color: #64748b;
    margin-top: 1.25rem;
}

/* PIX */
.pix-qr-frame {
    display: inline-block;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}
.pix-qr-frame img {
    display: block;
    width: 220px;
    height: 220px;
}
.pix-steps {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    text-align: left;
    display: grid;
    gap: .65rem;
}
.pix-steps li {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .85rem;
    color: #475569;
}
.pix-steps .step-n {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pay-primary, #0d6efd) 12%, white);
    color: var(--pay-primary, #0d6efd);
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pix-copiacola {
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    border-radius: 10px 0 0 10px !important;
}
.pix-waiting {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.pix-waiting .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pay-primary, #0d6efd);
    animation: pixPulse 1.4s ease-in-out infinite;
}
.pix-waiting .dot:nth-child(2) { animation-delay: .2s; }
.pix-waiting .dot:nth-child(3) { animation-delay: .4s; }
@keyframes pixPulse {
    0%, 80%, 100% { opacity: .25; transform: scale(.85); }
    40% { opacity: 1; transform: scale(1); }
}

/* Boleto */
.boleto-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--pay-primary, #0d6efd) 10%, white);
    color: var(--pay-primary, #0d6efd);
    font-size: 1.8rem;
}

/* Cartão */
.card-brands {
    display: flex;
    gap: .4rem;
    margin-bottom: 1.25rem;
}
.card-brands span {
    font-size: .68rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: .2rem .5rem;
    letter-spacing: .02em;
}
.mp-field-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .4rem;
}
.mp-field-label i { color: var(--pay-primary, #0d6efd); }
.mp-field {
    height: 48px;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.mp-field:focus-within,
.mp-field-input:focus {
    border-color: var(--pay-primary, #0d6efd);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pay-primary, #0d6efd) 15%, transparent);
    outline: none;
}
select.mp-field,
input.mp-field-input {
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.pay-submit-btn {
    border-radius: 10px;
    padding: .85rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--pay-primary, #0d6efd) 35%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.pay-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--pay-primary, #0d6efd) 45%, transparent);
}
.pay-submit-btn:disabled {
    opacity: .7;
}

/* Título de seção numerado (checkout da loja: "1 Seus dados", "2 Forma de pagamento"...) */
.pay-step-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.pay-step-title .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pay-primary, #0d6efd);
    color: #fff;
    font-size: .82rem;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cartões de seleção de forma de pagamento (checkout da loja) */
.pay-method-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    height: 100%;
}
.pay-method-card:hover {
    border-color: color-mix(in srgb, var(--pay-primary, #0d6efd) 40%, #e2e8f0);
}
.pay-method-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--pay-primary, #0d6efd);
    flex: none;
}
.pay-method-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.15rem;
    flex: none;
    transition: background .2s ease, color .2s ease;
}
.pay-method-card__title {
    font-weight: 600;
    font-size: .92rem;
    color: #1e293b;
    margin: 0;
}
.pay-method-card__subtitle {
    font-size: .74rem;
    color: #64748b;
    margin: 0;
}
.pay-method-card.is-selected {
    border-color: var(--pay-primary, #0d6efd);
    background: color-mix(in srgb, var(--pay-primary, #0d6efd) 6%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pay-primary, #0d6efd) 12%, transparent);
}
.pay-method-card.is-selected .pay-method-card__icon {
    background: var(--pay-primary, #0d6efd);
    color: #fff;
}

/* Resumo do pedido (checkout da loja) */
.order-summary-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
}
.order-summary-item__thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.order-summary-item__thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1rem;
}
.order-summary-item__name {
    font-size: .86rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}
.order-summary-item__qty {
    font-size: .76rem;
    color: #64748b;
    margin: 0;
}

/* Carrinho */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.cart-item:first-child {
    padding-top: 0;
}
.cart-item__thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.cart-item__thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    flex: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.3rem;
}
.cart-item__name {
    font-weight: 600;
    font-size: .95rem;
    color: #1e293b;
    margin: 0 0 .15rem;
}
.cart-item__name:hover {
    color: var(--pay-primary, #0d6efd);
}
.cart-item__price {
    font-size: .8rem;
    color: #64748b;
    margin: 0;
}
.cart-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    flex: none;
}
.cart-qty button {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8fafc;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    transition: background .15s ease, color .15s ease;
}
.cart-qty button:hover {
    background: color-mix(in srgb, var(--pay-primary, #0d6efd) 10%, white);
    color: var(--pay-primary, #0d6efd);
}
.cart-qty input {
    width: 40px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: .9rem;
    -moz-appearance: textfield;
}
.cart-qty input::-webkit-outer-spin-button,
.cart-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cart-item__subtotal {
    font-weight: 700;
    color: #1e293b;
    min-width: 84px;
    text-align: right;
    flex: none;
}
.cart-item__remove {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid #fecaca;
    color: #ef4444;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    transition: background .15s ease;
}
.cart-item__remove:hover {
    background: #fef2f2;
}

/* Em telas estreitas a linha única (miniatura + nome + quantidade + subtotal
   + remover) não cabe e ou estoura a largura ou espreme tudo — quebra em
   2 linhas: [miniatura, nome, remover] em cima e [quantidade, subtotal]
   embaixo. flex-basis:100% no formulário de quantidade força a quebra de
   linha ali, sem precisar mudar a estrutura do HTML. */
@media (max-width: 575.98px) {
    .cart-item {
        flex-wrap: wrap;
        row-gap: .65rem;
    }
    .cart-item__thumb,
    .cart-item__thumb-placeholder {
        width: 52px;
        height: 52px;
        order: 1;
    }
    .cart-item > .flex-grow-1 {
        order: 2;
    }
    .cart-item-remove-form {
        order: 3;
    }
    .cart-item-form {
        order: 4;
        flex-basis: 100%;
    }
    .cart-item__subtotal {
        order: 5;
        margin-left: auto;
        min-width: 0;
    }
}

/* Seletor de método (abas usadas nas cobranças, que têm até 3 formas) */
.pay-method-tabs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.pay-method-tabs .nav-link {
    border-radius: 999px;
    padding: .5rem 1.1rem;
    font-weight: 600;
    font-size: .88rem;
    color: #475569;
    background: #f1f5f9;
    border: 1.5px solid transparent;
}
.pay-method-tabs .nav-link.active {
    background: color-mix(in srgb, var(--pay-primary, #0d6efd) 12%, white);
    color: var(--pay-primary, #0d6efd);
    border-color: color-mix(in srgb, var(--pay-primary, #0d6efd) 30%, white);
}
