/**
 * Luson Parcelas & PIX — Frontend Styles
 *
 * Premium design inspired by Sephora:
 * - Clean, elegant typography
 * - Subtle color accents
 * - Minimal visual noise
 * - Responsive
 *
 * All classes namespaced with .luson-pp-* to avoid conflicts.
 *
 * @package Luson_Parcelas_PIX
 */

/* =========================================================================
   CSS VARIABLES (overridden by admin settings via inline style)
   ========================================================================= */

:root {
    --luson-pp-primary: #1a1a2e;
    --luson-pp-secondary: #6c757d;
    --luson-pp-pix: #00A86B;
    --luson-pp-font-size: 13px;
    --luson-pp-badge-bg: rgba(0, 168, 107, 0.1);
    --luson-pp-badge-color: #00A86B;
    --luson-pp-border: rgba(0, 0, 0, 0.06);
    --luson-pp-radius: 6px;
    --luson-pp-transition: 0.25s ease;
}

/* =========================================================================
   PAYMENT BOX — Main Container
   ========================================================================= */

.luson-pp-payment-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--luson-pp-border);
    font-family: inherit;
    font-size: var(--luson-pp-font-size);
    line-height: 1.5;
    color: var(--luson-pp-primary);
    opacity: 1;
    transition: opacity var(--luson-pp-transition);
}

/* Single product page — larger font */
.luson-pp-payment-box.luson-pp-ctx-single,
.luson-pp-payment-box.luson-pp-ctx-variation {
    font-size: 20px;
    gap: 6px;
    padding: 12px 0 6px;
}

.luson-pp-payment-box.luson-pp-ctx-single .luson-pp-pix-value,
.luson-pp-payment-box.luson-pp-ctx-variation .luson-pp-pix-value {
    font-size: 24px;
}

/* Single product Sephora line */
.luson-pp-sephora-single {
    display: block;
    font-size: 20px;
    font-weight: 400;
    color: var(--luson-pp-secondary);
}

/* "Ver detalhes" trigger link */
.luson-pp-details-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--luson-pp-secondary);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.luson-pp-details-trigger:hover {
    color: var(--luson-pp-primary);
}

.luson-pp-details-icon {
    font-size: 14px;
}

/* =========================================================================
   INSTALLMENTS MODAL — Glee Style
   ========================================================================= */

.luson-pp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.luson-pp-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: luson-pp-modal-in 0.25s ease-out;
}

@keyframes luson-pp-modal-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.luson-pp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.luson-pp-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.luson-pp-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.luson-pp-modal-close:hover {
    color: #333;
}

.luson-pp-modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
}

.luson-pp-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.luson-pp-modal-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 0;
    border-bottom: 2px solid #eee;
}

.luson-pp-modal-table thead th:last-child {
    text-align: right;
}

.luson-pp-modal-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
}

.luson-pp-modal-table tbody tr:hover {
    background: #fafafa;
}

.luson-pp-modal-table td {
    padding: 10px 0;
    color: #333;
}

.luson-pp-modal-table td:last-child {
    text-align: right;
}

.luson-pp-modal-total {
    color: #666;
    font-size: 13px;
}

.luson-pp-modal-noint {
    color: #00A86B;
    font-size: 12px;
    font-weight: 500;
}

.luson-pp-modal-interest {
    color: #999;
    font-size: 12px;
}

