/*
 * Astation Localização e Entrega
 * Versão: 3.5.7
 */

/* Barra de localização */
#astation-location-bar{
    background:#f4f4f4;
    color:#333e48;
    text-align:left;
    padding:10px 15px;
    font-size:13px;
    font-weight:400;
    width:100%;
    z-index:auto;
    border-top:1px solid #ececec;
    border-bottom:1px solid #ececec;
    box-shadow:0 1px 2px rgba(0,0,0,.03);
    display:flex;
    align-items:center;
    gap:8px;
    position:relative;
}

#astation-location-bar strong{
    color:inherit;
}

#astation-location-summary{
    flex:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

#astation-change-location{
    color:#333e48;
    margin-left:8px;
    text-decoration:underline;
    font-weight:400;
    flex-shrink:0;
    white-space:nowrap;
}

#astation-location-info{
    border:none;
    background:none;
    cursor:pointer;
    font-size:12px;
    padding:0 4px;
    color:#666;
    flex-shrink:0;
}

#astation-location-info:hover{
    color:#000;
}

/* Popup de localização */
#astation-location-popup{
    display:none;
    position:absolute;
    top:100%;
    left:15px;
    margin-top:8px;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    padding:12px;
    min-width:260px;
    max-width:350px;
    box-sizing:border-box;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
    z-index:999999;
}

#astation-location-popup.open{
    display:block;
}

.astation-popup-title{
    font-size:12px;
    font-weight:700;
    margin-bottom:6px;
    color:#666;
}

.astation-popup-content{
    font-size:13px;
    color:#333;
    word-break:break-word;
}

.astation-location-option{
    display:block;
    width:100%;
    background:#fff;
    border:0;
    border-bottom:1px solid #ececec;
    padding:8px 0;
    text-align:left;
    cursor:pointer;
    color:#333e48;
}

.astation-location-option:last-child{
    border-bottom:none;
}

.astation-location-option:hover{
    background:#f7f7f7;
}

.astation-option-label{
    display:block;
    font-size:11px;
    font-weight:700;
    color:#666;
    margin-bottom:2px;
}

.astation-option-value{
    display:block;
    font-size:13px;
    font-weight:400;
    color:#333;
    word-break:break-word;
}

/* Modal de CEP */
#astation-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:999999;
}

#astation-modal-overlay.open{
    display:flex;
}

#astation-modal{
    background:#fff;
    width:400px;
    max-width:92%;
    border-radius:12px;
    padding:24px;
    box-shadow:0 10px 40px rgba(0,0,0,.15);
}

#astation-modal h3{
    margin:0 0 10px;
}

#astation-modal p{
    margin:0 0 15px;
    color:#666;
}

#astation-cep{
    width:100%;
    box-sizing:border-box;
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    font-size:15px;
}

#astation-city-preview{
    margin-top:12px;
    min-height:24px;
    font-weight:600;
}

.astation-buttons{
    display:flex;
    gap:10px;
    margin-top:20px;
}

.astation-buttons button{
    flex:1;
    padding:12px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-weight:600;
}

#astation-confirm:not(:disabled){
    background:#1a73e8;
    color:#fff;
}

#astation-confirm:disabled{
    opacity:.5;
    cursor:not-allowed;
}

#astation-close{
    background:#f3f3f3;
}

/* Melhor Envio oculto como motor de cálculo */
.single-product #woocommerce-correios-calculo-de-frete-na-pagina-do-produto.containerCalculator,
.single-product .containerCalculator#woocommerce-correios-calculo-de-frete-na-pagina-do-produto{
    position:absolute !important;
    left:-99999px !important;
    top:auto !important;
    width:1px !important;
    height:1px !important;
    min-height:0 !important;
    max-height:1px !important;
    overflow:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    padding:0 !important;
    margin:0 !important;
}

/* Resultado de entrega na página do produto */
#astation-product-delivery-box{
    display:none;
    margin:8px 0 12px;
    padding:0;
    background:transparent;
    border:0;
    box-shadow:none;
    color:#333e48;
    font-size:13px;
    line-height:1.45;
}

#astation-product-delivery-box.show{
    display:block;
}

.single-product #astation-product-delivery-box{
    display:block;
    position:relative;
    left:auto;
    top:auto;
    width:auto;
    height:auto;
    max-height:none;
    overflow:visible;
    opacity:1;
    pointer-events:auto;
}

.astation-delivery-line,
.astation-delivery-text{
    display:inline;
    vertical-align:middle;
    font-size:13px;
    color:#333e48;
    line-height:1.4;
}

.astation-delivery-line strong,
.astation-other-delivery-item strong{
    font-weight:700;
}

.astation-delivery-error{
    color:#333e48;
    background:transparent;
    border:0;
    border-radius:0;
    padding:0;
    font-size:13px;
    line-height:1.4;
}

