/* ========================================
   GRID MODERNA DE PRODUTOS - CATEGORIAS
   ======================================== */

/* Container principal da grid */
.ProdutosListagem {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

/* Cada item de produto - Card Moderno Centralizado */
.ProdutosListagem li,
.ProdutosListagem .product-card {
    list-style: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: auto;
    min-height: 420px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    min-width: 250px;
}

.ProdutosListagem li:hover,
.ProdutosListagem .product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
    border-color: #c00;
}

/* Imagem do produto - Centralizada */
.ProdutosListagem .ProductImage {
    text-align: center;
    margin: 0 auto 12px auto;
    background: #FFFFFF;
    padding: 12px;
    border-radius: 8px;
    flex-shrink: 0;
    width: 100%;
    max-width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ProdutosListagem .ProductImage a {
    display: block;
    width: 100%;
}

.ProdutosListagem .ProductImage img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    max-height: 200px;
    object-fit: contain;
}

/* Detalhes do produto - Centralizados */
.ProdutosListagem .ProductDetails {
    flex-grow: 1;
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ProdutosListagem .ProductDetails h3,
.ProdutosListagem .ProductDetails .product-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.ProdutosListagem .ProductDetails a,
.ProdutosListagem .ProductDetails .product-title a {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    min-height: 40px;
    text-align: center;
}

.ProdutosListagem .ProductDetails a:hover {
    color: #c00;
}

/* Avaliação (Estrelas) - Centralizada */
.ProdutosListagem .product-rating,
.ProdutosListagem .ProductImage .Rating {
    display: block;
    margin: 6px auto;
    text-align: center;
}

.ProdutosListagem .product-rating img,
.ProdutosListagem .Rating img {
    display: inline-block;
    vertical-align: middle;
}

/* Preços - Centralizados */
.ProdutosListagem .ProductPriceRating {
    margin: 8px 0;
    text-align: center;
    width: 100%;
}

.ProdutosListagem .ProductPriceRating em,
.ProdutosListagem .ProductPriceRating .product-price {
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    color: #c00;
    display: block;
    text-align: center;
}

.ProdutosListagem li strike {
    font-weight: normal;
    font-size: 13px;
    color: #999;
    display: block;
    margin: 4px 0;
    text-align: center;
}

/* Destaques (frete, promoções) - Centralizados */
.ProdutosListagem .product-highlights,
.ProdutosListagem li > div:not(.ProductImage):not(.ProductDetails):not(.ProductPriceRating):not(.ProductActionAdd) {
    font-size: 11px;
    color: #666;
    margin: 6px 0;
    line-height: 1.5;
    text-align: center;
    width: 100%;
}

/* Botão comprar - Desktop Moderno (apenas >768px) */
@media screen and (min-width: 769px) {
    .ProdutosListagem .ProductActionAdd {
        text-align: center;
        margin-top: auto;
        padding-top: 12px;
    }

    .ProdutosListagem .ProductActionAdd a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        background: #c00 !important;
        color: #fff !important;
        padding: 12px 24px !important;
        border-radius: 25px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 3px 8px rgba(192,0,0,0.3) !important;
        min-width: 160px !important;
    }

    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline):hover {
        background: #a00 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 12px rgba(192,0,0,0.4) !important;
    }

    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline):active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 4px rgba(192,0,0,0.3) !important;
    }

    /* Esconder imagem original do botão (comprar.gif) */
    .ProdutosListagem .ProductActionAdd a img {
        display: none !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* Ícone do carrinho SVG à esquerda */
    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline)::before {
        content: '' !important;
        display: inline-block !important;
        width: 18px !important;
        height: 18px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        flex-shrink: 0 !important;
    }

    /* Texto "COMPRAR" após o ícone */
    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline)::after {
        content: 'COMPRAR' !important;
        display: inline !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        color: #fff !important;
    }
}

