.bb-cart-file-uploader {
    --bb-upload-cols-desktop: 3;
    --bb-upload-cols-mobile: 2;
    margin: 32px 0 10px;
    padding: 24px 0 4px;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.bb-cart-upload-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.bb-cart-upload-heading h3,
.bb-checkout-files h3 {
    margin: 0 0 5px;
    font-size: 1.05rem;
    line-height: 1.3;
}

.bb-cart-upload-heading p {
    margin: 0;
    color: #68717d;
    font-size: .92rem;
}

.bb-cart-upload-limit {
    flex: 0 0 auto;
    color: #68717d;
    font-size: .82rem;
    white-space: nowrap;
}

.bb-cart-upload-grid {
    display: grid;
    grid-template-columns: repeat(var(--bb-upload-cols-desktop), minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.bb-upload-dropzone,
.bb-upload-file-card {
    position: relative;
    display: flex;
    min-width: 0;
    aspect-ratio: 1 / 1;
    min-height: 150px;
    border-radius: 10px;
    background: #fff;
}

.bb-upload-dropzone {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    border: 2px dashed #9ba6b2;
    color: #344054;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.bb-upload-dropzone:hover,
.bb-upload-dropzone:focus-visible,
.bb-upload-dropzone.is-dragging {
    outline: none;
    border-color: currentColor;
    background: #f7f9fb;
}

.bb-upload-dropzone.is-dragging {
    transform: translateY(-2px);
}

.bb-upload-dropzone-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #d4dae1;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.bb-upload-dropzone strong {
    max-width: 220px;
    font-size: .95rem;
    line-height: 1.25;
}

.bb-upload-dropzone span,
.bb-upload-dropzone small {
    color: #7a8491;
    font-size: .78rem;
    line-height: 1.25;
}

.bb-upload-file-card {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 22px 18px;
    border: 1px solid #e0e4e8;
    text-align: center;
    overflow: hidden;
}

.bb-upload-file-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 68px;
    border: 1px solid #d7dce2;
    border-radius: 6px;
    background: #f7f8fa;
    color: #667085;
    font-weight: 700;
    font-size: .76rem;
}

.bb-upload-file-name {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
    font-weight: 600;
    font-size: .9rem;
}

.bb-upload-file-size {
    color: #7b8490;
    font-size: .78rem;
}

.bb-upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #697386;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bb-upload-remove:hover,
.bb-upload-remove:focus-visible {
    background: #f0f2f4;
    color: #111827;
    outline: none;
}

.bb-cart-upload-input {
    position: fixed !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.bb-cart-upload-notice {
    min-height: 0;
    margin: 0 0 10px;
    font-size: .86rem;
}

.bb-cart-upload-notice:empty {
    display: none;
}

.bb-cart-upload-notice.is-error {
    color: #b42318;
}

.bb-cart-upload-notice.is-success {
    color: #067647;
}

.bb-cart-upload-notice.is-progress {
    color: #475467;
}

.bb-cart-file-uploader.is-busy {
    cursor: progress;
}

.bb-cart-file-uploader.is-busy .bb-upload-dropzone,
.bb-cart-file-uploader.is-busy .bb-upload-remove {
    pointer-events: none;
    opacity: .65;
}

.bb-checkout-files {
    margin: 18px 0 20px;
    padding: 16px;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    background: #fff;
}

.bb-checkout-files-list {
    display: grid;
    gap: 8px;
}

.bb-checkout-file-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.bb-checkout-file-row:last-child {
    border-bottom: 0;
}

.bb-checkout-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-checkout-file-size {
    color: #7a8491;
    font-size: .8rem;
}

@media (max-width: 767px) {
    .bb-cart-upload-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .bb-cart-upload-limit {
        white-space: normal;
    }

    .bb-upload-dropzone,
    .bb-upload-file-card {
        min-height: 130px;
        padding: 14px;
    }

    .bb-upload-dropzone strong {
        font-size: .86rem;
    }
}

/* ============================================================
 * V0.2.0 - miniaturas, vínculo com produto e observações
 * ============================================================ */
.bb-upload-file-preview {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 2px;
}

.bb-upload-file-thumb {
    display: block;
    width: 78px;
    height: 78px;
    object-fit: cover;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #f7f8fa;
}

.bb-upload-file-linked {
    width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667085;
    font-size: .72rem;
    line-height: 1.25;
}

.bb-upload-manage {
    position: absolute;
    left: 7px;
    bottom: 7px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #b8bec6;
    color: #fff;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.bb-upload-manage:hover,
.bb-upload-manage:focus-visible {
    outline: none;
    background: #8f98a3;
    transform: scale(1.05);
}

.bb-upload-modal[hidden] {
    display: none !important;
}

.bb-upload-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.bb-upload-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .52);
}

.bb-upload-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}

.bb-upload-modal-close {
    position: absolute;
    top: 8px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #667085;
    font-size: 24px;
    cursor: pointer;
}

.bb-upload-modal-close:hover,
.bb-upload-modal-close:focus-visible {
    background: #f2f4f7;
    color: #111827;
    outline: none;
}

.bb-upload-modal-head {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 0 34px 20px 0;
}

.bb-upload-modal-head h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.bb-upload-modal-file-name {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667085;
    font-size: .83rem;
}

.bb-upload-modal-preview {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    overflow: hidden;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #f7f8fa;
    color: #667085;
    font-size: .76rem;
    font-weight: 700;
}

.bb-upload-modal-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-upload-modal-label {
    display: block;
    margin: 0 0 6px;
    color: #344054;
    font-size: .84rem;
    font-weight: 600;
}

.bb-upload-product-select,
.bb-upload-note {
    width: 100%;
    margin: 0 0 17px;
}

.bb-upload-note {
    min-height: 110px;
    resize: vertical;
}

.bb-upload-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bb-upload-modal-open,
.bb-upload-modal-open body {
    overflow: hidden;
}

.bb-linked-files-footer {
    display: grid;
    gap: 6px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, .12);
}

