/* AfiliaLab Frontend CSS - CARD ÚNICO SEM CORTES */

/* ===== CARD INDIVIDUAL - TAMANHO ÚNICO EM TODAS AS TELAS ===== */
.afilialab-produto-card {
    width: 100%;
    max-width: 320px; /* Tamanho único para todas as telas */
    min-width: 300px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 0 auto 20px auto;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
}

.afilialab-produto-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* IMAGEM SEM CORTES - OBJECT-FIT: CONTAIN */
.afilialab-produto-imagem {
    width: 100%;
    height: 200px; /* Altura fixa para consistência */
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.afilialab-produto-imagem img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* MUDANÇA: contain em vez de cover - mostra imagem completa */
    object-position: center;
}

.afilialab-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

/* INFO DO PRODUTO */
.afilialab-produto-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* TÍTULO COMO NO EXEMPLO */
.afilialab-produto-nome {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
    line-height: 1.3;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* DESCRIÇÃO COMO NO EXEMPLO */
.afilialab-produto-descricao {
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* PREÇO GRANDE COMO NO EXEMPLO */
.afilialab-produto-preco {
    margin-bottom: 12px;
}

.preco-valor {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    display: block;
    margin-bottom: 4px;
}

/* LOJA COMO NO EXEMPLO */
.afilialab-produto-loja {
    margin-bottom: 12px;
    font-size: 13px;
    color: #718096;
}

.disponivel-na {
    display: inline;
    margin-right: 4px;
}

.nome-loja {
    color: #2d3748;
    font-weight: 500;
}

/* AVALIAÇÃO COMO NO EXEMPLO */
.afilialab-produto-avaliacao {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.estrelas-amarelas {
    color: #f59e0b;
    font-size: 14px;
}

.afilialab-nota {
    color: #718096;
    font-weight: 500;
}

/* BOTÃO VERDE COMO NO EXEMPLO */
.afilialab-produto-botao {
    margin-top: auto;
}

.afilialab-btn-oferta {
    display: block;
    width: 100%;
    background: #38a169;
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.afilialab-btn-oferta:hover {
    background: #2f855a;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ===== COMPARATIVO COM IMAGEM - 5 NO DESKTOP, 1 NAS OUTRAS TELAS ===== */
.afilialab-comparativo-simples {
    max-width: 100%;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

/* GRID - DESKTOP 5, OUTRAS TELAS 1 */
.produtos-comparativo {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    align-items: stretch;
}

.produto-comparativo-item {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 220px;
    text-align: center;
    padding: 16px 12px;
}

.produto-comparativo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #38a169;
}

/* TÍTULO COMPARATIVO */
.produto-nome {
    margin-bottom: 10px;
}

.produto-nome h4 {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 10px 0;
    line-height: 1.3;
    min-height: 34px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* IMAGEM DO PRODUTO NO COMPARATIVO (DEPOIS DO TÍTULO) */
.produto-imagem-comparativo {
    width: 100%;
    height: 80px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-bottom: 10px;
}

.produto-imagem-comparativo img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Também sem corte no comparativo */
}

.produto-sem-imagem {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f1f5f9;
    color: #9ca3af;
    font-size: 10px;
    border-radius: 4px;
    text-align: center;
}

/* LOJA SEM "DISPONÍVEL NA" */
.produto-loja {
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

/* AVALIAÇÃO NO COMPARATIVO */
.produto-avaliacao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 11px;
}

.produto-estrelas {
    color: #f59e0b;
    font-size: 12px;
}

.produto-nota {
    color: #718096;
    font-weight: 500;
}

/* BOTÃO COMPARATIVO */
.produto-botao {
    margin-top: auto;
}

.btn-ver-oferta {
    display: block;
    width: 100%;
    background: #38a169;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-ver-oferta:hover {
    background: #2f855a;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ===== RESPONSIVIDADE - 1 CARD POR LINHA EM TELAS MENORES ===== */

/* Tablet e menores - 1 card por linha, tamanho de card individual */
@media (max-width: 1200px) {
    .produtos-comparativo {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 320px;
        margin: 0 auto;
    }

    .produto-comparativo-item {
        min-height: auto;
        padding: 20px;
        text-align: left;
        flex-direction: column;
        align-items: flex-start;
    }

    .produto-nome {
        margin-bottom: 12px;
        text-align: left;
        width: 100%;
    }

    .produto-nome h4 {
        font-size: 16px;
        min-height: auto;
        margin-bottom: 10px;
        text-align: left;
    }

    .produto-imagem-comparativo {
        height: 120px;
        margin-bottom: 12px;
    }

    .produto-loja {
        font-size: 13px;
        margin-bottom: 8px;
        text-align: left;
    }

    .produto-avaliacao {
        justify-content: flex-start;
        margin-bottom: 12px;
        font-size: 12px;
    }

    .produto-estrelas {
        font-size: 13px;
    }

    .produto-botao {
        margin-top: 8px;
        width: 100%;
    }

    .btn-ver-oferta {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* MOBILE - CARD ÚNICO SEM CORTES COM MARGENS */
@media (max-width: 768px) {
    /* CARD INDIVIDUAL - TAMANHO ÚNICO COM MARGENS */
    .afilialab-produto-card {
        max-width: 320px; /* Tamanho único fixo */
        min-width: 300px; /* Tamanho mínimo */
        margin: 0 10px 20px 10px; /* Margens laterais */
        width: auto; /* Largura automática baseada nos min/max */
    }

    /* IMAGEM SEM CORTES NO MOBILE */
    .afilialab-produto-imagem {
        height: 200px; /* Altura mantida */
    }

    .afilialab-produto-imagem img {
        object-fit: contain; /* SEMPRE mostra imagem completa */
        object-position: center;
    }

    .afilialab-produto-info {
        padding: 16px; /* Padding reduzido mas adequado */
    }

    .afilialab-produto-nome {
        font-size: 16px;
        min-height: 40px;
    }

    .afilialab-produto-descricao {
        font-size: 12px;
        line-height: 1.4;
    }

    .preco-valor {
        font-size: 20px;
    }

    .afilialab-produto-loja {
        font-size: 12px;
    }

    .afilialab-produto-avaliacao {
        font-size: 12px;
    }

    .afilialab-btn-oferta {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* COMPARATIVO NO MOBILE */
    .produto-comparativo-item {
        text-align: center;
        align-items: center;
        padding: 16px;
        margin: 0 10px;
    }

    .produto-nome {
        text-align: center;
        margin-bottom: 10px;
    }

    .produto-nome h4 {
        text-align: center;
    }

    .produto-imagem-comparativo {
        height: 100px;
        align-self: center;
    }

    .produto-loja {
        text-align: center;
    }

    .produto-avaliacao {
        justify-content: center;
        margin-bottom: 12px;
    }
}

/* MOBILE MUITO PEQUENO - AJUSTES FINAIS */
@media (max-width: 480px) {
    .afilialab-produto-card {
        max-width: 300px; /* Um pouco menor para telas muito pequenas */
        min-width: 280px;
        margin: 0 5px 20px 5px; /* Margens menores */
    }

    .afilialab-produto-info {
        padding: 12px;
    }

    .afilialab-produto-nome {
        font-size: 15px;
        min-height: 36px;
    }

    .preco-valor {
        font-size: 18px;
    }

    .produto-comparativo-item {
        margin: 0 5px;
        padding: 12px;
    }
}

/* ===== CONTAINER RESPONSIVO PARA CENTRALIZAR ===== */
@media (max-width: 768px) {
    .afilialab-produto-card {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Animações suaves */
.afilialab-produto-card,
.produto-comparativo-item {
    animation: fadeIn 0.5s ease-out;
}

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