/* Carrinho otimizado: calculadora nativa WC oculta (submit via JS); CEP na barra Frete Smart */
body.wc-frete-smart-cart-optimize .woocommerce-shipping-calculator {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.wc-frete-smart-cart-optimize .wc-frete-smart-cart-cep-bar,
body.wc-frete-smart-cart-optimize #wc-frete-smart-cart-cep-bar {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
    visibility: visible !important;
}

body.wc-frete-smart-cart-optimize .wc-frete-smart-cart-cep-bar + .woocommerce-shipping-destination,
body.wc-frete-smart-cart-optimize tr.shipping td .woocommerce-shipping-destination {
    display: block;
    clear: both;
    width: 100%;
    margin-top: 10px;
}

body.wc-frete-smart-cart-optimize .wc-frete-smart-cart-cep-bar #wc-frete-smart-nao-sei-cep {
    display: inline-block;
    font-size: 13px;
}

body.wc-frete-smart-cart-optimize.wc-frete-smart-cart-calculating #wc-frete-smart-cart-salvar {
    opacity: 0.6;
    pointer-events: none;
}

body.wc-frete-smart-cart-optimize .wc-frete-smart-cart-cep-error {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #b32d2e;
}


/* Popup buscar CEP */
#wc-frete-smart-find-cep-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 70px 30px 30px 30px;
    max-width: 600px;
    width: 90%;
    height: 90%;
    z-index: 9999999999 !important;
    overflow: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Variação para mobile */
@media (max-width: 768px) {
    #wc-frete-smart-find-cep-popup {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

#wc-frete-smart-find-cep-popup.active {
    display: block;
}

#wc-frete-smart-find-cep-form select,
#wc-frete-smart-find-cep-form input {
    width: 100% !important;
    height: 50px !important;
    border: 2px solid #ececec !important;
    margin-bottom: 10px;
}

#wc-frete-smart-find-cep-form select:focus,
#wc-frete-smart-find-cep-form input:focus {
    border-color: black !important;
}

.popup-label {
    font-size: 11px !important;
    font-weight: normal !important;
}

#wc-frete-smart-find-cep-result {
    font-size: 14px;
    margin-top: 20px;
}

#find-cep-buscar {
    width: 100% !important;
    height: 50px !important;
    font-size: 13px;
    margin-top: 10px;
}

.cep-item {
    cursor: pointer;
    margin-bottom: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ebebeb;
    transition: all 0.2s ease;
    position: relative;
}

.cep-item:hover {
    border-color: #ccc;
    background: #f2f2f2;
}

.cep-item strong {
    font-size: 14px;
    color: black;
    font-weight: bold;
}

.cep-item .cep-item-rua {
    color: black;
}

.cep-item span {
    display: block;
    font-size: 13px;
    line-height: 16px;
    color: #999;
}

.usar-cep-btn {
    font-size: 13px;
    line-height: 0px;
    background-color: transparent;
    color: black !important;
    padding: 0px !important;
    border: none !important;
    position: absolute;
    right: 20px;
    top: 50%;
    text-transform: none;
    letter-spacing: 0px;
}


/* Popup inserir CEP */
#wc-frete-smart-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 70px 30px 20px 30px;
    z-index: 999999999 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 350px;
    border-radius: 10px;
}

#wc-frete-smart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999998 !important;
}

.popup-title {
    font-size: 18px !important;
    line-height: 22px !important;
    width: 250px;
    display: block;
}

.popup-desc {
    font-size: 14px;
    line-height: 18px;
    color: #999;
}

.popup-close {
    position: absolute;
    top: 30px;
    left: 30px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    color: #ccc;
    line-height: 0px;
}

/* Campo CEP compartilhado: modal (PDP) e carrinho otimizado */
.wc-frete-smart-cep-field {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 10px 10px 10px 15px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.wc-frete-smart-cep-field.focused {
    border-color: #000;
}

#wc-frete-smart-popup .wc-frete-smart-cep-field {
    margin-bottom: 10px;
}

body.wc-frete-smart-cart-optimize .wc-frete-smart-cart-cep-bar .wc-frete-smart-cep-field {
    margin-bottom: 0;
}

.wc-frete-smart-cep-field .wc-fs-icon {
    line-height: 40px;
    align-self: center;
}

.wc-frete-smart-cep-field input#wc-frete-smart-cep,
.wc-frete-smart-cep-field input.input-text {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 45px !important;
    margin: 0 !important;
    border: none !important;
    outline: none;
    background: transparent;
    font-size: 18px;
    padding: 0 10px;
}

.wc-frete-smart-cep-field button.button,
.wc-frete-smart-cep-field button.btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    height: 45px !important;
    margin: 0 0 0 8px !important;
    padding: 0 16px !important;
    font-size: 13px;
    line-height: 40px !important;
    cursor: pointer;
}

.wc-fs-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    color: #ccc;
}

.wc-fs-icon svg {
    width: 100%;
    height: 100%;
}

.wc-fs-icon--location svg {
    fill: none;
    stroke: currentColor;
}

.wc-fs-icon--arrow-left svg {
    fill: currentColor;
}

.popup-close .wc-fs-icon {
    color: inherit;
}

#wc-frete-smart-opcoes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#wc-frete-smart-mensagem {
    width: 100% !important;
    margin-top: 0px;
    display: none;
    font-size: 13px;
    background-color: white !important;
    font-weight: bold;
}

#wc-frete-smart-mensagem.success {
    color: #46735D;
}

#wc-frete-smart-mensagem.error {
    color: #eb7252;
}

#wc-frete-smart-informar-depois, #wc-frete-smart-nao-sei-cep {
    font-size: 14px;
    text-decoration: underline;
    color: #999 !important;
    font-weight: bold;
    display: inline;
}

/* Calculadora de frete */
#wc-frete-smart-calculadora {
    margin-top: 30px;
    margin-bottom: 30px;
}

#wc-frete-smart-calculadora h4 {
    font-size: 14px;
    font-weight: normal !important;
    margin-bottom: 0px !important;
    color: #999;
    line-height: 20px;
}

#wc-frete-smart-inserir-cep {
    display: flex;
    align-items: center;
    gap: 3px;
}

#wc-frete-smart-inserir-cep span {
    font-size: 14px;
    font-weight: bold;
}

#wc-frete-smart-inserir-cep i {
    font-size: 12px;
}

#wc-frete-smart-resultados {
    margin-top: 10px;
    font-size: 13px;
    color: #999;
}

.wc-frete-smart-resultado {
    width: 100%;
    height: 40px;
    font-size: 13px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Centraliza o conteúdo na vertical */
    border: 1px solid #ececec;
    background-color: #cccccc10;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 0 10px !important;
}

.resultado-metodo {
    margin-right: 5px;
}

.resultado-preco {
    margin-left: auto;
}

/* Skeleton loading */
.loading-line {
    width: 100%;
    height: 40px;
    margin-bottom: 10px;
    border-radius: 5px;
    background: #f0f0f0;
    animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-color: #f0f0f0;
    }
    50% {
        background-color: #e0e0e0;
    }
    100% {
        background-color: #f0f0f0;
    }
}