/* Assistente de presentes de Natal (Ask Merry) - estilos do widget (prefixo cb-).
   O site repoe box-sizing: revert (custom-bootstrap.css) e fixa o viewport sem zoom:
   por isso box-sizing explicito e inputs com 16px (evita zoom no iOS). */
.cb-launcher, .cb-launcher *, .cb-panel, .cb-panel * {
    box-sizing: border-box;
}

.cb-panel, .cb-launcher {
    --cb-vermelho: #d0021b;
    --cb-vermelho-escuro: #a80016;
    --cb-bege: #ede6e3;
    --cb-serifa: 'Bodoni Moda', 'Playfair Display', Didot, 'Bodoni 72', 'Bodoni MT', 'Times New Roman', serif;
}

.cb-launcher {
    position: fixed;
    left: 20px;
    bottom: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 24px;
    background: var(--cb-vermelho);
    color: #fff;
    cursor: pointer;
    font-family: var(--cb-serifa);
    font-size: 15px;
    letter-spacing: .8px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

    .cb-launcher:hover, .cb-launcher:focus {
        background: var(--cb-vermelho-escuro);
        outline: 0;
    }

    .cb-launcher:focus-visible, .cb-close:focus-visible, .cb-chip:focus-visible, .cb-send:focus-visible, .cb-size:focus-visible {
        outline: 2px solid #000;
        outline-offset: 2px;
    }

    .cb-launcher.cb-oculto {
        display: none;
    }

.cb-launcher-icone {
    font-size: 18px;
    line-height: 1;
}

.cb-panel {
    position: fixed;
    left: 20px;
    bottom: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 130px);
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
    border-radius: 16px;
    overflow: hidden;
    font-family: LatoWeb, Lato, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}

    .cb-panel[hidden] {
        display: none;
    }

/* cabecalho: avatar, titulo em serifa vermelha e icones vermelhos */
.cb-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--cb-bege);
    color: var(--cb-vermelho);
    border-bottom: 1px solid #e3b4b9;
}

.cb-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cb-vermelho);
    color: #fff;
}

    .cb-avatar img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.cb-avatar-letra {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--cb-serifa);
    font-size: 24px;
}

