/* ============================================================
   wcgtp-frontend.css  v2.4.0
   Seletor de faixas (radio cards) + multiplicador de quantidade
   ============================================================ */

/* ── Variáveis (compartilhadas por todos os widgets da Gráfica) ──────────── */
.wcgtp-tier-selector,
.wcgtp-multiplier-wrap,
.wcgtp-archive-price,
.wcgtp-variations-widget,
.wcgtp-tier-target,
.wcgtp-summary-target,
.wcgtp-optional-service,
.wcgtp-patterns {
    --wcgtp-accent:       #2563eb;
    --wcgtp-accent-soft:  #eef4ff;
    --wcgtp-border:       #e2e5ea;
    --wcgtp-ink:          #1a1a1a;
    --wcgtp-ink-soft:     #667085;
    --wcgtp-ease:         cubic-bezier( 0.16, 1, 0.3, 1 );
}

/* ── Placeholder de espera (widget ainda não pode ser preenchido) ────────── */
.wcgtp-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0.9rem 1.1rem;
    border: 1px dashed var( --wcgtp-border );
    border-radius: 10px;
    background: #fbfbfc;
    color: var( --wcgtp-ink-soft );
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.4;
}

/* ── Widget Variações: selects no mesmo estilo da Tabela de Preços ───────── */
.wcgtp-variations-widget .variations {
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
}

.wcgtp-variations-widget .variations tbody,
.wcgtp-variations-widget .variations tr,
.wcgtp-variations-widget .variations td,
.wcgtp-variations-widget .variations th {
    display: block;
    width: auto;
    border: none;
    padding: 0;
    background: transparent;
}

.wcgtp-variations-widget .variations tr {
    margin-bottom: 0.85rem;
}

.wcgtp-variations-widget .variations .label,
.wcgtp-variations-widget .variations .label label {
    display: block;
    width: 100%;
    margin: 0 0 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var( --wcgtp-ink-soft );
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left !important;
}

.wcgtp-variations-widget .variations select {
    width: 100%;
    min-height: 48px;
    padding: 0.55rem 1rem;
    border: 1px solid var( --wcgtp-border );
    border-radius: 10px;
    background: #fff;
    color: var( --wcgtp-ink );
    font-size: 0.95rem;
    line-height: 1.3;
    transition: border-color 0.2s var( --wcgtp-ease ), box-shadow 0.2s var( --wcgtp-ease );
}

.wcgtp-variations-widget .variations select:focus {
    outline: none;
    border-color: var( --wcgtp-accent );
    box-shadow: 0 0 0 3px var( --wcgtp-accent-soft );
}

.wcgtp-variations-widget .reset_variations {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

/* ── Rótulo de etapa ────────────────────────────────────────────────────── */
.wcgtp-step-label {
    margin: 0 0 0.6rem !important;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var( --wcgtp-ink-soft );
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.3;
}

/* ── Container das opções de faixa ─────────────────────────────────────── */
.wcgtp-tier-selector {
    margin: 0 0 1.25rem;
    width: 100%;
}

.wcgtp-tier-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var( --wcgtp-border );
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

/* ── Opção individual (radio card) ─────────────────────────────────────── */
.wcgtp-tier-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1.05rem;
    background: #fff;
    border-bottom: 1px solid var( --wcgtp-border );
    cursor: pointer;
    user-select: none;
    position: relative;
    transition:
        background-color 0.25s var( --wcgtp-ease ),
        box-shadow 0.25s var( --wcgtp-ease ),
        transform 0.15s var( --wcgtp-ease );
    /* Entrada escalonada (suave) */
    animation: wcgtpCardIn 0.28s ease-out both;
    animation-delay: calc( var( --wcgtp-i, 0 ) * 35ms );
    will-change: transform, opacity;
}

.wcgtp-tier-opt:last-child {
    border-bottom: none;
}

.wcgtp-tier-opt:hover {
    background: #f7f9ff;
}

.wcgtp-tier-opt:active {
    transform: scale( 0.997 );
}

.wcgtp-tier-opt:focus-visible {
    outline: 2px solid var( --wcgtp-accent );
    outline-offset: -2px;
}

