/* RESET / GERAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f5f7fa;
    color: #333;
}

/* NAVBAR */
.topbar {
    width: 100%;
    background: #3A6EA5;
    color: white;
    padding: 12px 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h2 {
    font-size: 22px;
    font-weight: 600;
}

.menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    transition: opacity .2s;
}

.menu a:hover {
    opacity: .8;
}

.menu-link {
    background: #1e90ff;
    padding: 7px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.menu-link:hover {
    background: #0b68c2;
    opacity: 1;
}

.btn-admin {
    background: #222;
    padding: 7px 12px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.btn-admin:hover {
    background: #444;
}

/* Ícone carrinho */
.carrinho-icone {
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    background: #2D81FF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.carrinho-icone:hover {
    background: #1F63CC;
}

#carrinho-count {
    background: white;
    color: #2D81FF;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
}

/* GRID DE PRODUTOS */
.produtos-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

/* CARD DO PRODUTO */
.produto {
    background: #fff;
    border-radius: 14px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 430px;   /* garante altura parecida entre cards */
}

.produto img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.produto .info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.produto h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}

/* descrição alinhada */
.descricao {
    font-size: 14px;
    color: #555;
    margin: 6px 0 10px;
    line-height: 1.4em;
    min-height: 42px;          /* altura mínima igual */
}

/* preço / estoque */
.preco,
.estoque {
    text-align: center;
    margin: 3px 0;
    color: #555;
}

.preco {
    font-weight: bold;
}

/* QUANTIDADE */
.qtd-controle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.qtd-controle button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: #ddd;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
}

.qtd-controle button:hover {
    background: #ccc;
}

.qtd {
    font-size: 18px;
    font-weight: bold;
    width: 30px;
    text-align: center;
}

/* BOTÃO */
.btn-add {
    margin-top: 14px;
    width: 100%;
    padding: 11px;
    background: #2D81FF;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: background .2s, transform .2s;
}

.btn-add:hover {
    background: #1F63CC;
    transform: scale(1.03);
}

/* RESPONSIVO */
@media (max-width: 900px) {
    .produtos-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .produtos-container {
        grid-template-columns: 1fr;   /* um por linha no celular */
    }

    .descricao {
        min-height: 0;                /* deixa crescer livre no celular */
    }
}