.bb-linked-file-footer-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.bb-linked-file-thumb,
.bb-linked-file-mini-icon {
    width: 34px;
    height: 34px;
    border: 1px solid #dfe3e8;
    border-radius: 5px;
    background: #f7f8fa;
}

.bb-linked-file-thumb {
    display: block;
    object-fit: cover;
}

.bb-linked-file-mini-icon {
    display: grid;
    place-items: center;
    color: #667085;
    font-size: .58rem;
    font-weight: 700;
}

.bb-linked-file-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.bb-linked-file-copy strong,
.bb-linked-file-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.bb-linked-file-copy strong {
    color: #344054;
    font-size: .77rem;
    font-weight: 600;
}

.bb-linked-file-copy small,
.bb-checkout-file-main small {
    display: block;
    color: #667085;
    font-size: .72rem;
    line-height: 1.35;
}

.bb-checkout-file-main {
    min-width: 0;
}

@media (max-width: 767px) {
    .bb-upload-modal {
        padding: 12px;
    }

    .bb-upload-modal-dialog {
        padding: 20px 16px 16px;
    }

    .bb-upload-modal-head {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
    }

    .bb-upload-modal-preview {
        width: 58px;
        height: 58px;
    }
}

.bb-checkout-file-thumb {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: cover;
    border: 1px solid #dfe3e8;
    border-radius: 5px;
    background: #f7f8fa;
}

/* ============================================================
 * V0.3.0 - histórico de atendimento e comentários globais
 * ============================================================ */
.bb-upload-file-record-count {
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8a94a1;
    font-size: .68rem;
    line-height: 1.2;
}

.bb-upload-global-manage {
    position: absolute;
    left: 7px;
    bottom: 7px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #b8bec6;
    color: #fff;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.bb-upload-global-manage:hover,
.bb-upload-global-manage:focus-visible {
    outline: none;
    background: #8f98a3;
    transform: scale(1.05);
}

.bb-cart-file-uploader.is-busy .bb-upload-global-manage,
.bb-cart-file-uploader.is-busy .bb-upload-manage {
    pointer-events: none;
    opacity: .65;
}

.bb-upload-modal-dialog {
    width: min(620px, 100%);
    padding: 26px;
}

.bb-upload-modal-heading-copy {
    min-width: 0;
}

.bb-upload-product-field[hidden] {
    display: none !important;
}

.bb-upload-history {
    margin: 2px 0 18px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    overflow: hidden;
    background: #fbfcfd;
}

.bb-upload-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid #eaecf0;
    background: #f7f8fa;
}

.bb-upload-history-head > div {
    min-width: 0;
}

.bb-upload-history-head strong {
    display: block;
    color: #344054;
    font-size: .86rem;
    line-height: 1.3;
}

.bb-upload-history-head small {
    display: block;
    margin-top: 2px;
    color: #7a8491;
    font-size: .72rem;
    line-height: 1.3;
}

.bb-upload-history-count {
    flex: 0 0 auto;
    color: #7a8491;
    font-size: .72rem;
    white-space: nowrap;
}

.bb-upload-history-list {
    display: grid;
    gap: 0;
    max-height: 220px;
    overflow: auto;
    padding: 0 14px;
}

