/* * ARQUIVO: assets/css/main.css
 * TEMA: WooCustom Senior
 * DESCRIÇÃO: Estilos principais da loja e grid de produtos
 */

/* --- 1. VARIÁVEIS E RESET BÁSICO --- */
:root {
    --color-text: #1d1d1f;       /* Preto Suave (Apple) */
    --color-text-light: #86868b; /* Cinza Texto Secundário */
    --color-accent: #000000;     /* Cor de Ação (Botões) */
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 8px;
    --transition-fast: 0.3s ease;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- 2. GRID DO ARCHIVE (A Grade da Loja) --- */
.nossa-loja-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Responsivo Automático */
    gap: 40px 24px;
    margin-bottom: 60px;
}

/* --- 3. CARD DO PRODUTO (Container) --- */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    transition: var(--transition-fast);
}

/* --- 4. ÁREA DA IMAGEM (MEDIA) --- */
.product-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* Proporção Retrato Moderna */
    background-color: var(--color-bg-alt); /* Placeholder enquanto carrega */
    border-radius: var(--border-radius);
    overflow: hidden; /* Esconde o botão que vem de baixo */
    margin-bottom: 16px;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

/* Zoom Suave no Hover */
.product-card:hover .product-media img {
    transform: scale(1.05);
}

/* --- 5. BADGES (NOVO / PROMOÇÃO) --- */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none; /* Deixa clicar na imagem atrás se precisar */
}

.badge {
    display: inline-block;
    background: #fff;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    letter-spacing: 0.5px;
    line-height: 1;
}

.badge.sale {
    background: #000;
    color: #fff;
}

/* --- 6. BOTÃO "ADICIONAR" (A Mágica do Slide Up) --- */
/* O PHP gera um <a> com as classes .btn-quick-add e .button */

.btn-quick-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    transform: translateY(100%); /* Escondido pra baixo */
    transition: transform 0.3s ease-in-out;
}

.btn-quick-add {
    display: block;
    width: 100%;
    background: var(--color-text);
    color: #fff !important; /* Força cor branca sobrescrevendo tema padrão */
    text-align: center;
    padding: 14px 0;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 0; /* Botão quadrado na base */
    cursor: pointer;
}

.btn-quick-add:hover {
    background: #333;
    color: #fff;
}

/* Loading do Ajax (WooCommerce adiciona classe .loading) */
.btn-quick-add.loading {
    opacity: 0.8;
    padding-right: 20px; /* Espaço para o spinner */
}

.btn-quick-add.added::after {
    content: " \2713"; /* Checkmark quando adicionado */
    margin-left: 5px;
}

/* Mostra o botão ao passar o mouse no CARD */
.product-card:hover .btn-quick-wrapper {
    transform: translateY(0);
}

/* --- 7. INFORMAÇÕES DO PRODUTO --- */
.product-info {
    padding: 0 4px;
}

/* Categoria */
.product-cat {
    display: block;
    color: var(--color-text-light);
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Título */
.product-title {
    font-size: 15px;
    font-weight: 500; /* Peso médio para look clean */
    margin: 0 0 6px 0;
    line-height: 1.4;
    color: var(--color-text);
}

.product-title a:hover {
    color: #000; /* Preto absoluto no hover */
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* --- 8. PREÇIFICADOR DO WOOCOMMERCE --- */
/* O Woo gera: <span class="price"><del>...</del> <ins>...</ins></span> */

.product-price {
    font-size: 15px;
    color: var(--color-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.product-price del {
    color: #999;
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.8;
}

.product-price ins {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
}

/* --- 9. ESTRELAS (Reviews) --- */
.star-rating-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 12px;
}

.star-rating {
    float: none; /* Sobrescreve float padrão do Woo */
    display: inline-block;
    font-size: 12px;
    color: #FFD700; /* Dourado */
    width: 5.4em; /* Largura para 5 estrelas */
    position: relative;
}

.review-count {
    color: #999;
    font-size: 11px;
}

/* --- 10. RESPONSIVIDADE MOBILE --- */
@media (max-width: 768px) {
    .nossa-loja-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas no celular */
        gap: 20px 15px; /* Gap menor */
    }

    /* No celular não tem hover, então o botão precisa mudar de estratégia */
    /* Opção A: Deixar sempre visível */
    /* Opção B: Transformar num ícone de carrinho flutuante (Mais complexo) */
    /* Vamos usar a Opção A simplificada para UX */
    
    .btn-quick-wrapper {
        position: static; /* Volta para o fluxo normal */
        transform: none;
        margin-top: 10px;
    }
    
    .btn-quick-add {
        border-radius: 4px; /* Borda arredondada no mobile fica melhor */
        padding: 10px 0;
        font-size: 12px;
        background: #000;
    }
    
    .product-media {
        margin-bottom: 10px;
    }
}