@media screen and (max-width: 480px) {
    .luson-pp-modal {
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .luson-pp-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .luson-pp-modal-body {
        padding: 12px 16px 20px;
    }

    .luson-pp-modal-table {
        font-size: 13px;
    }
}

/* =========================================================================
   SEPHORA-STYLE LOOP LINE — Product Cards
   ========================================================================= */

.luson-pp-loop-line {
    margin-top: 4px;
    line-height: 1.4;
    font-family: inherit;
}

.luson-pp-sephora-text {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--luson-pp-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Woodmart loop items */
.wd-product .luson-pp-loop-line,
.product-grid-item .luson-pp-loop-line,
.product-list-item .luson-pp-loop-line {
    margin-top: 4px;
}

/* Ensure visibility on Woodmart hover containers */
.wd-product .luson-pp-loop-line {
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 2;
}

@media screen and (max-width: 1024px) {
    .wd-product .luson-pp-loop-line,
    .product-grid-item .luson-pp-loop-line {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: block !important;
        position: relative !important;
    }

    .wd-product .product-element-bottom .luson-pp-loop-line,
    .wd-product .fade-in-block .luson-pp-loop-line,
    .wd-product .wd-fade-in .luson-pp-loop-line,
    .wd-product .hover-content .luson-pp-loop-line {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    /* Força botões do carrinho, wishlist etc do Woodmart a aparecerem no mobile sem hover */
    .wd-product .wd-buttons,
    .wd-product .woodmart-buttons,
    .wd-product .wd-add-btn,
    .wd-product .wd-action-btn,
    .wd-product .hover-content,
    .wd-product .fade-in-block,
    .wd-product .product-element-bottom {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        height: auto !important;
    }
}

@media screen and (max-width: 768px) {
    .luson-pp-sephora-text {
        font-size: 11px !important;
        white-space: nowrap !important;
    }
}

@media screen and (max-width: 480px) {
    .luson-pp-sephora-text {
        font-size: 10.5px !important;
        white-space: nowrap !important;
        letter-spacing: 0 !important;
    }
}

/* =========================================================================
   LINES
   ========================================================================= */

.luson-pp-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 22px;
}

/* =========================================================================
   PIX LINE
   ========================================================================= */

.luson-pp-pix-line {
    color: var(--luson-pp-pix);
}

.luson-pp-pix-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.luson-pp-svg-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.luson-pp-ctx-loop .luson-pp-svg-icon {
    width: 14px;
    height: 14px;
}

.luson-pp-ctx-single .luson-pp-svg-icon,
.luson-pp-ctx-variation .luson-pp-svg-icon {
    width: 18px;
    height: 18px;
}

.luson-pp-pix-value {
    font-weight: 700;
    color: var(--luson-pp-pix);
    letter-spacing: -0.01em;
}

.luson-pp-pix-label {
    font-weight: 400;
    color: var(--luson-pp-pix);
    opacity: 0.85;
}

.luson-pp-pix-discount {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--luson-pp-pix);
    opacity: 0.7;
}

/* =========================================================================
   INTEREST-FREE LINE
   ========================================================================= */

.luson-pp-free-line {
    color: var(--luson-pp-primary);
}

.luson-pp-free-text {
    font-weight: 500;
    color: var(--luson-pp-primary);
}

/* =========================================================================
   INSTALLMENT LINE
   ========================================================================= */

.luson-pp-installment-line {
    color: var(--luson-pp-secondary);
}

.luson-pp-install-text {
    color: var(--luson-pp-secondary);
    font-weight: 400;
}

.luson-pp-install-text strong {
    color: var(--luson-pp-primary);
    font-weight: 600;
}

.luson-pp-with-interest {
    font-size: 0.85em;
    color: var(--luson-pp-secondary);
    opacity: 0.7;
}

/* =========================================================================
   BADGE
   ========================================================================= */

.luson-pp-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: var(--luson-pp-badge-bg);
    color: var(--luson-pp-badge-color);
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

.luson-pp-badge-pix {
    background-color: rgba(0, 168, 107, 0.1);
    color: var(--luson-pp-pix);
}

.luson-pp-badge-free {
    background-color: rgba(0, 168, 107, 0.1);
    color: var(--luson-pp-pix);
}

.luson-pp-badge-installments {
    background-color: rgba(26, 26, 46, 0.08);
    color: var(--luson-pp-primary);
}

/* =========================================================================
   STANDALONE ELEMENTS (for shortcodes/widgets)
   ========================================================================= */

.luson-pp-pix-standalone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--luson-pp-font-size);
    color: var(--luson-pp-pix);
    line-height: 1.5;
}

.luson-pp-installments-standalone {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--luson-pp-font-size);
    color: var(--luson-pp-primary);
    line-height: 1.5;
}

.luson-pp-best-standalone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--luson-pp-font-size);
    color: var(--luson-pp-primary);
    line-height: 1.5;
}

