/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #fff;
    color: #1b3a2a;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 2px solid #1b3a2a;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1000;
}

/* Logo */
header .logo {
    font-size: 24px;
    font-weight: bold;
    color: #1b3a2a;
}

/* Nav de categorias */
#nav-categorias {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: 20px;
}

#nav-categorias button {
    background-color: #1b3a2a;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

#nav-categorias button:hover {
    background-color: #145228;
}

#nav-categorias button.active {
    background-color: #2f6b3a;
}

/* Carrinho */
#carrinho-container {
    position: relative; /* necessário para o dropdown */
    font-weight: bold;
    color: #145228;
    font-size: 14px;
    cursor: pointer;
}

/* Toggle do carrinho (texto visível) */
#carrinho-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dropdown do carrinho */
.carrinho-dropdown {
    position: absolute;
    top: 30px; /* ajusta abaixo do toggle */
    right: 0;
    width: 300px;
    max-height: 400px;
    background: #fff;
    border: 2px solid #1b3a2a;
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none; /* inicialmente escondido */
    z-index: 2000;
}

/* Classe para exibir dropdown */
.carrinho-dropdown.show {
    display: block;
}

/* Lista de itens do carrinho */
.carrinho-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Item individual do carrinho */
.carrinho-dropdown li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Botão remover item */
.carrinho-dropdown li button {
    background-color: #c0392b;
    border: none;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Botões fechar e finalizar */
.carrinho-dropdown #carrinho-fechar,
.carrinho-dropdown #carrinho-finalizar {
    margin-top: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#carrinho-finalizar {
    background-color: #1b3a2a;
    color: #fff;
    margin-left: 5px;
}

#carrinho-fechar {
    background-color: #ccc;
    color: #000;
}

/* Banner */
.banner {
    background-color: #145228;
    color: #fff;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.banner h1 {
    font-size: 28px;
    padding: 12px 20px;
    border-radius: 5px;
    background-color: none;
}

/* Flexbox produtos */
.produtos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

/* Card base */
.produto {
    flex: 1 1 calc(25% - 20px); /* 4 colunas */
    max-width: calc(25% - 20px);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 320px;
    position: relative;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.produto.animate {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease;
}

.produto:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

/* Imagem */
.produto img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Texto */
.produto h3,
.produto .preco,
.produto .detalhes {
    margin-bottom: 4px;
    color: inherit;
}

/* Container ações (dropdown + botão) */
.produto .acoes {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* Dropdown de tamanhos */
.produto select.tamanho {
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 14px;
    min-width: 80px;
    cursor: pointer;
    appearance: none;
}

/* Botão Comprar */
.produto button {
    padding: 6px 12px;
    border: none;
    background-color: #1b3a2a;
    color: #fff;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.produto button:hover {
    background-color: #145228;
}

/* NOVO */
.produto.novo {
    background-color: #2f6b3a;
    color: #fff;
    border: 1px solid #145228;
    order: -1; /* produtos novo aparecem primeiro */
}

/* QUENTE */
.produto.quente {
    border: 3px solid #FFD700;
    color: #000;
    animation: tremerGlowPause 6s infinite;
}

/* NOVO + QUENTE */
.produto.novo.quente {
    background-color: #2f6b3a;
    border: 3px solid #FFD700;
    color: #fff;
    animation: tremerGlowPause 6s infinite;
}

/* Animação tremer + glow */
@keyframes tremerGlowPause {
    0%,16.6% { transform: translateX(0); box-shadow: 0 0 15px rgba(255,215,0,0.8); }
    5%,10% { transform: translateX(-3px); box-shadow: 0 0 25px rgba(255,215,0,1); }
    7.5% { transform: translateX(3px); box-shadow: 0 0 25px rgba(255,215,0,1); }
    16.7%,100% { transform: translateX(0); box-shadow: 0 0 15px rgba(255,215,0,0.8); }
}

/* Footer */
footer {
    background-color: #1b3a2a;
    color: #fff;
    text-align: center;
    padding: 20px 25px;
}

/* Responsividade */
@media(max-width: 1200px) {
    .produto {
        flex: 1 1 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }
}
@media(max-width: 900px) {
    .produto {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}
@media(max-width: 600px) {
    .produto {
        flex: 1 1 100%;
        max-width: 100%;
        height: 300px;
    }
    .produto img {
        height: 140px;
    }
    .banner h1 {
        font-size: 22px;
    }
    .produto .acoes {
        flex-direction: column;
        gap: 6px;
    }
    .produto select.tamanho,
    .produto button {
        width: 100%;
    }
}

/* Toast */
.toast {
    background-color: #1b3a2a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}
