:root {
    --primary-color: #2563eb;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --price-color: #16a34a;
    --whatsapp-color: #25D366;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

/* Grid de Produtos */
.grid-produtos {
    display: grid;
    /* Responsividade mágica sem media queries manuais */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Card do Produto */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-img-container {
    width: 100%;
    height: 200px; /* Altura fixa para alinhar */
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* ou cover, dependendo da foto */
    padding: 10px;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-tags {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #000;
}

.card-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--price-color);
    margin-bottom: 15px;
}

/* Botão WhatsApp */
.btn-zap {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--whatsapp-color);
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
    gap: 8px;
}

.btn-zap:hover {
    background-color: #1ebc57;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: #666;
}

footer {
    text-align: center;
    padding: 40px;
    margin-top: 40px;
    color: #888;
}

/* --- Adicione isso no final do seu style.css --- */

.card-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px 20px 0 20px; /* Espaço para não grudar nos lados */
    overflow-x: auto; /* Permite rolar pro lado se tiver muitas fotos */
    justify-content: center;
}

.thumb-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.7;
}

.thumb-img:hover, .thumb-img.ativo {
    border-color: var(--primary-color);
    opacity: 1;
    transform: scale(1.1);
}

/* Ajuste no container da imagem principal para comportar a galeria */
.card-img-container {
    height: auto; /* Deixa a altura flexível */
    min-height: 200px;
    flex-direction: column; /* Empilha foto principal e thumbs */
    padding-bottom: 10px;
}

/* --- ESTILO DA PÁGINA DE PRODUTO --- */

/* =========================================
   ESTILO DA PÁGINA DE PRODUTO (REFEITO)
   ========================================= */

/* Container Principal - Mobile First (Padrão Celular) */
.produto-wrapper {
    display: flex;
    flex-direction: column; /* Empilha um embaixo do outro */
    background: #fff;
    padding: 0; /* Remove padding externo no mobile pra foto ir de ponta a ponta */
    border-radius: 0; /* Quadrado no mobile fica mais moderno */
    box-shadow: none;
    gap: 15px;
    padding-bottom: 40px;
}

/* 1. Área da Imagem Principal (Mobile) */
.galeria-main {
    width: 100%;
    /* Altura dinâmica baseada na largura (Quadrado perfeito ou 4:3) */
    aspect-ratio: 1 / 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Garante que o óculos inteiro apareça */
    transition: transform 0.3s ease;
}

/* 2. Área das Miniaturas (Mobile - Rolagem Lateral) */
.galeria-thumbs {
    display: flex;
    flex-direction: row; /* Um ao lado do outro */
    gap: 10px;
    padding: 5px 15px; /* Espaço nas laterais */
    overflow-x: auto; /* Permite rolar pro lado com o dedo */
    scroll-behavior: smooth;
    /* Esconde barra de rolagem feia */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.galeria-thumbs::-webkit-scrollbar {
    display: none;
}

.thumb-item {
    width: 60px; /* Tamanho bom pro dedo */
    height: 60px;
    flex-shrink: 0; /* Não deixa esmagar a miniatura */
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
}

.thumb-item.ativo {
    border-color: var(--primary-color);
    border-width: 2px;
    opacity: 1;
}

/* 3. Área de Informações (Mobile) */
.produto-info {
    padding: 0 20px; /* Margem interna pro texto não grudar na borda */
}

.produto-info .tags {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.produto-info h1 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #111;
}

.produto-info .preco-grande {
    font-size: 2rem;
    color: var(--price-color);
    font-weight: 700;
    margin-bottom: 25px;
}

/* Botão de Compra Gigante no Mobile */
.produto-info .btn-zap {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 50px; /* Redondinho moderno */
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); /* Sombra verde */
}

/* =========================================
   VERSÃO DESKTOP (PC e Tablets)
   ========================================= */
@media (min-width: 768px) {
    
    .container {
        padding: 40px 20px;
    }

    .produto-wrapper {
        /* Transforma em Grid de 3 Colunas: Miniaturas | Foto | Info */
        display: grid;
        grid-template-columns: 80px minmax(300px, 500px) 1fr;
        align-items: start;
        gap: 30px;
        
        /* Devolve o visual de "Cartão" */
        background: #fff;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    }

    /* 1. Miniaturas voltam a ser verticais na esquerda */
    .galeria-thumbs {
        flex-direction: column;
        padding: 0;
        overflow-x: visible;
    }

    .thumb-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1; /* Quadrado */
    }

    /* 2. Imagem Principal */
    .galeria-main {
        border: 1px solid #eee;
        border-radius: 12px;
        height: auto;
        aspect-ratio: 1; /* Mantém quadrado */
    }

    /* 3. Ajustes de Texto */
    .produto-info {
        padding: 0;
    }
    
    .produto-info h1 {
        font-size: 2.2rem;
    }
}

/* --- BARRA DE FILTROS --- */
.barra-filtros {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: sticky; /* Cola o menu no topo ao rolar */
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.filtro-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    font-weight: 600;
}

.filtro-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Permite rolar lateralmente */
    padding-bottom: 5px;
    /* Esconde a barra de rolagem feia */
    scrollbar-width: none; 
}

.filtro-scroll::-webkit-scrollbar {
    display: none;
}

.btn-filtro {
    background: #f1f5f9;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    white-space: nowrap; /* Não deixa o texto quebrar linha */
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-filtro:hover {
    background: #e2e8f0;
}

/* Estilo do botão quando clicado */
.btn-filtro.ativo {
    background: var(--primary-color);
    color: white;
}