/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: all 0.3s ease;
}

body {
    background: #f7f7f7;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TITULO ===== */
h1 {
    text-align: center;
    font-size: 2rem;
    margin: 1.5rem 0;
    color: #222;
    letter-spacing: 0.5px;
}

/* ===== FILTRO ===== */
.filtro {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.filtro select {
    padding: 0.7rem 1.2rem;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.filtro select:focus {
    border-color: #8a2be2;
    outline: none;
    box-shadow: 0 0 8px rgba(138,43,226,0.5);
}

/* ===== PRODUTOS (CARDS) ===== */
.produtos {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* máximo 3 colunas no desktop */
    gap: 1rem;
    padding: 1rem;
    flex: 1;
    justify-content: center; /* centraliza se tiver menos de 3 */
}

.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    cursor: pointer;
    height: 380px;
    position: relative;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    transition: transform 0.4s ease;
}

.card:hover img {
    transform: scale(1.07);
}

.card h3 {
    font-size: 1rem;
    margin: 0.6rem 0 0.4rem;
    font-weight: 600;
    color: #222;
}

.card p {
    margin-bottom: 0.6rem;
    font-weight: bold;
    color: #8a2be2;
}

/* ===== DESCRICAO ===== */
.card .descricao-produto {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
    margin: 0.3rem 0;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== BOTÃO SELECIONAR ===== */
.card .btn-selecionar {
    background: linear-gradient(135deg, #000000, #ff5600);
    border: none;
    color: #fff;
    padding: 0.7rem;
    font-size: 0.95rem;
    border-radius: 0 0 20px 20px;
    cursor: pointer;
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: all 0.3s ease;
}

.card .btn-selecionar:hover {
    background: linear-gradient(135deg, #6a1bb9, #4c128a);
    transform: scale(1.03);
}

/* ===== ESTRELAS DE FEEDBACK ===== */
.estrelas {
    margin: 0.3rem 0;
    font-size: 0.85rem;
    color: #ffb400;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.estrelas span {
    font-size: 0.8rem;
    color: #555;
}

/* ===== FOOTER CARRINHO ===== */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    position: sticky;
    bottom: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 0.5rem;
}

footer span, footer strong {
    font-size: 1rem;
}

footer a.btn-carrinho {
    background: #ff0000;
    color: #fff;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(138,43,226,0.3);
}

footer a.btn-carrinho:hover {
    background: #6a1bb9;
    transform: scale(1.02);
}

/* ===== POPUP ===== */
.popup-adicionado {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #4caf50;
    color: #fff;
    padding: 12px 25px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    z-index: 2000;
    max-width: 90vw;
    text-align: center;
}

.popup-adicionado.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 1024px) {
    .produtos {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.9rem;
    }
    .card img {
        height: 170px;
    }
}

@media (max-width: 768px) {
    .produtos {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.8rem;
        padding: 0.8rem;
    }
    .card img {
        height: 160px;
    }
    footer {
      
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .produtos {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .card img {
        height: 150px;
    }
    .card h3 {
        font-size: 0.9rem;
    }
    .filtro select {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
}

/* Responsividade: menor tela */
@media (max-width: 600px) {
    .contador-like, .visualizacoes {
        font-size: 12px;
    }
    .btn-like {
        font-size: 16px;
    }
}
