/*
*
* Inclusão do logo da Rede
*
*/
#rede-credit-payment-form .payment-method-description {
    display: inline-flex;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

#rede-credit-payment-form .payment-method-description #logo-rede {
    width: 60px;
    margin-left: 10px;
}

/*
*
* Inclusão dos ícones das bandeiras dos cartões de crédito
*
*/
#payment .payment_methods li .payment_box .wc-credit-card-form-card-number {
    background-repeat: no-repeat;
    background-position: right 0.6180469716em center;
    background-size: 31px 20px;
    background-image: none;
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.visa {
    background-image: url("../images/cards/visa.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.mastercard {
    background-image: url("../images/cards/mastercard.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.laser {
    background-image: url("../images/cards/laser.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.dinersclub {
    background-image: url("../images/cards/diners.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.maestro {
    background-image: url("../images/cards/maestro.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.jcb {
    background-image: url("../images/cards/jcb.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.amex {
    background-image: url("../images/cards/amex.svg");
}

#payment .payment_methods li .payment_box .wc-credit-card-form-card-number.discover {
    background-image: url("../images/cards/discover.svg");
}

/*
*
* Inclusão dos ícones SVG nos inputs
*
*/
.rede-card {
    display: inline-block;
    position: relative;
}

.icon-rede-input {
    display: flex;
    align-items: center;
}

#labels-with-icons {
    display: flex;
}

select:focus {
    outline: none;
}

/*
*
* Ajustes à animação do cartão
*
*/
#rede-card-animation {
    margin: 10px 0 25px;
}

#rede-credit-payment-form {
    padding: 0 !important;
}

#rede-card-holder-name {
    text-transform: uppercase;
}

#rede-card-animation .jp-card .jp-card-front .jp-card-shiny {
    position: relative;
    top: -35px;
}

#rede-card-animation .jp-card .jp-card-front .jp-card-lower .jp-card-number {
    top: -30px;
    position: relative;
    margin-bottom: 0;
}

#rede-card-animation .jp-card .jp-card-front .jp-card-lower .jp-card-name {
    width: 275px;
    top: 60px;
    font-weight: 500;
}

#rede-card-animation .jp-card .jp-card-front .jp-card-lower .jp-card-expiry {
    top: 15px;
}

#rede-card-animation .jp-card .jp-card-front .jp-card-lower .jp-card-expiry::after,
#rede-card-animation .jp-card .jp-card-front .jp-card-lower .jp-card-expiry::before {
    opacity: 1;
}

.jp-card .jp-card-front .jp-card-lower .jp-card-expiry::after {
    top: 12px;
}

#rede-card-animation .jp-card .jp-card-back,
#rede-card-animation .jp-card .jp-card-front {
    background: #C1C1C1;
}

#rede-card-animation .jp-card .jp-card-back .jp-card-display,
#rede-card-animation .jp-card .jp-card-front .jp-card-display {
    opacity: 0.7;
}

/*
*
* Customizações Hub Joias
*
*/

/* 0 - Remove padding da payment_box e form-row */
.woocommerce-checkout #payment div.payment_box {
    padding: 0 !important;
}

.woocommerce-checkout #payment div.form-row {
    padding: 0 !important;
}

#payment .payment_methods li .payment_box fieldset.rede-payment-form {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* 1 - Remove borda do formulário */
#rede-credit-payment-form.rede-payment-form {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
}

/* 2 - Cor dos ícones SVG */
#rede-credit-payment-form .icon-rede-input svg path,
#rede-credit-payment-form .icon-rede-input svg rect {
    fill: #D1B787 !important;
}

/* 2.1 - Cor e tamanho dos ícones IMG */
#rede-credit-payment-form .icon-rede-input img {
    width: 20px !important;
    height: 14px !important;
    margin: 0 !important;
    padding: 0 0 0 2px !important;
    filter: brightness(0) saturate(100%) invert(76%) sepia(18%) saturate(594%) hue-rotate(6deg) brightness(92%) contrast(87%);
}

/* 3 - Títulos dos campos (labels) */
#rede-credit-payment-form #labels-with-icons,
#rede-credit-payment-form label {
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: none !important;
    padding-bottom: 5px;
    padding-top: 10px;
}

/* 3.1 - Ícone antes do título */
#rede-credit-payment-form #labels-with-icons .icon-rede-input {
    order: -1;
    margin-right: 6px;
}

/* 3.2 - Campos e cartão expandem 100% + Parcelas primeiro */
#rede-credit-payment-form .wc-payment-rede-form-fields {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Ordem: Parcelas > Número > Nome > Data+CVC */
#rede-credit-payment-form #rede-credit-installments-wrapper {
    order: 1;
}

#rede-credit-payment-form .wc-payment-rede-form-fields > .form-row:nth-child(2) {
    /* Número do Cartão */
    order: 2;
}

#rede-credit-payment-form .wc-payment-rede-form-fields > .form-row:nth-child(1) {
    /* Nome no Cartão */
    order: 3;
}

#rede-credit-payment-form .rede-credit-row-half {
    order: 4;
}

#rede-credit-payment-form .jp-card-container {
    width: 100% !important;
    max-width: 100% !important;
}

#rede-credit-payment-form .jp-card {
    min-width: unset !important;
}

/* 3.3 - Validade e CVC lado a lado */
#rede-credit-payment-form .rede-credit-row-half {
    display: flex;
    gap: 15px;
}

#rede-credit-payment-form .rede-credit-row-half > .form-row {
    flex: 1;
    min-width: 0;
}

/* 4 - Caixas de texto do formulário */
#rede-credit-payment-form .wc-payment-rede-form-fields input.input-text {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: #E7E7E7 !important;
    font-family: "Poppins", sans-serif;
    font-size: 12px !important;
    font-weight: 400;
    line-height: 10px;
    background-color: #FFFFFF !important;
    padding: 12px 15px 12px 15px !important;
    border-radius: 100px !important;
}

/* 5 - Select de parcelas */
#rede-credit-payment-form #rede-card-installments {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: #E7E7E7 !important;
    font-family: "Poppins", sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    background-color: #FFFFFF !important;
    padding: 12px 15px !important;
    border-radius: 100px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23999" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 10px !important;
}

/* Mobile */
@media (max-width: 768px) {
    #rede-card-animation {
        margin: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    #rede-card-animation .jp-card-container {
        margin: 0 auto !important;
        transform: scale(0.78);
        transform-origin: center center;
        flex-shrink: 0;
    }
}