/*
 * Credit Cards Comparison Table - Complete Styles
 * Replica exata do design da imagem de referência
 */

/* === CONTAINER PRINCIPAL === */
.credit-cards-comparison {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
}

.credit-cards-comparison .wp-block-group {
    border-radius: 0 !important;
}

/* === HEADER DA TABELA === */
.credit-cards-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    gap: 16px;
    position: relative;
    overflow: visible;
}

.credit-cards-header > * {
    margin: 0 !important;
    text-align: left;
}

/* === ÍCONE DE INFORMAÇÃO E TOOLTIP === */
.info-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    margin-top: 2px;
    cursor: pointer;
    padding: 2px;
}

.info-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    vertical-align: middle;
}

.info-icon-container:hover .info-icon {
    opacity: 1;
}

/* Tooltip dinâmico criado via JavaScript */
.dynamic-tooltip {
    position: fixed;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    max-width: 320px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #374151;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dynamic-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Permite interação quando visível */
}

/* === LINHAS DOS CARTÕES === */
.credit-card-row {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 0;
    transition: background-color 0.2s ease;
    gap: 16px;
    min-height: 120px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.credit-card-row:hover {
    background-color: rgba(59, 130, 246, 0.02);
}

.credit-card-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

/* === COLUNA DO CARTÃO === */
.credit-card-row > .wp-block-group:nth-child(1) {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 0 0 280px;
    margin: 0 !important;
}

/* === IMAGEM DO CARTÃO === */
.card-icon-image {
    margin: 0 !important;
    flex-shrink: 0;
    width: 64px !important;
    height: 40px !important;
}

.card-icon-image img {
    border-radius: 6px !important;
    object-fit: cover !important;
    width: 64px !important;
    height: 40px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.card-icon-image:hover img {
    transform: scale(1.05);
}

/* === DETALHES DO CARTÃO === */
.credit-card-row .wp-block-group:nth-child(1) > .wp-block-group {
    margin: 0 !important;
    white-space: normal;
}

.credit-card-row .wp-block-group:nth-child(1) h4 {
    margin: 0 0 4px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}

.credit-card-row .wp-block-group:nth-child(1) p {
    margin: 0 !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: #6B7280 !important;
}

/* === COLUNAS DE CONTEÚDO === */
.credit-card-row > .wp-block-paragraph:nth-child(2),
.credit-card-row > .wp-block-group:nth-child(2) {
    flex: 0 0 120px;
    margin: 0 !important;
    white-space: normal;
    word-wrap: break-word;
}

.credit-card-row > .wp-block-paragraph:nth-child(2) {
    font-size: 14px !important;
    color: #374151 !important;
    line-height: 1.4 !important;
}

.credit-card-row > .wp-block-group:nth-child(2) p {
    margin: 0 !important;
    font-size: 14px !important;
    color: #374151 !important;
    line-height: 1.4 !important;
}

.credit-card-row > .wp-block-group:nth-child(3) {
    flex: 0 0 140px;
    margin: 0 !important;
    white-space: normal;
}

.credit-card-row > .wp-block-group:nth-child(4) {
    flex: 0 0 140px;
    margin: 0 !important;
    white-space: normal;
}

.credit-card-row .wp-block-group:nth-child(4) p {
    margin: 0 !important;
    font-size: 14px !important;
    color: #374151 !important;
    text-align: center !important;
    font-weight: 400 !important;
}

.credit-card-row > .wp-block-paragraph:nth-child(5) {
    flex: 0 0 100px;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    white-space: nowrap;
    text-align: center !important;
}

.credit-card-row > .wp-block-group:nth-child(6) {
    flex: 0 0 180px;
    margin: 0 !important;
    white-space: normal;
}

/* === OFERTAS E BADGES === */
.credit-card-row .wp-block-group:nth-child(3) p {
    margin: 0 0 4px 0 !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    white-space: normal;
    word-wrap: break-word;
}

/* Badge normal - texto simples sem fundo */
.credit-card-row .wp-block-group:nth-child(3) p {
    background: transparent !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-align: left !important;
    line-height: 1.4 !important;
}

/* === BOTÕES === */
.credit-card-row .wp-block-group:nth-child(6) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
}

.credit-card-row .wp-block-button {
    margin: 0 !important;
}

.credit-card-row .wp-block-button a {
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    text-align: center !important;
    min-width: 100px !important;
}

.credit-card-row .wp-block-button a:hover {
    transform: translateY(-1px) !important;
}

.credit-card-row .wp-block-group:nth-child(6) p {
    margin: 0 !important;
    font-size: 11px !important;
}

.credit-card-row .wp-block-group:nth-child(6) p a {
    text-decoration: underline !important;
    font-size: 14px !important;
    text-align: center !important;
    display: block !important;
    margin-top: 8px !important;
    line-height: 16px !important;
    font-weight: 500 !important;
}

/* === FORÇA LAYOUT HORIZONTAL - PREVINE QUEBRAS DE LINHA === */
.credit-card-row > * {
    flex-shrink: 0 !important;
}

.credit-card-row .wp-block-group,
.credit-card-row .wp-block-paragraph {
    overflow: hidden;
}

/* Ajustes específicos para textos longos */
.credit-card-row .wp-block-group:nth-child(3),
.credit-card-row .wp-block-group:nth-child(6) {
    overflow: visible !important;
}

/* === ESTILOS ESPECÍFICOS PARA ELEMENTOS === */
.card-icon-image {
    flex-shrink: 0;
}

.card-icon-image img {
    width: 60px !important;
    height: 40px !important;
    object-fit: contain;
    border-radius: 6px;
}

.card-details {
    flex: 1;
    min-width: 0;
}

.card-details h4 {
    margin: 0 0 4px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 !important;
}

/* === RESPONSIVO === */
@media (max-width: 1024px) {
    .credit-cards-comparison {
        overflow-x: auto;
        padding: 16px;
    }

    .credit-cards-header,
    .credit-card-row {
        min-width: 900px;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .credit-cards-header,
    .credit-card-row {
        flex-direction: column;
        align-items: stretch;
        min-width: auto;
        gap: 8px;
    }

    .credit-cards-header > *,
    .credit-card-row > * {
        flex: none !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        min-width: auto !important;
        text-align: left !important;
    }

    .credit-card-row > .wp-block-group:nth-child(1) {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .card-icon-image img {
        width: 48px !important;
        height: 32px !important;
    }

    .credit-card-row .wp-block-button a {
        width: 100% !important;
        text-align: center !important;
    }
}

/* === IMPROVED CARD LAYOUT === */
.credit-card-row {
    display: flex !important;
    align-items: flex-start !important;
    padding: 16px !important;
    gap: 16px !important;
    min-height: 80px !important;
}

.credit-card-row:hover {
    background-color: rgba(59, 130, 246, 0.02) !important;
}

.credit-card-row:last-child {
    border-bottom: none !important;
}

.credit-card-row > * {
    margin: 0 !important;
}

/* === COLUMN headers SIZES === */

.credit-cards-header > *:nth-child(1) {
    flex: 0 0 22% !important;
}

.credit-cards-header > *:nth-child(2) {
    flex: 0 0 14% !important;
}

.credit-cards-header > *:nth-child(3) {
    flex: 0 0 14% !important;
}

.credit-cards-header > *:nth-child(4) {
    flex: 0 0 10% !important;
}

.credit-cards-header > *:nth-child(5) {
    flex: 0 0 10% !important;
}

.credit-cards-header > *:nth-child(6) {
    flex: 0 0 10% !important;
}

/* === COLUMN SIZES === */

.credit-card-row > *:nth-child(1) {
    flex: 0 0 25% !important;
    min-width: 200px !important;
}

.credit-card-row > *:nth-child(2) {
    flex: 0 0 15% !important;
    min-width: 120px !important;
}

.credit-card-row > *:nth-child(3) {
    flex: 0 0 15% !important;
    min-width: 120px !important;
}

.credit-card-row > *:nth-child(4) {
    flex: 0 0 15% !important;
    min-width: 120px !important;
}

.credit-card-row > *:nth-child(5) {
    flex: 0 0 10% !important;
    min-width: 80px !important;
}

.credit-card-row > *:nth-child(6) {
    flex: 0 0 15% !important;
    min-width: 120px !important;
}

/* === CARD INFO STRUCTURE === */
.credit-card-row .wp-block-group:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
}

.credit-card-row .wp-block-group:first-child > .wp-block-group:first-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

/* === STAR RATINGS === */
.credit-card-rating {
    color: #FFC107 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    font-weight: 500 !important;
    align-self: flex-start !important;
}

/* === TABLE ROUNDED BORDERS === */
.credit-cards-comparison {
    overflow: hidden !important;
    border-radius: 12px !important;
}

.credit-cards-header {
    border-radius: 12px 12px 0 0 !important;
}

.credit-card-row:last-child {
    border-radius: 0 0 12px 12px !important;
}
