/* ==========================================================================
   ESTILO DA VITRINE (FRONT-END & PREVIEW)
   ========================================================================== */

/* CONTAINER PRINCIPAL E RESET */
/* Isola o estilo do banner para não herdar problemas do tema */
.aia-banner-container {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* Garante que padding e border não aumentem a largura dos elementos */
.aia-banner-container * {
    box-sizing: border-box;
}

/* Link Wrapper Genérico (para temas que forçam estilo em links) */
.aia-banner-container a {
    text-decoration: none !important;
    color: inherit !important;
    border: none;
    box-shadow: none;
}

/* BLOCO CARD (O CARTÃO DO PRODUTO) */
.bloco-elegante-gerado {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative; /* Essencial para o link funcionar */
    margin-bottom: 25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bloco-elegante-gerado:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* LINK ESTICADO (COBRE TUDO) - TÉCNICA "STRETCHED LINK" */
/* Cria uma camada invisível sobre o card que captura o clique */
.aia-stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    content: "";
    cursor: pointer;
    background-color: rgba(0,0,0,0); /* Transparente */
}

/* IMAGEM (COLUNA ESQUERDA) */
.elegante-imagem-container {
    width: 35%;
    min-width: 200px;
    max-width: 300px;
    padding: 20px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
}

.elegante-imagem img {
    max-width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: none;
}

.elegante-imagem-container figcaption {
    font-size: 11px;
    color: #999;
    margin-top: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* CONTEÚDO (COLUNA DIREITA) */
.elegante-conteudo {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Corrige bug do Flexbox com texto longo */
}

.elegante-titulo {
    margin: 0 0 10px 0 !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #222 !important;
    text-align: left;
}

.elegante-descricao {
    font-size: 15px !important;
    color: #555 !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.5 !important;
    text-align: left;
}

.elegante-disclaimer {
    font-size: 11px !important;
    color: #888 !important;
    margin-top: 15px !important;
    font-style: italic !important;
    border-top: 1px dashed #eee;
    padding-top: 10px;
    line-height: 1.4 !important;
    text-align: left;
}

/* BOTÕES (Z-INDEX SUPERIOR) */
/* Precisam de z-index > 10 para ficarem acima do link esticado */
.elegante-cta-container {
    position: relative;
    z-index: 11; 
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

/* Botão Principal (Hero) */
.botao-comprar {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 14px !important;
    color: #fff !important;
    background: #0073aa;
    text-decoration: none !important;
    border: none !important;
    transition: transform 0.2s, background-color 0.2s;
    line-height: 1 !important;
    cursor: pointer;
}

.botao-comprar:hover {
    transform: translateY(-2px);
    background: #005a87;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.botao-comprar .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Botão Secundário (Multi-Loja) */
.botao-multi-loja {
    font-size: 13px !important;
    padding: 10px 18px !important;
    background-color: #333 !important;
    color: #fff !important;
}

.botao-multi-loja:hover {
    background-color: #555 !important;
    transform: translateY(-1px);
}

/* Animação Pulsante */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 115, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0); }
}
.pulsing-button { animation: pulse-green 2s infinite; }

/* RESPONSIVIDADE (MOBILE) */
@media (max-width: 768px) {
    .bloco-elegante-gerado.com-imagem { 
        flex-direction: column; 
        text-align: center; 
    }
    
    .elegante-imagem-container { 
        width: 100%; 
        min-width: auto;
        max-width: none; 
        border-right: none; 
        border-bottom: 1px solid #f0f0f0; 
        padding: 20px;
    }
    
    .elegante-imagem img {
        max-height: 200px;
    }
    
    .elegante-conteudo {
        padding: 20px;
        text-align: center;
    }
    
    .elegante-titulo, .elegante-descricao, .elegante-disclaimer {
        text-align: center !important;
    }
    
    .elegante-cta-container { 
        justify-content: center; 
    }
}

/* ==========================================================================
   ESTILOS DO PAINEL ADMIN (BACKEND)
   ========================================================================== */
#aia-banner-builder-wrapper { 
    display: flex; 
    gap: 30px; 
    margin-top: 20px; 
    align-items: flex-start;
}

.aia-builder-controls { 
    flex: 1; 
    min-width: 450px; 
}

.aia-builder-preview-wrapper { 
    flex: 1; 
    position: -webkit-sticky; 
    position: sticky; 
    top: 50px; 
    background: #fff; 
    border: 1px solid #ccd0d4; 
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.aia-preview-header {
    background: #f0f0f1;
    padding: 10px 15px;
    border-bottom: 1px solid #ccd0d4;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    font-size: 12px;
}

#aia-banner-preview-canvas { 
    padding: 20px; 
    background: #f9f9f9; 
    min-height: 300px; 
}

/* Barra de Ferramentas */
.aia-toolbar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}
.aia-toolbar-sep {
    height: 20px; width: 1px; background: #ddd; margin: 0 15px;
}

/* Itens da Lista (Backend) */
.aia-product-item { 
    background: #fff; 
    border: 1px solid #ccd0d4; 
    margin-bottom: 15px; 
    border-radius: 6px; 
}

.aia-item-header { 
    padding: 10px 15px; 
    background: #f6f7f7; 
    border-bottom: 1px solid #ccd0d4; 
    display: flex; 
    align-items: center;
    cursor: move; 
    border-radius: 6px 6px 0 0;
}

.aia-item-header .handle { color: #ccc; margin-right: 10px; }
.item-title-preview { flex: 1; font-weight: 600; font-size: 14px; }
.aia-item-header button { background: none; border: none; cursor: pointer; color: #666; }
.aia-item-header button:hover { color: #0073aa; }

.aia-item-body { padding: 15px; display: none; }

/* Formulários do Backend */
.aia-form-row { margin-bottom: 15px; }
.aia-form-row label { display: block; font-weight: 500; margin-bottom: 5px; color: #444; }
.full-width { width: 100%; }

.split-row { display: flex; gap: 15px; }
.half { flex: 1; }

.image-input-wrapper { display: flex; gap: 5px; }
.image-input-wrapper input { flex: 1; }

/* Lista de Lojas (Backend) */
.aia-stores-section { 
    background: #fafafa; 
    padding: 15px; 
    border: 1px solid #eee; 
    border-radius: 4px;
    margin-top: 15px;
}

.aia-store-item { 
    display: flex; 
    gap: 5px; 
    margin-bottom: 8px; 
    background: #fff; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 3px;
    align-items: center;
}
.aia-store-item .store-handle { color: #ddd; cursor: move; }