/* Indicador circular estilo radio */
.wcgtp-tier-opt::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #c5c9d2;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 5px #fff;
    transition:
        border-color 0.2s var( --wcgtp-ease ),
        background-color 0.2s var( --wcgtp-ease ),
        box-shadow 0.2s var( --wcgtp-ease );
}

/* Estado selecionado */
.wcgtp-tier-opt--checked {
    background: var( --wcgtp-accent-soft ) !important;
    box-shadow: inset 3px 0 0 var( --wcgtp-accent );
    z-index: 1;
}

.wcgtp-tier-opt--checked::before {
    border-color: var( --wcgtp-accent );
    background: var( --wcgtp-accent );
    box-shadow: inset 0 0 0 4px #fff;
    animation: wcgtpRadioPop 0.26s var( --wcgtp-ease );
}

/* Quantidade do lote */
.wcgtp-opt-qty {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var( --wcgtp-ink );
    line-height: 1.3;
    transition: color 0.2s var( --wcgtp-ease );
}

.wcgtp-tier-opt--checked .wcgtp-opt-qty {
    font-weight: 700;
    color: #1d4ed8;
}

/* Bloco de preço (total do lote + preço por unidade) */
.wcgtp-opt-pricewrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    white-space: nowrap;
}

.wcgtp-opt-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var( --wcgtp-ink );
    font-variant-numeric: tabular-nums;
    transition: color 0.2s var( --wcgtp-ease );
}

.wcgtp-tier-opt--checked .wcgtp-opt-price {
    color: #1d4ed8;
}

.wcgtp-opt-unit {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var( --wcgtp-ink-soft );
    font-variant-numeric: tabular-nums;
}

/* ── Multiplicador ──────────────────────────────────────────────────────── */
.wcgtp-multiplier-wrap {
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Garante que o atributo [hidden] vença o display:flex acima */
.wcgtp-multiplier-wrap[hidden] {
    display: none !important;
}

/* Animação de revelação */
.wcgtp-multiplier-wrap.wcgtp-anim-in {
    animation: wcgtpRevealIn 0.3s ease-out both;
}

/* Controles −/N/+ */
.wcgtp-mult-ctrl {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d6dae0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 0.6rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.05 );
}

.wcgtp-mult-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-height: 46px;
    background: #f6f7f9;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 400;
    color: #344054;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition:
        background-color 0.18s var( --wcgtp-ease ),
        transform 0.1s var( --wcgtp-ease );
}

/* Reset firme: alguns temas/kits aplicam borda colorida em <button>.
   A borda visível do seletor fica no container .wcgtp-mult-ctrl. */
.wcgtp-mult-ctrl .wcgtp-mult-btn {
    border: 0 !important;
    box-shadow: none !important;
    outline: none;
}

.wcgtp-mult-btn:hover {
    background: #eaecf0;
}

.wcgtp-mult-btn:active {
    background: #dfe2e7;
    transform: scale( 0.96 );
}

.wcgtp-mult-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var( --wcgtp-ink );
    background: #fff;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Texto informativo abaixo do multiplicador */
.wcgtp-mult-label {
    font-size: 0.8125rem;
    color: var( --wcgtp-ink-soft );
    margin: 0 0 0.5rem !important;
    line-height: 1.4;
}

/* ── Total da compra ────────────────────────────────────────────────────── */
.wcgtp-mult-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 0 0 0.9rem;
}

.wcgtp-mult-total-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var( --wcgtp-ink-soft );
}

.wcgtp-mult-total-val {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var( --wcgtp-ink );
    font-variant-numeric: tabular-nums;
    transition: color 0.2s var( --wcgtp-ease );
    /* O elemento é recriado a cada +/-, então o bump dispara em cada mudança */
    animation: wcgtpBump 0.22s ease-out;
    transform-origin: center bottom;
}

.wcgtp-mult-total-unit {
    font-size: 0.78rem;
    font-weight: 500;
    color: var( --wcgtp-ink-soft );
    font-variant-numeric: tabular-nums;
}