/* Responsividade */
/* Desktop grande - 4+ colunas */
@media screen and (min-width: 1400px) {
    .ProdutosListagem {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Desktop médio - 3-4 colunas */
@media screen and (max-width: 1399px) and (min-width: 1025px) {
    .ProdutosListagem {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }
}

/* Tablet - 2-3 colunas (FIG 3 - CORRIGIDA) */
@media screen and (max-width: 1024px) and (min-width: 601px) {
    .ProdutosListagem {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .ProdutosListagem li {
        min-height: 400px;
        min-width: 220px;
        padding: 12px;
    }
    
    .ProdutosListagem .ProductImage {
        padding: 12px;
    }
    
    .ProdutosListagem .ProductImage img {
        max-height: 180px;
    }
    
    .ProdutosListagem .ProductDetails a {
        font-size: 13px;
        min-height: 38px;
    }
    
    .ProdutosListagem .ProductPriceRating em {
        font-size: 16px;
    }
}

/* Mobile - Layout Vertical Otimizado (UX/UI Melhorado) */
@media screen and (max-width: 600px) {
    .ProdutosListagem {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 0;
        padding: 10px;
    }
    
    .ProdutosListagem li {
        min-height: auto;
        min-width: auto;
        padding: 16px;
        border-radius: 12px;
        /* Layout vertical - imagem no topo */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px;
        background: #fff;
        border: 1px solid #e5e5e5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transition: all 0.2s ease;
        position: relative;
    }
    
    .ProdutosListagem li:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }
    
    /* Imagem no topo - MAIOR e centralizada */
    .ProdutosListagem .ProductImage {
        flex: 0 0 auto;
        width: 100%;
        max-width: 280px;
        height: 280px;
        padding: 15px;
        margin: 0 auto;
        background: #fafafa;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border: 1px solid #f0f0f0;
    }
    
    .ProdutosListagem .ProductImage img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    /* Rating dentro da imagem - esconder em mobile */
    .ProdutosListagem .ProductImage .Rating {
        display: none;
    }
    
    /* Container do conteúdo - centralizado */
    .ProdutosListagem li > div:not(.ProductImage) {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    /* Nome do produto - Centralizado */
    .ProdutosListagem .ProductDetails {
        flex: 0 1 auto;
        margin: 0;
        order: 1;
        width: 100%;
    }
    
    .ProdutosListagem .ProductDetails a {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.4;
        color: #1a1a1a;
        min-height: auto;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        text-align: center;
    }
    
    .ProdutosListagem .ProductDetails a:active {
        color: #c00;
    }
    
    /* Preços - Centralizado e destaque */
    .ProdutosListagem .ProductPriceRating {
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        order: 2;
        align-items: center;
    }
    
    .ProdutosListagem li strike {
        font-size: 13px;
        color: #999;
        margin: 0;
        order: -1;
        text-decoration: line-through;
    }
    
    .ProdutosListagem .ProductPriceRating em {
        font-size: 24px;
        font-weight: 700;
        color: #c00;
        letter-spacing: -0.5px;
        line-height: 1;
    }
    
    /* Informações extras (parcelas, frete) - Centralizadas */
    .ProdutosListagem li > div:not(.ProductImage):not(.ProductDetails):not(.ProductPriceRating):not(.ProductActionAdd) {
        font-size: 12px;
        color: #666;
        line-height: 1.4;
        margin: 0;
        order: 3;
        text-align: center;
    }
    
    /* Botão de compra - SEM background laranja, apenas a imagem */
    .ProdutosListagem .ProductActionAdd {
        margin: 8px 0 0 0;
        padding: 0;
        order: 4;
        width: 100%;
        text-align: center;
    }
    
    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline) {
        display: inline-block;
        text-align: center;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        transition: all 0.2s ease;
        min-height: auto;
    }

    .ProdutosListagem .ProductActionAdd a:not(.whatsapp-product-btn-inline):active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .ProdutosListagem .ProductActionAdd a img {
        max-width: 160px;
        height: auto;
        max-height: 50px;
        filter: none;
    }
    
    /* Melhorar legibilidade de textos pequenos */
    .ProdutosListagem li * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mobile pequeno - < 400px */
@media screen and (max-width: 400px) {
    .ProdutosListagem {
        gap: 12px;
    }
    
    .ProdutosListagem li {
        min-height: 340px;
        padding: 10px;
    }
    
    .ProdutosListagem .ProductImage img {
        max-height: 140px;
    }
    
    .ProdutosListagem .ProductDetails a {
        font-size: 12px;
    }
}

/* Sidebar - Lista vertical */
.Right .ProdutosListagem {
    grid-template-columns: 1fr;
    gap: 15px;
}

.Right .ProdutosListagem li {
    min-height: auto;
    min-width: auto;
    padding: 10px;
}

.Right .ProdutosListagem .ProductImage {
    padding: 10px;
}

.Right .ProdutosListagem .ProductImage img {
    max-height: 130px;
}

.Right .ProdutosListagem .ProductDetails a {
    font-size: 13px;
    min-height: auto;
}

.Right .ProdutosListagem .ProductPriceRating em {
    font-size: 14px;
}

/* Classes alternadas (Odd/Even) */
.ProdutosListagem li.Odd,
.ProdutosListagem li.Even {
    /* Remove qualquer estilo antigo de alternância */
}

/* Destacar classe de frete grátis */
.FreteGratis {
    color: #27ae60;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: bold;
}

.MaisInfo {
    color: #c00;
    font-weight: bold;
}
