/* ============================================================
   PREÇO INTELIGENTE (CSL Product Price)
   ============================================================ */

body.csl-pri-modal-open {
    overflow: hidden !important;
}

.csl-preco-inteligente-container {
    margin: 15px 0;
    font-family: inherit;
}

/* Linha de Preços */
.csl-pri-main-price-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Preço Riscado (Regular) */
.csl-pri-strike-price {
    font-size: var(--csl-pri-strike-size, 16px);
    color: var(--csl-pri-strike, #94a3b8);
    text-decoration: line-through;
    line-height: 1.2;
}

.csl-pri-strike-price .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* Preço Atual e Selo de Desconto */
.csl-pri-current-price-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.csl-pri-current-price {
    font-size: var(--csl-pri-size, 32px);
    color: var(--csl-pri-color, #334155);
    font-weight: var(--csl-pri-weight, 700);
    line-height: 1.1;
}

.csl-pri-current-price .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* Selo de Desconto (X% OFF) */
.csl-pri-discount-badge {
    color: var(--csl-pri-discount-color, #10b981);
    background: var(--csl-pri-discount-bg, rgba(16, 185, 129, 0.08));
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px; /* Estilo pílula moderno */
    border: 1px solid var(--csl-pri-discount-color, rgba(16, 185, 129, 0.2));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.04);
    vertical-align: middle;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.csl-pri-discount-badge:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.12);
}

.csl-pri-discount-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

.csl-pri-discount-pct {
    line-height: 1;
}

/* Parcelamento em Destaque */
.csl-pri-installment-highlight {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 15px;
}

.csl-pri-installment-text {
    font-weight: 600;
    color: var(--csl-t-text, #334155);
    display: inline-block;
    line-height: 1.45 !important;
}

.csl-pri-inst-free {
    color: var(--csl-pri-inst-color, #10b981);
}

.csl-pri-inst-charge {
    color: var(--csl-pri-charge-color, var(--csl-t-text-secondary, #64748b));
    font-size: var(--csl-pri-charge-size, 13.5px);
    font-weight: var(--csl-pri-charge-weight, 500);
    margin-top: 4px;
    display: inline-block;
}

.csl-pri-installment-text .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.csl-pri-toggle-installments-btn {
    font-size: 13px;
    color: var(--csl-t-text-secondary, #64748b);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.csl-pri-toggle-installments-btn:hover {
    color: var(--csl-t-primary, #2271b1);
}

.csl-pri-installment-text a.csl-pri-toggle-installments-btn {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    text-decoration: underline !important;
    display: inline !important;
}

.csl-pri-installment-text a.csl-pri-toggle-installments-btn:hover {
    opacity: 0.8 !important;
}

/* Modal de Parcelamento */
.csl-pri-installments-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csl-pri-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csl-pri-modal-content {
    position: relative;
    background: var(--csl-t-bg-card, #ffffff);
    border: 1px solid var(--csl-t-border, #e2e8f0);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000000;
    overflow: hidden;
    animation: cslPriModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cslPriModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.csl-pri-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--csl-t-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csl-pri-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--csl-t-text, #1e293b);
}

.csl-pri-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    color: var(--csl-t-text-secondary, #64748b);
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.csl-pri-modal-close:hover {
    background-color: var(--csl-t-bg-muted, #f8fafc);
    color: var(--csl-t-text, #1e293b);
}

.csl-pri-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

.csl-pri-installments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--csl-t-text, #334155);
}

.csl-pri-installments-table tr {
    border-bottom: 1px solid var(--csl-t-border, #f1f5f9);
}

.csl-pri-installments-table tr:last-child {
    border-bottom: none;
}

.csl-pri-installments-table td {
    padding: 6px 4px;
    vertical-align: middle;
}

.csl-pri-table-installments-qty {
    font-weight: 700;
    width: 40px;
}

.csl-pri-table-installments-val {
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    padding-right: 15px !important;
}

.csl-pri-table-installments-interest {
    color: var(--csl-t-text-secondary, #64748b);
    text-align: right;
}

/* HTML Adicional */
.csl-pri-custom-html {
    margin-top: 15px;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================
   BARRA FLUTUANTE MOBILE (Sticky bottom bar)
   ============================================================ */

.csl-pri-floating-bar-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--csl-t-border, #f1f5f9);
    padding: 12px 18px;
    z-index: 99999;
    box-sizing: border-box;
}

.csl-floating-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    gap: 15px;
}

/* Lado Esquerdo - Preço Reduzido */
.csl-pri-floating-price-wrapper {
    margin: 0 !important;
    flex: 1;
}

.csl-pri-floating-price-wrapper .csl-pri-main-price-row {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.csl-pri-floating-price-wrapper .csl-pri-current-price-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.csl-pri-floating-price-wrapper .csl-pri-strike-price {
    font-size: 13px;
    line-height: 1;
}

.csl-pri-floating-price-wrapper .csl-pri-discount-badge {
    padding: 2px 6px;
    font-size: 9px;
    border-radius: 4px;
}

.csl-pri-floating-price-wrapper .csl-pri-current-price {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
}

/* Lado Direito - Botão de Compra */
.csl-floating-bar-button-wrapper {
    flex: 1.2;
    display: flex;
    justify-content: flex-end;
}

.csl-pri-floating-buy-btn {
    background-color: var(--csl-floating-btn-bg, #7c3aed);
    color: var(--csl-floating-btn-color, #ffffff);
    border: none;
    border-radius: 30px;
    height: 44px;
    width: 100%;
    max-width: 220px;
    font-size: 15px;
    font-weight: 700;
    text-transform: lowercase; /* conforme imagem "comprar" */
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
}

.csl-pri-floating-buy-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Evitar sobreposição com rodapé e outros botões flutuantes */
@media (max-width: 767px) {
    .csl-pri-floating-bar-mobile {
        display: block;
    }
    
    body.csl-has-floating-bar {
        padding-bottom: 75px !important; /* Espaço para a barra flutuante */
    }
    
    /* Reposiciona apenas o carrinho flutuante se for realmente fixo no rodapé */
    body.csl-has-floating-bar .csl-woocart-trigger-fixed,
    body.csl-has-floating-bar .csl-woocart-container-fixed {
        bottom: 85px !important;
        transition: bottom 0.3s ease;
    }
    
    /* Reposiciona o botão do WhatsApp ou outros itens fixos */
    body.csl-has-floating-bar .joinchat,
    body.csl-has-floating-bar .whatsapp-button {
        bottom: 85px !important;
    }

    /* Reposiciona o botão flutuante e banner de LGPD do plugin */
    body.csl-has-floating-bar .csl-lgpd-float-btn {
        bottom: 85px !important;
        transition: bottom 0.3s ease;
    }
    body.csl-has-floating-bar .csl-lgpd-popup {
        bottom: 85px !important;
        transition: bottom 0.3s ease;
    }
}

/* Animação Shake para Variações */
@keyframes cslHighlightShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.csl-highlight-shake {
    animation: cslHighlightShake 0.4s ease-in-out;
    border: 2px solid var(--csl-t-active, #f97316) !important;
    border-radius: 8px;
    padding: 10px;
}
