/* ==========================================================
   NOW SUPLEMENTOS — Frontend CSS v3
   Design baseado em: nowsuplementos.com.br
   ========================================================== */

/* ─── GRID ────────────────────────────────────────────────── */
.now-pg {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Elementor sobrescreve */
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
}
@media (max-width: 1024px) { .now-pg { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .now-pg { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (max-width: 380px)  { .now-pg { grid-template-columns: 1fr; } }

/* ─── CARD ────────────────────────────────────────────────── */
.now-pg-card {
    background: #fff;
    border-radius: 10px;
    /* overflow NÃO fica aqui — clipa os botões +/-; cada seção cuida do seu próprio overflow */
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.now-pg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

/* ─── THUMB ───────────────────────────────────────────────── */
.now-pg-thumb {
    display: block;
    position: relative;
    overflow: hidden;                  /* zoom da imagem */
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    border-radius: 10px 10px 0 0;     /* arredonda só os cantos superiores do card */
}
.now-pg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.now-pg-card:hover .now-pg-thumb img { transform: scale(1.04); }

/* ─── BADGES ──────────────────────────────────────────────── */
.now-pg-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}
.now-pg-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.4;
}
.now-pg-badge--sale { background: #e74c3c; color: #fff; }
.now-pg-badge--out  { background: #999;    color: #fff; }

/* ─── BODY ─────────────────────────────────────────────────
   SEM flex:1 aqui: se o body crescer para preencher o card
   (altura igual entre cards do carrossel), o conteúdo (nome,
   preço, parcelas) fica alinhado no topo e sobra um vão vazio
   enorme antes do botão. O ajuste de altura igual entre os
   cards fica só por conta de .now-pg-actions (margin-top:auto). */
.now-pg-body {
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.now-pg-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.now-pg-name a { color: #222; text-decoration: none; }
.now-pg-name a:hover { color: #f5a623; }

/* Avaliação */
.now-pg-rating { line-height: 1; }
.now-pg-rating .star-rating { font-size: 12px; }

/* ─── PREÇO ───────────────────────────────────────────────── */
.now-pg-price {
    font-size: 13px;
    line-height: 1.3;
    margin: 4px 0 0;
}
.now-pg-price del {
    color: #aaa;
    font-size: 12px;
    font-weight: 400;
    display: block;
    line-height: 1.2;
    text-decoration: line-through;
}
.now-pg-price del .woocommerce-Price-amount { color: #aaa; font-size: 12px; }
.now-pg-price ins {
    text-decoration: none;
    display: block;
}
.now-pg-price ins .woocommerce-Price-amount {
    color: #c0392b;
    font-size: 20px;
    font-weight: 800;
}
/* produto sem promoção */
.now-pg-price > .woocommerce-Price-amount {
    color: #c0392b;
    font-size: 20px;
    font-weight: 800;
    display: block;
}

/* ─── PARCELAMENTO ────────────────────────────────────────── */
.now-installment-text {
    font-size: 11px;
    color: #555;
    line-height: 1.6;
    margin: 2px 0 0;
}
.now-installment-text strong { font-weight: 700; color: #333; }
.now-inst-label              { color: #666; }
.now-inst-pix                { color: #27ae60; font-weight: 800; }

/* ─── AÇÕES ─────────────────────────────────────────────────
   Sem margin-top:auto: o botão fica logo após o preço/parcelas,
   sem vão vazio. Em cards de altura igual (carrossel), a sobra
   de espaço (se houver) fica no rodapé do card, não no meio. */
.now-pg-actions {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* linha: qty + botão comprar */
.now-pg-buy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

/* ─── SELETOR DE QUANTIDADE ───────────────────────────────── */
/* Estrutura: [−] [span com o número] [+]
   Usando <span> em vez de <input type="number"> para evitar
   qualquer interferência do browser ou WooCommerce no input */
.now-pg-qty {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 38px;
    gap: 2px;
}

/* Botões − e + */
.now-pg-qty-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 30px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 0;
    user-select: none;
    transition: background .12s, color .12s;
}
.now-pg-qty-btn:hover  { background: #e8e8e8; color: #000; }
.now-pg-qty-btn:active { background: #ddd; }

/* Número — span simples, sem nenhuma interferência de browser */
.now-pg-qty-in {
    flex: 0 0 auto;
    min-width: 28px;
    height: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #222;
    line-height: 30px;
    padding: 0 4px;
    box-sizing: border-box;
}

/* ─── BOTÃO COMPRAR ───────────────────────────────────────── */
.now-pg-btn-buy {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    background: #f5a623;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, opacity .15s;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}
.now-pg-btn-buy:hover  { background: #e09510; color: #fff; }
.now-pg-btn-buy:active { opacity: .85; }
.now-pg-btn-buy.loading { opacity: .6; pointer-events: none; }
.now-pg-btn-buy.added   { background: #27ae60; border-color: #27ae60; color: #fff; }
.now-pg-btn-buy--out    { background: #bbb; border-color: #bbb; color: #fff; }
.now-pg-btn-buy--out:hover { background: #999; border-color: #999; }

/* sem qty: botão ocupa largura total */
.now-pg-buy-row:not(:has(.now-pg-qty)) .now-pg-btn-buy {
    flex: unset;
    width: 100%;
}

/* Link "Ver carrinho" que o WooCommerce insere sozinho ao lado do botão
   após adicionar ao carrinho (add-to-cart.js) — redundante aqui, pois o
   carrinho off-canvas do Elementor já abre automaticamente. */
.now-pg-actions .added_to_cart.wc-forward {
    display: none !important;
}

/* "Ver produto" / "Ver opções": renderizado direto em .now-pg-actions
   (fora do .now-pg-buy-row, produto grupado/externo ou sem variações).
   Forçar largura total explicitamente para garantir tamanho idêntico
   ao botão "Comprar", independente do contexto flex do pai. */
.now-pg-actions > .now-pg-btn-buy {
    width: 100%;
    flex: unset;
    box-sizing: border-box;
}

/* ─── BOTÃO WHATSAPP ──────────────────────────────────────── */
.now-pg-btn-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    padding: 0 14px;
    background: transparent;
    color: #25D366;
    border: 1.5px solid #25D366;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}
.now-pg-btn-wa:hover {
    background: #25D366;
    color: #fff;
}
.now-pg-btn-wa svg { flex-shrink: 0; }

/* ─── DESCONTO PROGRESSIVO ────────────────────────────────── */
.now-discount-bar {
    background: #fff8ef;
    border: 1px solid #f5a623;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
}
.now-discount-achieved { color: #27ae60; font-weight: 600; margin-bottom: 8px; }
.now-discount-max { color: #f5a623; font-weight: 700; }
.now-discount-next p { margin: 0 0 8px; }
.now-progress-track { background: #eee; border-radius: 20px; height: 8px; overflow: hidden; }
.now-progress-fill  { background: linear-gradient(90deg, #f5a623, #e09510); height: 100%; border-radius: 20px; transition: width .4s; min-width: 4px; }
.now-tier-hint { padding: 10px 14px; background: #f9f9f9; border-radius: 6px; font-size: 13px; margin-top: 10px; }

/* ─── MINI-CART BADGES (desconto progressivo / frete grátis) ── */
.now-minicart-badge {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    display: block;
    margin: 0 0 8px 0;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
    z-index: 2;
}
.now-badge-success { background: #eafaf1; color: #27ae60; }
.now-badge-info    { background: #fff8ef; color: #c0780a; }
.now-progress-track {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0 12px;
}
.now-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--topwoo-primary, #f5a623), #43a047);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Suporte aos botões e layout do Elementor Menu Cart (Off-canvas) */
.elementor-menu-cart__container .elementor-button,
.elementor-menu-cart__container .elementor-button--view-cart,
.elementor-menu-cart__container .elementor-button--checkout {
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    padding: 12px 10px !important;
    letter-spacing: 0.2px !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    transition: background 0.2s, opacity 0.2s !important;
}
.elementor-menu-cart__container .elementor-button-text {
    font-size: 12px !important;
}
.elementor-menu-cart__container .elementor-button--checkout {
    background: var(--topwoo-primary, #f5a623) !important;
    color: #fff !important;
}
.elementor-menu-cart__container .elementor-button--checkout:hover {
    background: var(--topwoo-primary-dk, #e09510) !important;
}
.elementor-menu-cart__container .elementor-button--view-cart {
    background: transparent !important;
    color: #333 !important;
    border: 2px solid #ddd !important;
}
.elementor-menu-cart__container .elementor-button--view-cart:hover {
    border-color: var(--topwoo-primary, #f5a623) !important;
    color: var(--topwoo-primary, #f5a623) !important;
}

/* ─── PARCELAMENTO NO CARRINHO ────────────────────────────── */
.now-installments-cart-row th,
.now-installments-cart-row td { padding: 6px 8px; font-size: 12px; border-top: 1px solid #eee; }

/* ─── CARROSSEL ───────────────────────────────────────────── */
.now-car-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0 52px;   /* espaço para as setas */
}
.now-car-wrapper:not(:has(.now-car-prev)) { padding: 0; }

.now-car { overflow: hidden; width: 100%; }
.now-car-track { display: flex; align-items: stretch; }
.now-car-slide { flex-shrink: 0; height: auto; box-sizing: border-box; }
.now-car-slide .now-pg-card { height: 100%; }

/* Setas prev / next */
.now-car-prev,
.now-car-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5a623;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .2s, opacity .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    flex-shrink: 0;
}
.now-car-prev { left: 4px; }
.now-car-next { right: 4px; }
.now-car-prev:hover,
.now-car-next:hover { background: #e09510; }
.now-car-prev.swiper-button-disabled,
.now-car-next.swiper-button-disabled { opacity: .3; pointer-events: none; }

/* Dots */
.now-car-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.now-car-dots .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    opacity: 1;
    transition: background .2s, transform .2s;
    display: inline-block;
}
.now-car-dots .swiper-pagination-bullet-active {
    background: #f5a623;
    transform: scale(1.35);
}

@media (max-width: 480px) {
    /* Setas menores no mobile, mas visíveis (antes eram escondidas com
       display:none, deixando só o gesto de arrastar — o cliente pediu
       para mantê-las visíveis também). Reduz o espaço reservado nas
       laterais e o tamanho do botão para não invadir o card. */
    .now-car-wrapper { padding: 0 30px; }
    .now-car-wrapper:not(:has(.now-car-prev)) { padding: 0; }
    .now-car-prev, .now-car-next {
        width: 30px;
        height: 30px;
    }
    .now-car-prev { left: 0; }
    .now-car-next { right: 0; }
    .now-car-prev svg, .now-car-next svg { width: 14px; height: 14px; }

    /* Cards ficam mais estreitos com 2+ slides visíveis no mobile —
       botões precisam encolher/quebrar em vez de cortar o texto. */
    .now-pg-actions { padding: 8px 10px 10px; gap: 6px; }

    .now-pg-buy-row { gap: 4px; }
    .now-pg-qty-btn { width: 22px; height: 28px; font-size: 15px; }
    .now-pg-qty-in  { min-width: 20px; height: 28px; line-height: 28px; font-size: 12px; padding: 0 2px; }
    .now-pg-btn-buy { height: 34px; padding: 0 8px; font-size: 12px; }

    .now-pg-btn-wa {
        white-space: normal;
        overflow: visible;
        height: auto;
        min-height: 32px;
        padding: 6px 8px;
        font-size: 10.5px;
        line-height: 1.25;
        text-align: center;
    }
}

/* ----------------------------------------------------
   VARIA��ES INLINE (grid e carrossel)
---------------------------------------------------- */
.now-pg-var-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Grupo de atributo */
.now-pg-var-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.now-pg-var-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
}

/* -- RADIO CHIPS -- */
.now-pg-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.now-pg-radio-lbl {
    cursor: pointer;
    line-height: 1;
}

.now-pg-radio-inp {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.now-pg-radio-chip {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    background: #f4f5f7;
    border: 1.5px solid #dde1ea;
    border-radius: 20px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
    white-space: nowrap;
}

.now-pg-radio-lbl:hover .now-pg-radio-chip {
    border-color: var(--color-primary, #f5a623);
    color: var(--color-primary, #f5a623);
}

.now-pg-radio-inp:checked + .now-pg-radio-chip {
    background: var(--color-primary, #f5a623);
    border-color: var(--color-primary, #f5a623);
    color: #fff;
}

/* -- SELECT -- */
.now-pg-var-select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border: 1.5px solid #dde1ea;
    border-radius: 6px;
    background: #f9fafc;
    color: #333;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    appearance: auto;
}

.now-pg-var-select:focus {
    border-color: var(--color-primary, #f5a623);
}

/* -- MENSAGEM FORA DE ESTOQUE -- */
.now-pg-var-oos {
    font-size: 11px;
    color: #e53935;
    margin: 2px 0 0;
    text-align: center;
}

/* Linha de compra de vari�veis: flex para qty + bot�o */
.now-pg-buy-row--var {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.now-pg-buy-row--var .now-pg-btn-buy {
    flex: 1;
}