/* Etiqueta padrão: Frete rápido */
.astation-fast-badge,
.astation-archive-fast-badge{
    display:inline-flex;
    align-items:center;
    gap:5px;
    width:max-content;
    max-width:100%;
    padding:3px 8px;
    border:0;
    border-radius:6px;
    background:#e6f4ea;
    color:#1e8e3e;
    font-size:12px;
    font-weight:500;
    line-height:1.25;
    text-align:left;
    white-space:nowrap;
    vertical-align:middle;
}

.astation-fast-badge{
    margin:0 6px 0 0;
}

.astation-archive-fast-badge{
    margin:0;
    clear:both;
}

.astation-fast-badge *,
.astation-archive-fast-badge *{
    color:inherit;
    font-weight:inherit;
}

.astation-fast-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:12px;
    height:15px;
    min-width:12px;
    background:transparent;
    color:inherit;
}

.astation-fast-bolt-svg{
    display:block;
    width:11px;
    height:15px;
    fill:currentColor;
}

/* Outras opções de entrega */
#astation-other-delivery-toggle{
    display:inline-flex;
    align-items:center;
    gap:5px;
    margin-top:6px;
    padding:0;
    border:0;
    background:transparent;
    color:#333e48;
    font-size:13px;
    font-weight:400;
    text-decoration:underline;
    cursor:pointer;
}

#astation-other-delivery-toggle i{
    font-size:12px;
}

#astation-product-delivery-box #astation-other-delivery-toggle{
    display:flex;
    width:max-content;
    align-items:center;
    gap:5px;
    margin:7px 0 0 0;
    padding:0;
    clear:both;
}

#astation-other-delivery-options{
    display:none;
    margin-top:8px;
    padding:10px 12px;
    border:1px solid #ececec;
    border-radius:8px;
    background:#fff;
}

#astation-other-delivery-options.open{
    display:block;
}

#astation-product-delivery-box #astation-other-delivery-options{
    clear:both;
    width:100%;
    box-sizing:border-box;
}

.astation-other-delivery-note{
    display:flex;
    align-items:flex-start;
    gap:6px;
    margin-bottom:12px;
    font-size:12px;
    color:#666;
    line-height:1.35;
}

.astation-info-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:14px;
    height:14px;
    min-width:14px;
    margin-top:1px;
    border:1px solid #777;
    border-radius:50%;
    color:#666;
    font-size:10px;
    line-height:1;
    font-family:Arial, Helvetica, sans-serif;
    font-weight:700;
    font-style:normal;
    text-decoration:none;
}

.astation-other-delivery-item{
    padding:12px 0;
    margin:2px 0;
    border-top:1px solid #f0f0f0;
    font-size:13px;
    color:#333e48;
    line-height:1.4;
}

.astation-other-delivery-item:first-of-type{
    border-top:0;
}

/* Etiqueta em cards/listagens */
li.product .astation-archive-fast-badge,
.product .astation-archive-fast-badge,
.wc-block-grid__product .astation-archive-fast-badge,
.related.products .astation-archive-fast-badge,
.upsells.products .astation-archive-fast-badge,
.cross-sells .astation-archive-fast-badge,
.elementor-widget-woocommerce-products .astation-archive-fast-badge,
.elementor-products-grid .astation-archive-fast-badge,
.product-carousel .astation-archive-fast-badge,
.owl-item .astation-archive-fast-badge,
.slick-slide .astation-archive-fast-badge{
    display:inline-flex;
    align-self:flex-start;
    justify-self:start;
    width:max-content;
    max-width:100%;
}

@media (max-width:767px){
    #astation-location-bar{
        font-size:13px;
    }

    .astation-fast-badge,
    .astation-archive-fast-badge{
        font-size:12px;
    }
}

/* Grupo de etiquetas — camada oficial */
.astation-free-badge,
.astation-archive-free-badge{
    display:inline-flex;
    align-items:center;
    gap:5px;
    width:max-content;
    max-width:100%;
    padding:3px 8px;
    border:0;
    border-radius:6px;
    background:#e6f4ea;
    color:#1e8e3e;
    font-size:12px;
    font-weight:500;
    line-height:1.25;
    text-align:left;
    white-space:nowrap;
    vertical-align:middle;
}

.astation-archive-shipping-badges{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:5px;
    width:100%;
    max-width:100%;
    margin:0;
    clear:both;
    line-height:1;
}

.astation-archive-shipping-badges .astation-archive-free-badge,
.astation-archive-shipping-badges .astation-archive-fast-badge{
    flex:0 0 auto;
    align-self:center;
    line-height:1.25;
}

.astation-archive-free-badge{
    order:1;
}

.astation-archive-fast-badge{
    order:2;
}

.astation-product-free-row{
    display:block;
    margin:0 0 6px 0;
    padding:0;
    line-height:1.25;
}

/* Integração oficial das etiquetas nos cartões do carrinho */
.astation-cart-shipping-badges{
    margin:6px 0 0;
}

