/**
 * GCP Installments - Estilos
 * Parcelamento customizado para WooCommerce
 * @package GiftCardPro
 */

/* ============================
   BADGE DE PARCELAMENTO (LOOPS + SINGLE)
   ============================ */

.gcp-installments-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #b0b0b0;
}

.gcp-installments-icon {
    color: #888;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.gcp-installments-text {
    font-size: inherit;
}

/* Alinha à esquerda nos grids WoodMart para leitura natural ao quebrar */
.product-grid-item .gcp-installments-badge,
.products .product .gcp-installments-badge,
.wd-products .wd-product .gcp-installments-badge {
    justify-content: center;
    text-align: left;
}

/* ============================
   LINK "VER MAIS PARCELAMENTO" (SINGLE PRODUCT)
   ============================ */

.gcp-installments-popup-link {
    display: inline;
    background: none;
    border: none;
    color: #888;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: none;
    margin: 0 0 0 4px;
    padding: 0;
    letter-spacing: 0;
    transition: color 0.2s ease;
}

.gcp-installments-popup-link:hover {
    color: #ffba08;
    text-decoration: underline;
}

/* ============================
   POPUP OVERLAY
   ============================ */

.gcp-installments-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gcp-installments-popup-overlay.active {
    display: flex;
    opacity: 1;
}

/* ============================
   POPUP CONTEÚDO
   ============================ */

.gcp-installments-popup-content {
    background: #1e1e2e;
    border-radius: 14px;
    max-width: 520px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: gcp-popup-enter 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes gcp-popup-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.gcp-installments-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gcp-installments-popup-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
}

/* Botão de fechar */
.gcp-installments-popup-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.gcp-installments-popup-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* Body */
.gcp-installments-popup-body {
    padding: 16px 24px 24px;
}

/* ============================
   TABELA DE PARCELAS
   ============================ */

.gcp-installments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.gcp-installments-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gcp-installments-table tbody tr {
    transition: background 0.15s ease;
}

.gcp-installments-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.gcp-installments-table tbody td {
    padding: 12px 12px;
    color: #d0d0d0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.gcp-installments-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges de juros */
.gcp-fee-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(255, 186, 8, 0.12);
    color: #ffba08;
    margin-left: 6px;
}

.gcp-no-fee-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(57, 147, 92, 0.12);
    color: #39935c;
    margin-left: 6px;
}

/* Linha "sem juros" destaque */
.gcp-installments-table tbody tr.no-fee td {
    color: #e0e0e0;
}

/* ============================
   RESPONSIVO
   ============================ */

@media (max-width: 600px) {
    .gcp-installments-popup-content {
        width: 96%;
        margin: 10px;
        border-radius: 12px;
    }

    .gcp-installments-popup-header {
        padding: 16px 18px;
    }

    .gcp-installments-popup-body {
        padding: 12px 18px 20px;
    }

    .gcp-installments-table thead th {
        padding: 8px;
        font-size: 0.7rem;
    }

    .gcp-installments-table tbody td {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    .gcp-fee-badge,
    .gcp-no-fee-badge {
        font-size: 0.65rem;
        padding: 1px 5px;
    }
}

/* ============================
   CHECKOUT - LINHA DE JUROS
   ============================ */

.fee .amount {
    color: #ffba08;
}

/* ============================
   CHECKOUT - SELECT DE PARCELAS ASAAS
   Força tema claro nas options do dropdown
   ============================ */

#asaas-cc-installments,
select[name="asaas_cc_installments"],
.woocommerce-checkout select[id*="asaas"],
.woocommerce-checkout select[name*="asaas"] {
    background-color: #fff !important;
    color: #333 !important;
    color-scheme: light !important;
    -webkit-appearance: menulist !important;
    appearance: menulist !important;
}

#asaas-cc-installments option,
select[name="asaas_cc_installments"] option,
.woocommerce-checkout select[id*="asaas"] option,
.woocommerce-checkout select[name*="asaas"] option {
    background-color: #fff !important;
    color: #333 !important;
}
