/* ── Widget de Frete Global ──────────────────────────────────── */

/* Botão flutuante FAB */
#brd-sw-btn {
    position: fixed;
    bottom: 152px;
    right: 24px;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 52px;
    height: 52px;
    padding: 0 12px;
    overflow: hidden;
    background: #206BB3;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(32, 107, 179, 0.50);
    transition: width 0.3s ease, box-shadow 0.2s ease;
}
#brd-sw-btn:hover {
    width: 205px;
    justify-content: center;
    box-shadow: 0 6px 22px rgba(32, 107, 179, 0.65);
}
#brd-sw-btn svg {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-left: -2px;
}
#brd-sw-btn span {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin-left: 0;
    transition: max-width 0.3s ease, opacity 0.2s ease 0.05s, margin-left 0.3s ease;
}
#brd-sw-btn:hover span {
    max-width: 155px;
    opacity: 1;
    margin-left: 8px;
}

/* Overlay */
#brd-sw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    z-index: 9995;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#brd-sw-overlay.is-open {
    display: flex;
}

/* Modal */
#brd-sw-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 420px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

/* Header do modal */
#brd-sw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #eeeeee;
    flex-shrink: 0;
}
#brd-sw-title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0D0D0D !important;
    line-height: 1.2 !important;
}
#brd-sw-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999999;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}
#brd-sw-close:hover {
    color: #0D0D0D;
}

/* Corpo do modal */
#brd-sw-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Linha de input + botão */
#brd-sw-input-wrap {
    display: flex;
    gap: 8px;
}
#brd-sw-cep {
    flex: 1 !important;
    height: 44px !important;
    padding: 0 14px !important;
    border: 1.5px solid #c4c4c4 !important;
    border-radius: 9999px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #0D0D0D !important;
    background: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s !important;
    border-style: solid !important;
}
#brd-sw-cep:focus {
    border-color: #206BB3 !important;
    box-shadow: none !important;
    border-style: solid !important;
}
#brd-sw-submit {
    height: 44px;
    padding: 0 20px;
    background: #206BB3;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
#brd-sw-submit:hover {
    background: #183357;
}
#brd-sw-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Mensagem de status */
#brd-sw-msg {
    margin: 8px 0 0 !important;
    font-size: 12px !important;
    color: #888888;
    min-height: 16px;
    padding: 0 !important;
}
#brd-sw-msg.is-error {
    color: #c0392b !important;
}

/* Área de resultados */
#brd-sw-results {
    margin-top: 16px;
}

/* Grupos de transportadora — mesma estrutura visual do carrinho */
#brd-sw-results .brd-shipping-carrier-group {
    background: #ffffff;
    border: 1px solid #c4c4c4;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 8px;
}
#brd-sw-results .brd-shipping-carrier-group:first-child {
    margin-top: 0;
}
#brd-sw-results .brd-shipping-carrier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
#brd-sw-results .brd-shipping-carrier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: #f0f0f0;
    color: #555;
}
#brd-sw-results .brd-shipping-carrier-logo {
    height: 20px;
    width: auto;
    max-width: 80px;
    display: block;
    object-fit: contain;
}
#brd-sw-results .brd-shipping-carrier-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888888;
}
#brd-sw-results .brd-shipping-carrier-header--free .brd-shipping-carrier-name {
    color: #229a64;
}
#brd-sw-results .brd-shipping-carrier-gift {
    display: flex;
    align-items: center;
    color: #229a64;
}
#brd-sw-results .brd-shipping-carrier-rates {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}
#brd-sw-results .brd-shipping-rate-name {
    font-size: 13px;
    font-weight: 600;
    color: #0D0D0D;
    white-space: nowrap;
}
#brd-sw-results .brd-shipping-rate-prazo {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f4f8;
    border-radius: 99px;
    font-size: 11px;
    color: #5a7a99;
    white-space: nowrap;
}
#brd-sw-results .brd-shipping-rate-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #0D0D0D;
    white-space: nowrap;
    flex-shrink: 0;
}
#brd-sw-results .brd-shipping-rate-original {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}
#brd-sw-results .brd-shipping-rate-discount-badge {
    font-size: 11px;
    font-weight: 600;
    color: #1a7a4a;
    background: rgba(34, 154, 100, 0.1);
    border-radius: 4px;
    padding: 1px 5px;
}
#brd-sw-results .brd-shipping-rate-free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(34, 154, 100, 0.1);
    border: 1px solid rgba(34, 154, 100, 0.3);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: #229a64;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Item de rate — sem radio, apenas informativo */
#brd-sw-results .brd-sw-rate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid #d8d8d8;
}
#brd-sw-results .brd-sw-rate-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Disclaimer de simulação */
.brd-sw-disclaimer {
    font-size: 12px;
    color: #999999;
    text-align: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.5;
}

@media (max-width: 921px) {
    #brd-sw-btn {
        bottom: 64px;
        right: auto;
        left: 0;
        height: 40px;
        padding: 0 0 0 8px;
        justify-content: flex-start;
        border-radius: 0 9999px 9999px 0;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }

    #brd-sw-btn:hover {
        width: 52px;
        justify-content: flex-start;
    }

    #brd-sw-btn.brd-sw-peek {
        width: 188px;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.40);
    }

    #brd-sw-btn.brd-sw-peek span {
        max-width: 138px;
        opacity: 1;
        margin-left: 8px;
        transition-delay: 0.18s;
    }
}

/* Ocultar botão de frete quando o overlay de categorias mobile está aberto */
body.brd-mob-cat-open #brd-sw-btn { display: none !important; }
