/* =================================================================
   cwp.css - Carrinho WhatsApp (CWP) - Sites Simples CMS
   Versao: KIMERA-044d
   Data:   26/06/2026
   Autor:  Arte nas Redes - artenasredes.com.br
   Projeto: Sites Simples CMS - Flat File WYSIWYG
   Arquivo: cwp.css
   Alteracao: KIMERA-035 — estilos do painel #ss-cwp-wa-config
     (config do botao Finalizar Pedido): logo WA monocromatica SVG,
     toggle custom, campo de numero, textarea de mensagem.
     Anterior: KIMERA-034.
     (0) FIX GRADE: scroll-snap-type x mandatory -> x proximity (o mandatory
         travava o scroll antes do ultimo snap, escondendo os 2 ultimos cards
         da grade horizontal). Cards ocultos pelo filtro recebem display:none
         !important para nao reservar coluna fantasma no grid-auto-flow:column.
     (1) BUG-CWP-01: sidebar height: 100vh -> 100dvh (dynamic viewport).
         Corrige botao "Fazer Pedido" ficando oculto ao rolar no mobile
         Safari/Chrome Android (barra de endereco muda o viewport).
     (2) Fundo branco forcado no wrapper da imagem do card (.ss-cwp-img-wrap)
         e no .ss-product-img do card mini. Evita fundo colorido aparecendo
         em fotos com recorte ou sem preenchimento total.
     Anterior: KIMERA-032.
   MOBILE FIRST: base = celular. @media min-width = tablet/desktop.
   ================================================================= */

/* -- BARRA DE CATEGORIAS ----------------------------------------- */
.ss-cwp-cats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 14px;
    user-select: none;
}
.ss-cwp-cats-bar.dragging { cursor: default; }