.cb-header-tit {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

    .cb-header-tit strong {
        font-family: var(--cb-serifa);
        font-weight: 400;
        font-size: 24px;
        line-height: 1.1;
        letter-spacing: .5px;
        text-transform: uppercase;
        color: var(--cb-vermelho);
    }

    .cb-header-tit span {
        margin-top: 3px;
        font-family: LatoWebBold, Lato, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: .6px;
        text-transform: uppercase;
        color: var(--cb-vermelho);
    }

.cb-header-acoes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cb-close, .cb-size {
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: var(--cb-vermelho);
    line-height: 1;
    cursor: pointer;
    padding: 6px;
}

    .cb-size:hover, .cb-close:hover {
        color: var(--cb-vermelho-escuro);
    }

/* video de boas-vindas: cobre a conversa por baixo do cabecalho, na primeira abertura */
.cb-video {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.cb-panel.cb-a-video .cb-msgs, .cb-panel.cb-a-video .cb-chips, .cb-panel.cb-a-video .cb-form, .cb-panel.cb-a-video .cb-nota {
    display: none;
}

.cb-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.cb-video-saltar {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 16px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-family: var(--cb-serifa);
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
}

    .cb-video-saltar:hover {
        background: var(--cb-vermelho);
        border-color: var(--cb-vermelho);
    }

    .cb-video-saltar:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

.cb-msgs {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    -webkit-overflow-scrolling: touch;
}

.cb-msg {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.cb-msg-user {
    align-items: flex-end;
}

.cb-msg-bot {
    align-items: flex-start;
}

.cb-bubble {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 18px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cb-msg-user .cb-bubble {
    background: var(--cb-vermelho);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.cb-msg-bot .cb-bubble {
    background: #fff;
    color: #000;
    border: 1px solid #e6e6e6;
    border-bottom-left-radius: 6px;
}

.cb-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
}

    .cb-typing span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #999;
        animation: cb-pulse 1.2s infinite ease-in-out;
    }

        .cb-typing span:nth-child(2) {
            animation-delay: .15s;
        }

        .cb-typing span:nth-child(3) {
            animation-delay: .3s;
        }

@keyframes cb-pulse {
    0%, 80%, 100% {
        opacity: .3;
        transform: scale(.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.cb-cards {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding-bottom: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.cb-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    overflow: hidden;
    color: #000;
    text-decoration: none;
}

    .cb-card:hover {
        border-color: #000;
    }

.cb-card-link {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    color: #000;
    text-decoration: none;
}

    .cb-card-link:hover, .cb-card-link:focus {
        text-decoration: none;
        color: #000;
    }

/* adicionar ao carrinho */
.cb-acoes {
    padding: 0 8px 8px;
}

.cb-add {
    width: 100%;
    height: 32px;
    border: 1px solid #000;
    border-radius: 4px;
    background: #000;
    color: #fff;
    font-family: LatoWebBold, Lato, Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
}

    .cb-add:hover {
        background: #222;
    }

    .cb-add:disabled {
        opacity: .5;
        cursor: default;
    }

    .cb-add:focus-visible, .cb-tam:focus-visible, .cb-ver-carrinho:focus-visible {
        outline: 2px solid var(--cb-vermelho);
        outline-offset: 2px;
    }

.cb-tams {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

    .cb-tams[hidden] {
        display: none;
    }

.cb-tam {
    min-width: 32px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: #000;
    font-size: 12px;
    cursor: pointer;
}

    .cb-tam:hover {
        background: #000;
        color: #fff;
        border-color: #000;
    }

.cb-estado {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: #2e7d32;
}

    .cb-estado:empty {
        display: none;
    }

    .cb-estado.cb-erro {
        color: #c00;
    }

.cb-ver-carrinho {
    color: #000;
    text-decoration: underline;
    font-family: LatoWebBold, Lato, Arial, sans-serif;
}

/* avisos de acoes do cliente (ex.: adicionou ao carrinho) */
.cb-msg-sys {
    align-items: center;
}

    .cb-msg-sys .cb-bubble {
        max-width: 100%;
        background: transparent;
        border: 0;
        color: #2e7d32;
        font-size: 12px;
        text-align: center;
        padding: 2px 6px;
    }

.cb-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f0f0f0;
}

.cb-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
}

.cb-card-tag {
    align-self: flex-start;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--cb-vermelho);
    color: #fff;
    font-size: 10px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.cb-card-nome {
    font-family: LatoWebBold, Lato, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
}

.cb-card-marca {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.cb-card-preco {
    display: flex;
    gap: 6px;
    align-items: baseline;
    margin-top: 2px;
}

.cb-preco-normal {
    font-family: LatoWebBold, Lato, Arial, sans-serif;
    font-size: 14px;
}

.cb-preco-promo {
    font-family: LatoWebBold, Lato, Arial, sans-serif;
    font-size: 14px;
    color: var(--cb-vermelho);
}

.cb-preco-antigo {
    font-size: 11px;
    color: #a7a7a7;
    text-decoration: line-through;
}

.cb-card-tam {
    font-size: 10px;
    color: #666;
}

/* sugestoes: pilulas de contorno vermelho em serifa maiuscula */
.cb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 14px;
    background: #f5f5f5;
}

.cb-chip {
    border: 1px solid var(--cb-vermelho);
    border-radius: 18px;
    background: #fff;
    color: var(--cb-vermelho);
    padding: 7px 14px;
    font-family: var(--cb-serifa);
    font-size: 12.5px;
    letter-spacing: .4px;
    text-transform: uppercase;
    cursor: pointer;
}

    .cb-chip:hover {
        background: var(--cb-vermelho);
        color: #fff;
    }

.cb-form {
    display: flex;
    gap: 10px;
    padding: 12px 16px 6px;
    border-top: 1px solid #e3e3e3;
    background: #fff;
}

.cb-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid #000;
    border-radius: 21px;
    font-size: 16px;
    font-family: inherit;
    color: #000;
    background: #fff;
}

    .cb-input:focus {
        outline: 0;
        border-color: var(--cb-vermelho);
    }

    .cb-input:disabled {
        background: #f0f0f0;
    }

.cb-send {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 21px;
    background: var(--cb-vermelho);
    color: #fff;
    font-family: var(--cb-serifa);
    font-size: 14px;
    letter-spacing: .6px;
    text-transform: uppercase;
    cursor: pointer;
}

    .cb-send:hover:not(:disabled) {
        background: var(--cb-vermelho-escuro);
    }

    .cb-send:disabled {
        opacity: .5;
        cursor: default;
    }

.cb-nota {
    margin: 0;
    padding: 0 16px 12px;
    background: #fff;
    color: #888;
    font-size: 10.5px;
    line-height: 1.3;
}

/* janela grande (botao no cabecalho): mais largura e altura, cartoes em grelha em vez de carrossel */
.cb-panel.cb-grande {
    width: min(660px, calc(100vw - 40px));
    height: min(820px, calc(100vh - 130px));
}

.cb-grande .cb-bubble {
    max-width: 82%;
}

.cb-grande .cb-cards {
    flex-wrap: wrap;
    overflow-x: visible;
}

.cb-grande .cb-card {
    flex: 0 0 calc(33.333% - 7px);
}

@media (max-width: 480px) {
    .cb-size {
        display: none;
    }

    .cb-panel.cb-grande {
        width: 100vw;
        height: 85vh;
    }

    .cb-grande .cb-cards {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .cb-grande .cb-card {
        flex: 0 0 150px;
    }

    .cb-launcher {
        left: 12px;
        bottom: 20px;
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .cb-launcher-texto {
        display: none;
    }

    .cb-panel {
        left: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 85vh;
        max-height: calc(100vh - 110px);
        border-radius: 16px 16px 0 0;
    }
}

@media print {
    .cb-launcher, .cb-panel {
        display: none !important;
    }
}