.luson-pp-badge-standalone {
    display: inline-block;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */

.luson-pp-animate-in {
    animation: lusonPPFadeIn var(--luson-pp-transition) ease-out;
}

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

/* =========================================================================
   WOODMART COMPATIBILITY
   ========================================================================= */

/* Woodmart product page */
.wd-single-price-wrapper .luson-pp-payment-box,
.summary .luson-pp-payment-box,
.product-summary .luson-pp-payment-box {
    width: 100%;
}

/* Woodmart loop items */
.wd-product .luson-pp-payment-box,
.product-grid-item .luson-pp-payment-box,
.product-list-item .luson-pp-payment-box {
    margin-top: 4px;
    padding-top: 4px;
}

/* Woodmart Quick View */
.wd-quick-view .luson-pp-payment-box {
    margin-top: 8px;
    padding-top: 8px;
}

/* Prevent Woodmart's overflow from hiding our elements */
.wd-product .luson-pp-payment-box,
.product-element-bottom .luson-pp-payment-box {
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* Woodmart hover effects — keep payment box visible */
.wd-product:hover .luson-pp-payment-box {
    opacity: 1;
}

/* Ensure proper display inside Woodmart's flex containers */
.wd-product .product-element-bottom .luson-pp-payment-box,
.wd-product .product-information .luson-pp-payment-box {
    flex-basis: 100%;
}

/* =========================================================================
   WOODMART MOBILE — Single Product Page
   ========================================================================= */

/*
 * Loop items now use the lightweight .luson-pp-loop-line element
 * which has its own mobile rules above.
 *
 * These rules only apply to the full payment box on single product
 * pages and Quick View modals inside Woodmart.
 */

.wd-product .luson-pp-payment-box,
.wd-product .luson-pp-pix-standalone,
.wd-product .luson-pp-installments-standalone {
    overflow: visible;
    position: relative;
    z-index: 2;
}

@media screen and (max-width: 1024px) {
    .wd-quick-view .luson-pp-payment-box {
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
    }
}

/* =========================================================================
   HIDE IN INAPPROPRIATE CONTEXTS
   ========================================================================= */

/* Mini-cart / Side-cart */
.widget_shopping_cart .luson-pp-payment-box,
.widget_shopping_cart .luson-pp-loop-line,
.cart-widget-side .luson-pp-payment-box,
.cart-widget-side .luson-pp-loop-line,
.wd-side-cart .luson-pp-payment-box,
.wd-side-cart .luson-pp-loop-line,
.mini-cart .luson-pp-payment-box,
.mini-cart .luson-pp-loop-line,
.cart_list .luson-pp-payment-box,
.cart_list .luson-pp-loop-line,
.woocommerce-mini-cart .luson-pp-payment-box,
.woocommerce-mini-cart .luson-pp-loop-line,
.wd-sticky-btn .luson-pp-payment-box,
.wd-sticky-btn .luson-pp-loop-line,
.sticky-add-to-cart .luson-pp-payment-box,
.sticky-add-to-cart .luson-pp-loop-line {
    display: none !important;
}

/* Cart page */
.woocommerce-cart .luson-pp-payment-box,
.woocommerce-cart .luson-pp-loop-line,
.cart-table .luson-pp-payment-box,
.cart-table .luson-pp-loop-line {
    display: none !important;
}

/* Checkout */
.woocommerce-checkout .order-review .luson-pp-payment-box,
.woocommerce-checkout .order-review .luson-pp-loop-line {
    display: none !important;
}

/* Navigation tooltips */
.product-navigation__tooltip .luson-pp-payment-box,
.product-navigation__tooltip .luson-pp-loop-line {
    display: none !important;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media screen and (max-width: 768px) {
    .luson-pp-payment-box {
        margin-top: 6px;
        padding-top: 6px;
    }

    /* Keep single product page at 15px on tablet */
    .luson-pp-payment-box.luson-pp-ctx-single,
    .luson-pp-payment-box.luson-pp-ctx-variation {
        font-size: 15px;
    }

    .luson-pp-sephora-single {
        font-size: 15px;
    }

    .luson-pp-svg-icon {
        width: 14px;
        height: 14px;
    }
}

@media screen and (max-width: 480px) {
    .luson-pp-payment-box.luson-pp-ctx-single,
    .luson-pp-payment-box.luson-pp-ctx-variation {
        font-size: 14px;
    }

    .luson-pp-sephora-single {
        font-size: 14px;
    }
}

/* =========================================================================
   PRINT
   ========================================================================= */

@media print {
    .luson-pp-payment-box {
        border-top: 1px solid #ddd;
    }

    .luson-pp-svg-icon {
        display: none;
    }
}


/* Conserto da Quebra de Linha Sephora Style */
.luson-pp-sephora-text {
    white-space: nowrap !important;
    font-size: 11px !important;
    letter-spacing: -0.2px;
    display: block;
    line-height: 1.2;
    text-align: left;
    text-transform: none !important; /* Força letras minúsculas */
}



@media screen and (max-width: 480px) {
    .luson-pp-sephora-text {
        font-size: 10.5px !important;
    }
}

/* =========================================================================
   WOODMART PERFUMES / CUSTOM LOOP OVERFLOW & HOVER FIX
   ========================================================================= */

/* 1. Permite que o conteúdo saia da área da foto sem ser cortado pelo Woodmart */
.wd-loop-prod-thumb {
    overflow: visible !important;
}

/* 2. Remove o efeito de subir/descer que estava escondendo o valor "133,30" no mobile */
.wd-product-thumb .wd-transform,
.wd-product .wd-transform {
    transform: none !important;
    --wd-transform-translateY: 0 !important;
}

/* =========================================================================
   WOOCOMMERCE NATIVE TWEAKS
   ========================================================================= */

/* Hide the native variation price at the bottom visually but keep it in DOM for JS */
.woocommerce-variation-price {
    position: absolute !important;
    left: -9999px !important;
    visibility: hidden !important;
    height: 0 !important;
    opacity: 0 !important;
}

