/* =========================================
   SEARCH POPUP STYLES - Premium Design
   ========================================= */

/* Backdrop (Fundo escuro/desfocado) */
.dfc-search-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

.dfc-search-popup-backdrop.ativo {
    opacity: 1;
    visibility: visible;
}

/* Container do Popup */
.dfc-search-popup-container {
    background: #ffffff;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dfc-search-popup-backdrop.ativo .dfc-search-popup-container {
    transform: translateY(0);
}

/* Header do Popup */
.dfc-search-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
}

.dfc-search-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.dfc-search-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.dfc-search-popup-close:hover {
    color: #e63946;
}

/* Conteúdo/Resultados */
.dfc-search-popup-content {
    padding: 20px;
    overflow-y: auto;
    min-height: 100px;
    background-color: #f8f9fa;
}

/* Loading State */
.dfc-search-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.dfc-search-loading i {
    font-size: 30px;
    margin-bottom: 10px;
    color: var(--dfc-cor-principal, #38c172);
    animation: dfc-spin 1s infinite linear;
}

@keyframes dfc-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 
   =========================================
   GRID E CARDS PADRONIZADOS
   ========================================= 
   Usando CSS Grid + Flexbox para garantir altura igual
*/

.dfc-search-popup-content .dfc-grid {
    display: grid;
    /* Grid responsivo: Cards com largura mínima de 220px */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Card Container */
.dfc-search-popup-content .dfc-produto-card-novo {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    /* Organiza verticalmente */
    height: 100%;
    /* Força altura total da célula do grid */
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.dfc-search-popup-content .dfc-produto-card-novo:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

/* Card: Imagem - Container com altura fixa */
.dfc-search-popup-content .dfc-produto-card-novo .dfc-produto-imagem-novo {
    height: 180px;
    /* Altura fixa para imagem */
    width: 100%;
    margin-bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    padding: 10px;
}

.dfc-search-popup-content .dfc-produto-card-novo .dfc-produto-imagem-novo img {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Garante que a imagem caiba sem distorcer */
}

/* Card: Corpo (Info) */
.dfc-search-popup-content .dfc-produto-info-novo {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Ocupa o espaço restante */
}

/* Card: Título */
.dfc-search-popup-content .dfc-produto-nome-novo {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.4;

    /* Limitar a 2 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
    /* 15px * 1.4 * 2 linhas approx */
}

/* Card: Descrição (resumo) */
.dfc-search-popup-content .dfc-produto-resumo-novo {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.5;

    /* Limitar a 3 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    /* Empurra o botão para baixo se houver espaço extra */
}

/* Card: Botão - Sempre no rodapé */
.dfc-search-popup-content .dfc-btn-ver-mais-novo {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    background-color: var(--dfc-cor-principal, #38c172);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;

    /* Alinhamento ao fundo */
    margin-top: auto;
}

.dfc-search-popup-content .dfc-btn-ver-mais-novo:hover {
    background-color: var(--dfc-cor-secundaria, #2e9e5e);
    color: #fff;
}

/* Scrollbar Bonita */
.dfc-search-popup-content::-webkit-scrollbar {
    width: 8px;
}

.dfc-search-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dfc-search-popup-content::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

.dfc-search-popup-content::-webkit-scrollbar-thumb:hover {
    background: #bbbbbb;
}