.ss-cwp-cat-btn {
    flex-shrink: 0;
    background: #f0f0f0;
    color: var(--dark, #2C3E50);
    border: none;
    border-radius: 20px;
    /* Mobile: area de toque minima 44px */
    padding: 10px 18px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-cat-btn.active,
.ss-cwp-cat-btn:active {
    background: var(--primary, #FF6B9D);
    color: #fff;
}
@media (hover: hover) {
    .ss-cwp-cat-btn:hover {
        background: var(--primary, #FF6B9D);
        color: #fff;
    }
}

/* PILL DE CATEGORIA */
.ss-cwp-cat-pill {
    display: inline-block;
    background: var(--accent, #6C5CE7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* -- FOOTER DO CARD: PRECO + BOTAO + ----------------------------- */
.ss-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.ss-product-preco {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary, #FF6B9D);
    line-height: 1;
}

/* Botao + estilo iFood - minimo 44x44 em mobile */
.ss-cwp-btn-add-fast {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--primary, #FF6B9D);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.ss-cwp-btn-add-fast:active { transform: scale(0.92); }
@media (hover: hover) {
    .ss-cwp-btn-add-fast:hover {
        transform: scale(1.1);
        background: var(--primary-dark, #e0527e);
    }
}

@media (min-width: 768px) {
    .ss-cwp-btn-add-fast { width: 40px; height: 40px; min-width: 40px; font-size: 20px; }
    .ss-product-preco { font-size: 18px; }
}

/* -- LIGHTBOX DO PRODUTO ----------------------------------------- */
#ss-cwp-lb {
    position: fixed;
    inset: 0;
    z-index: 10200;
    display: flex;
    align-items: flex-end; /* mobile: sobe de baixo */
    justify-content: center;
    padding: 0;
}
#ss-cwp-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}
.ss-cwp-lb-box {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0; /* mobile: bottom sheet */
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.22);
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}
.ss-cwp-lb-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    border-radius: 20px 20px 0 0;
    display: block;
}
.ss-cwp-lb-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f5f5f5, #eee);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}
.ss-cwp-lb-body { padding: 18px 18px 28px; }
.ss-cwp-lb-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent, #6C5CE7);
    margin-bottom: 6px;
}
.ss-cwp-lb-nome {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark, #2C3E50);
    margin: 0 0 8px;
    line-height: 1.2;
}
.ss-cwp-lb-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 14px;
}
.ss-cwp-lb-preco {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary, #FF6B9D);
    margin-bottom: 18px;
    display: block;
}
.ss-cwp-lb-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ss-cwp-lb-qtd-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 8px 12px;
}
.ss-cwp-lb-qtd-btn {
    width: 36px; height: 36px;
    border: none; background: none;
    font-size: 22px; font-weight: 700;
    cursor: pointer; color: var(--primary, #FF6B9D);
    display: flex; align-items: center; justify-content: center;
    min-width: 36px;
    -webkit-tap-highlight-color: transparent;
}
#ss-cwp-lb-qtd {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
}
.ss-cwp-lb-add {
    flex: 1;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-lb-add:active { background: #c62828; }
@media (hover: hover) { .ss-cwp-lb-add:hover { background: #c62828; } }

.ss-cwp-lb-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

/* Tablet+: lightbox vira modal centralizado */
@media (min-width: 600px) {
    #ss-cwp-lb { align-items: center; padding: 16px; }
    .ss-cwp-lb-box {
        border-radius: 18px;
        max-width: 460px;
        width: 100%;
        max-height: 90vh;
    }
    .ss-cwp-lb-img { border-radius: 18px 18px 0 0; }
    .ss-cwp-lb-img-placeholder { border-radius: 18px 18px 0 0; }
}

/* -- SIDEBAR DO CARRINHO ----------------------------------------- */
.ss-cwp-sidebar {
    position: fixed;
    top: 0; right: -100vw;
    width: 100vw; /* mobile: tela toda */
    max-width: 100vw;
    /* BUG-CWP-01: 100dvh = dynamic viewport height.
       100vh em iOS Safari/Chrome Android inclui a barra de endereco,
       fazendo o footer (botao Fazer Pedido) ficar oculto ao rolar.
       100dvh sempre reflete a altura VISIVEL real da tela. */
    height: 100vh;    /* fallback: browsers sem suporte a dvh */
    height: 100dvh;   /* fix: exclui barra de endereco no mobile */
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    z-index: 10100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
}
.ss-cwp-sidebar.active { right: 0; }

/* Tablet+: sidebar lateral */
@media (min-width: 480px) {
    .ss-cwp-sidebar { width: 380px; max-width: 95vw; right: -420px; }
}

.ss-cwp-sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent, #6C5CE7);
    color: #fff;
    flex-shrink: 0;
}
.ss-cwp-sidebar-header h3 {
    margin: 0; font-size: 17px;
    display: flex; align-items: center; gap: 8px;
}
.ss-cwp-close {
    background: none; border: none;
    color: #fff; font-size: 22px;
    cursor: pointer; padding: 8px;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.ss-cwp-items {
    flex: 1; overflow-y: auto;
    padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
    -webkit-overflow-scrolling: touch;
}
.ss-cwp-empty {
    text-align: center; color: #aaa;
    font-size: 14px; padding: 40px 0;
}
.ss-cwp-item {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 10px; padding: 12px;
    background: #f9f9f9; border-radius: 10px;
}
.ss-cwp-item-info {
    display: flex; flex-direction: column;
    gap: 3px; flex: 1; min-width: 0;
}
.ss-cwp-item-nome {
    font-size: 14px; font-weight: 600;
    color: var(--dark, #2C3E50);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-cwp-item-sub {
    font-size: 13px; color: var(--primary, #FF6B9D); font-weight: 700;
}
.ss-cwp-item-ctrl {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.ss-cwp-qtd-btn {
    width: 36px; height: 36px; min-width: 36px;
    border: 2px solid var(--accent, #6C5CE7);
    background: none; border-radius: 8px;
    color: var(--accent, #6C5CE7);
    font-size: 18px; font-weight: 700;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-qtd-btn:active { background: var(--accent, #6C5CE7); color: #fff; }
.ss-cwp-qtd { min-width: 24px; text-align: center; font-weight: 700; font-size: 15px; }
.ss-cwp-rm-btn {
    background: none; border: none; color: #ccc;
    font-size: 22px; cursor: pointer;
    min-width: 36px; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-rm-btn:active { color: #e53935; }

.ss-cwp-sidebar-footer {
    padding: 14px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    display: flex; flex-direction: column; gap: 10px;
    flex-shrink: 0;
}
.ss-cwp-total-row {
    display: flex; justify-content: space-between;
    align-items: center; font-size: 16px;
}
.ss-cwp-total-row strong { font-size: 22px; color: var(--primary, #FF6B9D); }
.ss-cwp-btn-finish {
    background: #25D366; color: #fff; border: none;
    border-radius: 12px; padding: 16px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-btn-finish:active { background: #1da851; }
@media (hover: hover) { .ss-cwp-btn-finish:hover { background: #1da851; } }
.ss-cwp-btn-clear {
    background: none; border: 1px solid #ddd;
    color: #999; border-radius: 8px; padding: 10px;
    font-size: 13px; cursor: pointer; min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-btn-clear:active { border-color: #e53935; color: #e53935; }

/* -- OVERLAY ----------------------------------------------------- */
.ss-cwp-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10099;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.ss-cwp-overlay.active { opacity: 1; pointer-events: auto; }

/* -- BOTAO FLUTUANTE SACOLA -------------------------------------- */
.ss-cwp-float {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    left: 16px;
    width: 56px; height: 56px;
    background: var(--accent, #6C5CE7);
    color: #fff; border: none; border-radius: 50%;
    box-shadow: 0 4px 18px rgba(108,92,231,0.45);
    cursor: pointer;
    display: none; /* JS liga via flex */
    align-items: center; justify-content: center;
    font-size: 22px; z-index: 1010;
    -webkit-tap-highlight-color: transparent;
}
.ss-cwp-float:active { transform: scale(0.94); }
@media (hover: hover) { .ss-cwp-float:hover { transform: scale(1.1); } }

.ss-cwp-float-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--primary, #FF6B9D); color: #fff;
    font-size: 11px; font-weight: 800;
    min-width: 20px; height: 20px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* -- NOTIFICACAO TOAST ------------------------------------------- */
.ss-cwp-notif {
    position: fixed;
    bottom: max(90px, calc(env(safe-area-inset-bottom, 0px) + 80px));
    right: 16px;
    background: var(--primary, #FF6B9D); color: #fff;
    padding: 12px 20px; border-radius: 24px;
    font-size: 14px; font-weight: 600;
    z-index: 10300;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transform: translateX(120px); opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.ss-cwp-notif-error { background: #e53935; }
.ss-cwp-notif.visible { transform: translateX(0); opacity: 1; }

/* -- ADMIN: PAINEL CWP ------------------------------------------- */
.ss-cwp-admin-panel {
    text-align: center;
    padding: 24px 16px;
    background: #f8f6ff;
    border-radius: 12px;
    border: 2px dashed var(--accent, #6C5CE7);
}
.ss-cwp-admin-icon { font-size: 40px; color: #25D366; margin-bottom: 8px; }
.ss-cwp-admin-title { font-size: 18px; font-weight: 700; color: var(--dark,#2C3E50); margin: 0 0 8px; }
.ss-cwp-admin-desc { font-size: 13px; color: #666; margin: 0 0 14px; line-height: 1.5; }
.ss-cwp-admin-field { margin-bottom: 12px; }
.ss-cwp-admin-field label { font-size: 12px; color: #888; display: block; margin-bottom: 4px; }
.ss-cwp-wa-num {
    display: inline-block;
    font-size: 15px; font-weight: 600;
    border: 1px dashed #ccc; border-radius: 6px;
    padding: 6px 12px; background: #fff; cursor: pointer;
    min-height: 44px; display: flex; align-items: center;
    justify-content: center;
}
.ss-cwp-admin-hint { font-size: 12px; color: #999; margin: 0; display: flex; align-items: center; gap: 6px; justify-content: center; }

/* CWP: input de moeda sobreposto ao span do preco */
.ss-currency-input {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary, #FF6B9D);
    border: 2px dashed var(--primary, #FF6B9D);
    border-radius: 6px;
    padding: 4px 8px;
    background: #fff;
    outline: none;
    width: 120px;
    display: inline-block;
    min-height: 36px;
}

/* -- GRADE HORIZONTAL DE PRODUTOS (CWP ativo) -------------------- */
/* KIMERA-044: 1 linha, scroll lateral — cards sempre lado a lado.   */
/* Scrollbar visivel, grossa e estilizada (altura = FAQ question bar). */
.ss-cwp-grid-h {
    display: grid;
    grid-template-rows: 1fr;             /* 1 linha — todos os cards na mesma fila */
    grid-auto-flow: column;              /* preenche por coluna, scroll lateral */
    grid-auto-columns: 42vw;            /* mobile: ~2 cards visiveis */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 10px;
    padding: 4px 2px 4px;
    cursor: grab;
    /* Scrollbar nativo oculto nos 2 ambientes — usamos o .ss-cwp-scroll-track */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
/* Scrollbar nativo oculto — substituido pelo .ss-cwp-scroll-track customizado */
.ss-cwp-grid-h::-webkit-scrollbar { display: none; }
.ss-cwp-grid-h.dragging { cursor: grabbing; }
.ss-cwp-grid-h > .ss-product-card { scroll-snap-align: start; }
/* Cards ocultos pelo filtro saem totalmente do fluxo do grid —
   sem isso o grid-auto-flow:column reserva colunas fantasma e
   empurra os ultimos cards para fora da area de scroll alcancavel. */
.ss-cwp-grid-h > .ss-product-card[style*="display: none"],
.ss-cwp-grid-h > .ss-product-card[style*="display:none"] {
    display: none !important;
}
/* FIX COLAPSO: os primeiros cards colapsavam para width:0 porque o
   grid-auto-columns nao se aplicava de forma confiavel a todas as
   colunas (interacao com display:flex do card-mini). Forca a largura
   diretamente em cada card da grade, espelhando grid-auto-columns. */
.ss-cwp-grid-h > .ss-product-card {
    width: 42vw;
    min-width: 42vw;
    box-sizing: border-box;
}
@media (min-width: 600px) {
    .ss-cwp-grid-h > .ss-product-card { width: 28vw; min-width: 28vw; }
}
@media (min-width: 1024px) {
    .ss-cwp-grid-h > .ss-product-card { width: 200px; min-width: 200px; }
}

/* Admin: 1 linha para cards sempre lado a lado */
.ss-admin-mode .ss-cwp-grid-h {
    grid-template-rows: 1fr;
}

/* Card mini - compacto */
.ss-cwp-card-mini {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    min-width: 0; /* necessario para grid */
}

/* Wrapper da imagem: fundo branco forcado.
   Garante que fotos com recorte ou sem preenchimento total nao
   exibam o fundo do card por baixo, independente da cor do tema. */
.ss-cwp-img-wrap {
    background: #fff;
    overflow: hidden;
}

/* Imagem do card mini: quadrada, clicavel */
.ss-cwp-card-mini .ss-cwp-img-wrap {
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}
.ss-cwp-card-mini .ss-product-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain; /* CWP: crop livre, mostra imagem inteira sem corte */
    background: #fff;    /* fundo branco forcado */
    display: block;
    transition: transform 0.2s;
}
.ss-cwp-card-mini .ss-cwp-img-wrap:active .ss-product-img {
    transform: scale(1.04);
}
@media (hover: hover) {
    .ss-cwp-card-mini .ss-cwp-img-wrap:hover .ss-product-img {
        transform: scale(1.04);
    }
}

/* Info do card mini */
.ss-cwp-card-mini .ss-product-info {
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

/* Pill menor no card mini */
.ss-cwp-card-mini .ss-cwp-cat-pill {
    font-size: 9px;
    padding: 2px 7px;
}

/* Nome truncado em 1 linha */
.ss-cwp-card-mini .ss-product-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Descricao truncada em 1 linha */
.ss-cwp-card-mini .ss-product-desc {
    font-size: 10px;
    color: #888;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Footer compacto */
.ss-cwp-card-mini .ss-product-footer {
    margin-top: 4px;
    padding: 0;
}

/* Preco menor no card mini */
.ss-cwp-card-mini .ss-product-preco {
    font-size: 13px;
    font-weight: 800;
}

/* Botao + menor no card mini mas ainda 44px de area de toque */
.ss-cwp-card-mini .ss-cwp-btn-add-fast {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 18px;
    /* Area de toque maior que o visual via padding negativo */
    margin: -4px;
    padding: 4px;
}

/* Tablet: 3 colunas */
@media (min-width: 600px) {
    .ss-cwp-grid-h { grid-auto-columns: 28vw; } /* tablet: 3 visiveis */
    .ss-cwp-card-mini .ss-product-title { font-size: 13px; }
    .ss-cwp-card-mini .ss-product-preco { font-size: 14px; }
}

/* Desktop: colunas fixas de 200px */
@media (min-width: 1024px) {
    .ss-cwp-grid-h { grid-auto-columns: 200px; } /* desktop: colunas fixas */
    .ss-cwp-card-mini .ss-product-title { font-size: 14px; }
    .ss-cwp-card-mini .ss-product-desc { font-size: 11px; }
    .ss-cwp-card-mini .ss-product-preco { font-size: 15px; }
    .ss-cwp-card-mini .ss-cwp-btn-add-fast { width: 38px; height: 38px; min-width: 38px; }
}

/* -- SELECT DE CATEGORIA NO ADMIN --------------------------------- */
.ss-cwp-cat-select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid var(--accent, #6C5CE7);
    border-radius: 6px;
    background: #fff;
    color: var(--dark, #2C3E50);
    cursor: pointer;
    min-height: 36px;
    outline: none;
}
.ss-cwp-cat-select:focus {
    border-color: var(--primary, #FF6B9D);
    box-shadow: 0 0 0 2px rgba(255,107,157,0.2);
}

/* -- PAINEL DE CONFIG WHATSAPP DO CARRINHO (admin only) ----------- */
/* Mobile First. Exibido acima do CRUD de categorias.               */

.ss-cwp-wa-config {
    background: #fff;
    border: 2px solid #25D366;
    border-radius: 16px;
    padding: 20px 16px 18px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

/* Faixa verde discreta no topo */
.ss-cwp-wa-config::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #25D366, #128C7E);
    border-radius: 16px 16px 0 0;
}

/* Cabecalho: logo + titulo */
.ss-cwp-wa-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

/* Logo SVG monocromatica verde, vazada — so o outline */
.ss-cwp-wa-logo-svg {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    color: #25D366;
    opacity: 0.85;
    /* Efeito vazado: stroke over fill */
    stroke: #25D366;
    stroke-width: 0.3;
    filter: drop-shadow(0 2px 6px rgba(37,211,102,0.22));
}

.ss-cwp-wa-config-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ss-cwp-wa-config-label {
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.ss-cwp-wa-config-sub {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

/* Linha do toggle */
.ss-cwp-wa-sync-row {
    margin-bottom: 14px;
}

/* Toggle custom */
.ss-cwp-wa-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.ss-cwp-wa-toggle input[type="checkbox"] {
    display: none;
}

.ss-cwp-wa-toggle-track {
    width: 44px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}

.ss-cwp-wa-toggle input:checked + .ss-cwp-wa-toggle-track {
    background: #25D366;
}

.ss-cwp-wa-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.ss-cwp-wa-toggle input:checked + .ss-cwp-wa-toggle-track .ss-cwp-wa-toggle-thumb {
    transform: translateX(20px);
}

.ss-cwp-wa-sync-text {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    line-height: 1.3;
}

/* Labels de campo */
.ss-cwp-wa-field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.ss-cwp-wa-field-label small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #888;
    margin-top: 1px;
}

/* Linha do numero independente */
.ss-cwp-wa-num-row {
    margin-bottom: 14px;
}

.ss-cwp-wa-hidden {
    display: none !important;
}

/* Input de numero com prefixo +55 */
.ss-cwp-wa-num-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    background: #fafafa;
}

.ss-cwp-wa-num-input-wrap:focus-within {
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37,211,102,0.15);
    background: #fff;
}

.ss-cwp-wa-flag {
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    background: #f0f0f0;
    border-right: 1.5px solid #ddd;
    min-height: 42px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ss-cwp-wa-num-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: transparent;
    min-height: 42px;
    letter-spacing: 1px;
}

/* Area de texto da mensagem */
.ss-cwp-wa-msg-row {
    margin-bottom: 4px;
}

.ss-cwp-wa-msg-input {
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
    min-height: 80px;
    font-family: inherit;
}

.ss-cwp-wa-msg-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37,211,102,0.15);
    background: #fff;
}

.ss-cwp-wa-hint {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    line-height: 1.4;
}

.ss-cwp-wa-hint code {
    background: #f0f0f0;
    border-radius: 3px;
    padding: 0 4px;
    font-family: monospace;
    font-size: 11px;
    color: #555;
}

@media (min-width: 600px) {
    .ss-cwp-wa-config { padding: 22px 24px 20px; }
    .ss-cwp-wa-logo-svg { width: 48px; height: 48px; }
    .ss-cwp-wa-config-label { font-size: 16px; }
}

/* === KIMERA-040b: campos editaveis destaque verde === */
.ss-cwp-wa-editavel {
    width: 100%;
    border: 2px solid #25D366;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    background: #f0fff4;
    outline: none;
    box-sizing: border-box;
    min-height: 46px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.10);
}
.ss-cwp-wa-editavel:focus {
    border-color: #128C7E;
    background: #e6fff2;
    box-shadow: 0 0 0 3px rgba(18,140,126,0.18);
}
.ss-cwp-wa-editavel::placeholder { color: #9dbfa8; font-weight: 400; }

/* === KIMERA-036: modal de edicao de produto === */
.ss-cwp-edit-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 10400;
    align-items: flex-end; justify-content: center;
}
.ss-cwp-edit-overlay.active { display: flex; }
.ss-cwp-edit-sheet {
    background: #fff; width: 100%; max-height: 92dvh;
    border-radius: 20px 20px 0 0; overflow-y: auto;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
}
.ss-cwp-edit-overlay.active .ss-cwp-edit-sheet { transform: translateY(0); }
.ss-cwp-edit-puller { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 12px auto 4px; flex-shrink: 0; }
.ss-cwp-edit-img-wrap { width: 100%; background: #f5f5f5; flex-shrink: 0; }
.ss-cwp-edit-img { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.ss-cwp-edit-body { padding: 16px 20px 4px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ss-cwp-edit-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 8px; }
.ss-cwp-edit-input, .ss-cwp-edit-textarea {
    width: 100%; border: 1.5px solid #e0e0e0; border-radius: 8px;
    padding: 10px 12px; font-size: 14px; color: #222; font-family: inherit;
    outline: none; background: #fafafa; box-sizing: border-box; transition: border-color 0.18s;
}
.ss-cwp-edit-input:focus, .ss-cwp-edit-textarea:focus {
    border-color: #6c5ce7; background: #fff; box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}
.ss-cwp-edit-textarea { resize: vertical; min-height: 72px; }
.ss-cwp-edit-preco-input { font-weight: 700; font-size: 16px; }
.ss-cwp-edit-footer { display: flex; gap: 10px; padding: 14px 20px 20px; flex-shrink: 0; }
.ss-cwp-edit-btn-cancel, .ss-cwp-edit-btn-apply {
    flex: 1; padding: 13px; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.ss-cwp-edit-btn-cancel { background: #f0f0f0; color: #555; }
.ss-cwp-edit-btn-apply { background: #6c5ce7; color: #fff; }
.ss-cwp-edit-btn-cancel:active, .ss-cwp-edit-btn-apply:active { opacity: 0.8; }
@media (min-width: 600px) {
    .ss-cwp-edit-overlay { align-items: center; }
    .ss-cwp-edit-sheet { width: 480px; max-height: 88vh; border-radius: 16px; transform: scale(0.92) translateY(12px); }
    .ss-cwp-edit-overlay.active .ss-cwp-edit-sheet { transform: scale(1) translateY(0); }
    .ss-cwp-edit-puller { display: none; }
    .ss-cwp-edit-img { max-height: 260px; }
}

/* ── SCROLLBAR CUSTOMIZADO CWP ────────────────────────────────────
   Div sempre visivel abaixo do grid — substitui scrollbar nativo.
   Altura = FAQ question bar (padding 20px*2 + texto ~22px = 62px).
   ─────────────────────────────────────────────────────────────── */
.ss-cwp-scroll-track {
    width: 100%;
    height: 62px;
    background: rgba(0,0,0,0.07);
    border-radius: 31px;
    position: relative;
    margin-top: 10px;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
@media (max-width: 767px) {
    .ss-cwp-scroll-track {
        height: 31px;
        border-radius: 16px;
        margin-top: 8px;
    }
    .ss-cwp-scroll-thumb {
        border-width: 5px;
        border-radius: 16px;
    }
}
.ss-cwp-scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary, #FF6B9D);
    border-radius: 31px;
    border: 10px solid rgba(0,0,0,0.07);
    box-sizing: border-box;
    min-width: 80px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: background 0.15s;
    will-change: left, width;
}
.ss-cwp-scroll-thumb.ss-dragging {
    cursor: grabbing;
    background: var(--dark, #2C3E50);
}