.bb-upload-history-entry {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eef0f2;
    color: #344054;
    font-size: .8rem;
    line-height: 1.4;
}

.bb-upload-history-entry:last-child {
    border-bottom: 0;
}

.bb-upload-history-entry time {
    color: #667085;
    font-size: .74rem;
    white-space: nowrap;
}

.bb-upload-history-entry span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bb-upload-history-empty {
    padding: 16px 0;
    color: #98a2b3;
    font-size: .78rem;
    text-align: center;
}

.bb-upload-note {
    min-height: 92px;
    margin-bottom: 5px;
}

.bb-upload-note-hint {
    margin: 0 0 18px;
    color: #8a94a1;
    font-size: .72rem;
    line-height: 1.35;
}

.bb-upload-modal-chat {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #667085;
    font-size: 25px;
    font-weight: 400;
}

/* No rodapé do produto exibimos somente o log solicitado. */
.bb-linked-files-footer.bb-service-log {
    display: grid;
    gap: 3px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, .12);
}

.bb-service-log-line {
    color: #596273;
    font-size: .76rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* Linha global: fica entre os produtos e a linha de ações do carrinho. */
.bb-cart-global-comments-row[hidden] {
    display: none !important;
}

.bb-cart-global-comments-cell {
    padding-top: 10px !important;
    padding-bottom: 12px !important;
}

.bb-cart-global-comments {
    padding: 11px 13px;
    border: 1px solid #e4e7ec;
    border-radius: 7px;
    background: #fafbfc;
}

.bb-cart-global-comments-title {
    margin-bottom: 5px;
    color: #344054;
    font-size: .78rem;
    font-weight: 600;
}

.bb-cart-global-comments-list {
    display: grid;
    gap: 3px;
}

.bb-checkout-global-comments {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.bb-checkout-global-comments > strong {
    margin-bottom: 2px;
    color: #344054;
    font-size: .82rem;
}

.bb-checkout-log-line {
    margin-top: 2px;
}

@media (max-width: 767px) {
    .bb-upload-modal-dialog {
        padding: 20px 15px 15px;
    }

    .bb-upload-history-entry {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .bb-upload-history-entry time {
        white-space: normal;
    }

    .bb-upload-history-head {
        gap: 8px;
    }
}

/* ============================================================
 * V0.3.1 - cards visuais e estado dos botões de atendimento
 * ============================================================ */

.bb-upload-file-card.has-preview {
    padding: 0;
    gap: 0;
}

.bb-upload-file-card.has-preview .bb-upload-file-preview {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.bb-upload-file-card.has-preview .bb-upload-file-thumb {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
}

.bb-upload-file-card .bb-upload-file-name,
.bb-upload-file-card .bb-upload-file-size {
    display: none !important;
}

.bb-upload-manage,
.bb-upload-global-manage {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 28px !important;
    text-align: center !important;
    text-indent: 0 !important;
    vertical-align: middle !important;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
}

.bb-upload-manage.has-data,
.bb-upload-global-manage.has-data {
    background: #35a853 !important;
    color: #fff !important;
}

.bb-upload-manage.has-data:hover,
.bb-upload-manage.has-data:focus-visible,
.bb-upload-global-manage.has-data:hover,
.bb-upload-global-manage.has-data:focus-visible {
    background: #2d9147 !important;
}

.bb-upload-file-card.has-preview .bb-upload-remove,
.bb-upload-file-card.has-preview .bb-upload-manage {
    z-index: 3;
}

.bb-upload-file-card.has-preview .bb-upload-remove {
    background: rgba(255,255,255,.88);
}

/* ============================================================
 * V0.3.2 - botão excluir e histórico ocupando Produto -> Subtotal
 * ============================================================ */

/* Reset completo para impedir que Flatsome/WooCommerce aumente ou desalinhe o botão X. */
.bb-upload-remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 26px !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    aspect-ratio: 1 / 1 !important;
    top: 8px !important;
    right: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(100, 116, 139, .18) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .94) !important;
    color: #64748b !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    text-transform: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .10) !important;
    transform: none !important;
}

.bb-upload-remove > span {
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transform: translateY(-1px) !important;
}

.bb-upload-remove:hover,
.bb-upload-remove:focus-visible {
    background: #f8fafc !important;
    color: #334155 !important;
    border-color: rgba(51, 65, 85, .28) !important;
    outline: none !important;
}

/* Cada histórico vira uma linha independente logo abaixo do produto.
 * As células vazias preservam as colunas Remover/Imagem; o conteúdo começa em Produto
 * e o colspan é calculado via JS até a coluna Subtotal. */
.bb-cart-item-service-row > td {
    border-top: 0 !important;
}

.bb-cart-item-service-spacer {
    padding: 0 !important;
    background: transparent !important;
}

.bb-cart-item-service-cell {
    padding: 0 0 12px !important;
    vertical-align: top !important;
    background: transparent !important;
}

.bb-cart-item-service-cell .bb-linked-files-footer.bb-service-log {
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 0 2px !important;
    border-top: 1px dashed rgba(0, 0, 0, .12) !important;
}

.bb-cart-item-service-cell .bb-service-log-line {
    width: 100%;
    max-width: none;
}

@media (max-width: 767px) {
    .bb-cart-item-service-row {
        width: 100%;
    }

    .bb-cart-item-service-row .bb-cart-item-service-spacer {
        display: none !important;
    }

    .bb-cart-item-service-row .bb-cart-item-service-cell {
        display: table-cell !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}


/* ============================================================
 * V0.3.3 - vínculo múltiplo com cards-resumo dos itens do carrinho
 * ============================================================ */
.bb-upload-product-field {
    margin: 0 0 18px;
}

.bb-upload-product-field-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.bb-upload-product-field-head .bb-upload-modal-label {
    margin: 0;
}

.bb-upload-product-field-head small {
    color: #7a8491;
    font-size: .7rem;
    line-height: 1.3;
    text-align: right;
}

.bb-upload-product-list {
    display: grid;
    gap: 8px;
    max-height: 285px;
    overflow: auto;
    padding: 2px;
}

.bb-upload-product-empty {
    padding: 16px;
    border: 1px dashed #d0d5dd;
    border-radius: 9px;
    color: #7a8491;
    font-size: .78rem;
    text-align: center;
}

.bb-upload-product-option {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 11px;
    min-height: 68px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid #dfe3e8;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.bb-upload-product-option:hover {
    border-color: #b7bec8;
    background: #fbfcfd;
}

.bb-upload-product-option.is-selected {
    border-color: #27a857;
    background: #f2fbf5;
    box-shadow: inset 0 0 0 1px rgba(39, 168, 87, .08);
}

.bb-upload-product-checkbox {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.bb-upload-product-media {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border: 1px solid #e2e5e9;
    border-radius: 7px;
    background: #f7f8fa;
}

.bb-upload-product-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bb-upload-product-placeholder {
    color: #98a2b3;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.bb-upload-product-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.bb-upload-product-copy > strong {
    overflow: hidden;
    color: #273142;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-upload-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.bb-upload-product-meta small {
    color: #667085;
    font-size: .7rem;
    line-height: 1.25;
}

.bb-upload-product-check {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: 1px solid #c9ced5;
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.bb-upload-product-option.is-selected .bb-upload-product-check {
    border-color: #27a857;
    background: #27a857;
    color: #fff;
}

.bb-upload-product-checkbox:focus-visible ~ .bb-upload-product-check {
    outline: 2px solid rgba(39, 168, 87, .28);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .bb-upload-product-field-head {
        display: block;
    }

    .bb-upload-product-field-head small {
        display: block;
        margin-top: 3px;
        text-align: left;
    }

    .bb-upload-product-option {
        grid-template-columns: 48px minmax(0, 1fr) 26px;
        gap: 9px;
        min-height: 62px;
    }

    .bb-upload-product-media {
        width: 48px;
        height: 48px;
    }
}


/* ============================================================
 * V0.3.4 - excluir sobre a borda + remoção individual de registros
 * ============================================================ */

/* Permite que metade do botão X fique para fora do card sem ser recortada. */
.bb-upload-file-card {
    overflow: visible !important;
}

.bb-upload-file-card.has-preview .bb-upload-file-preview {
    border-radius: 9px;
    overflow: hidden !important;
}

/* Centro do botão exatamente sobre o encontro das bordas superior/direita. */
.bb-upload-remove,
.bb-upload-file-card.has-preview .bb-upload-remove {
    top: 0 !important;
    right: 0 !important;
    z-index: 6 !important;
    transform: translate(50%, -50%) !important;
    background: #fff !important;
}

/* Cada registro de produto recebe seu próprio X antes do texto. */
.bb-service-log-line-editable {
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    min-width: 0;
}

.bb-service-log-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.bb-service-log-delete,
.bb-upload-history-delete {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d8dde4 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #7a8491 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-align: center !important;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-shadow: none !important;
}

.bb-service-log-delete {
    margin-top: 1px !important;
}

.bb-service-log-delete:hover,
.bb-service-log-delete:focus-visible,
.bb-upload-history-delete:hover,
.bb-upload-history-delete:focus-visible {
    border-color: #b42318 !important;
    color: #b42318 !important;
    background: #fff5f4 !important;
    outline: none !important;
}

.bb-upload-history-entry.has-delete {
    grid-template-columns: 20px 122px minmax(0, 1fr) !important;
    gap: 8px !important;
}

.bb-cart-file-uploader.is-busy .bb-service-log-delete,
.bb-cart-file-uploader.is-busy .bb-upload-history-delete {
    pointer-events: none;
    opacity: .55;
}

@media (max-width: 767px) {
    .bb-upload-history-entry.has-delete {
        grid-template-columns: 20px minmax(0, 1fr) !important;
        gap: 2px 8px !important;
    }

    .bb-upload-history-entry.has-delete time,
    .bb-upload-history-entry.has-delete span {
        grid-column: 2;
    }

    .bb-upload-history-entry.has-delete .bb-upload-history-delete {
        grid-row: 1 / span 2;
        align-self: start;
    }
}


/* ============================================================
 * V0.3.5 - comentários direcionados por produto
 * ============================================================ */
.bb-upload-note-target-field {
    margin: 0 0 16px;
}

.bb-upload-note-target-field[hidden] {
    display: none !important;
}

.bb-upload-note-target-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.bb-upload-note-target-head .bb-upload-modal-label {
    margin: 0;
}

.bb-upload-note-target-head small {
    color: #7a8491;
    font-size: .7rem;
    line-height: 1.3;
    text-align: right;
}

.bb-upload-note-target-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.bb-upload-note-target-empty {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
    color: #7a8491;
    font-size: .73rem;
}

.bb-upload-note-target-option {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 8px 9px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.bb-upload-note-target-option.is-selected {
    border-color: #27a857;
    background: #f2fbf5;
}

.bb-upload-note-target-checkbox {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.bb-upload-note-target-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.bb-upload-note-target-copy strong {
    overflow: hidden;
    color: #273142;
    font-size: .73rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-upload-note-target-copy small {
    color: #667085;
    font-size: .66rem;
}

.bb-upload-note-target-check {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border: 1px solid #c9ced5;
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 12px;
    font-weight: 700;
}

.bb-upload-note-target-option.is-selected .bb-upload-note-target-check {
    border-color: #27a857;
    background: #27a857;
    color: #fff;
}

.bb-upload-history-entry {
    align-items: flex-start !important;
}

.bb-upload-history-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.bb-upload-history-prefix {
    color: #667085;
    font-size: .72rem;
}

.bb-upload-history-prefix time {
    color: inherit;
}

@media (max-width: 767px) {
    .bb-upload-note-target-head {
        display: block;
    }

    .bb-upload-note-target-head small {
        display: block;
        margin-top: 3px;
        text-align: left;
    }

    .bb-upload-note-target-list {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
 * V0.3.6 - destino implícito de comentários + checkout thumbs-only
 * ============================================================ */

.bb-upload-note-target-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.bb-upload-note-target-head > div {
    min-width: 0;
}

.bb-upload-note-target-head small {
    display: block;
    margin-top: 3px;
    color: #7a8491;
    font-size: .7rem;
    line-height: 1.3;
}

.bb-upload-note-target-clear {
    flex: 0 0 auto;
    margin: 0 0 2px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #667085 !important;
    font-size: .72rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    box-shadow: none !important;
    cursor: pointer;
}

.bb-upload-note-target-clear:hover,
.bb-upload-note-target-clear:focus-visible {
    color: #344054 !important;
}

.bb-checkout-files.bb-checkout-files-thumbs-only {
    margin: 18px 0 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.bb-checkout-thumb-grid {
    display: grid;
    gap: 10px;
    width: 100%;
}

/* Checkout responsivo pelo número de anexos: 1 = 100%, 2 = 2 colunas, 3+ = até 3 por linha. */
.bb-checkout-thumb-grid.bb-thumb-count-1 {
    grid-template-columns: minmax(0, 1fr);
}

.bb-checkout-thumb-grid.bb-thumb-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bb-checkout-thumb-grid.bb-thumb-count-3plus {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bb-checkout-thumb-card {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    border-radius: 9px;
    background: #fff;
}

.bb-checkout-thumb-card .bb-checkout-file-thumb {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.bb-checkout-thumb-card .bb-checkout-file-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #98a2b3;
    font-size: 1.5rem;
}

@media (max-width: 767px) {
    .bb-upload-note-target-head {
        align-items: flex-start;
    }

    .bb-checkout-thumb-grid {
        gap: 7px;
    }
}