/* ── Botão de compra (nosso, dentro do multiplier-wrap) ─────────────────── */
.wcgtp-submit-btn {
    width: 100%;
    box-sizing: border-box;
    transition:
        transform 0.12s var( --wcgtp-ease ),
        filter 0.18s var( --wcgtp-ease ),
        box-shadow 0.18s var( --wcgtp-ease );
}

.wcgtp-submit-btn:hover {
    filter: brightness( 1.05 );
}

.wcgtp-submit-btn:active {
    transform: translateY( 1px ) scale( 0.995 );
}

/* ── Oculta qty nativo quando nossa UI está ativa ───────────────────────── */
.wcgtp-tiers-active .quantity {
    display: none !important;
}

/* ── Widget "Variações" (modo separado): mostra só os seletores ─────────────
   O preço, a quantidade e o botão nativos pertencem ao widget "Resumo da
   Compra"; aqui ficam ocultos para não duplicar nem mostrar preço solto. */
.wcgtp-variations-widget .quantity,
.wcgtp-variations-widget .single_add_to_cart_button,
.wcgtp-variations-widget .woocommerce-variation-price,
.wcgtp-variations-widget .woocommerce-variation-availability {
    display: none !important;
}

/* ── Preço na vitrine (loja / arquivo / busca) ──────────────────────────────
   Importante: as cores e tipografia HERDAM do elemento .price do tema/Elementor,
   para que os controles nativos de "Price" do widget Archive Products do
   Elementor funcionem (cor, tamanho de fonte, peso etc.). Por isso usamos
   `inherit` em vez de cores/pesos fixos. */
.wcgtp-archive-price {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.28em;
    line-height: 1.25;
    color: inherit;
}

.wcgtp-archive-price__prefix,
.wcgtp-archive-price__suffix {
    font-size: 0.8em;       /* relativo: acompanha o tamanho definido no Elementor */
    font-weight: inherit;
    color: inherit;
    opacity: 0.7;           /* leve destaque menor, ainda na cor herdada */
}

.wcgtp-archive-price__value,
.wcgtp-archive-price__value .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    font-variant-numeric: tabular-nums;
}

/* ── Erro de quantidade ─────────────────────────────────────────────────── */
.wcgtp-qty-error {
    padding: 0.75em 1em;
    margin-bottom: 1em;
    border: 1px solid #c00;
    background: #fff5f5;
    color: #c00;
    border-radius: 6px;
    font-size: 0.9em;
    animation: wcgtpRevealIn 0.3s var( --wcgtp-ease ) both;
}

/* ── Total hint no preço ────────────────────────────────────────────────── */
.wcgtp-total-hint {
    display: block;
    font-size: 0.8em;
    color: #777;
    font-weight: 400;
    margin-top: 2px;
}

/* ── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes wcgtpCardIn {
    from { opacity: 0; transform: translateY( 4px ); }
    to   { opacity: 1; transform: translateY( 0 ); }
}

@keyframes wcgtpRevealIn {
    from { opacity: 0; transform: translateY( 6px ); }
    to   { opacity: 1; transform: translateY( 0 ); }
}

@keyframes wcgtpRadioPop {
    0%   { transform: scale( 0.85 ); }
    60%  { transform: scale( 1.05 ); }
    100% { transform: scale( 1 ); }
}

@keyframes wcgtpBump {
    0%   { transform: scale( 0.97 ); opacity: 0.75; }
    60%  { transform: scale( 1.02 ); opacity: 1; }
    100% { transform: scale( 1 ); }
}

/* ── Acessibilidade: respeita preferências de movimento reduzido ─────────── */
@media ( prefers-reduced-motion: reduce ) {
    .wcgtp-tier-opt,
    .wcgtp-multiplier-wrap.wcgtp-anim-in,
    .wcgtp-tier-opt--checked::before,
    .wcgtp-mult-total-val,
    .wcgtp-qty-error {
        animation: none !important;
    }
    .wcgtp-tier-opt,
    .wcgtp-tier-opt::before,
    .wcgtp-mult-btn,
    .wcgtp-submit-btn {
        transition: none !important;
    }
}
