:root {
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --card-bg: #ffffff;
    --nav-bg: #88B04B; /* Cor Greenery */
    --primary-btn: #88B04B;
    --secondary-bg: #f0f3ed;
    --header-text: #3a5a40;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #f8f9fa;
    --card-bg: #2d2d2d;
    --nav-bg: #4b6b21;
    --primary-btn: #588157;
    --secondary-bg: #252525;
    --header-text: #e9edc9;
}

body { 
    font-family: 'Segoe UI', sans-serif; 
    margin: 0; 
    padding-top: 70px; 
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: 0.3s;
}

/* Navbar com botões separados */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    font-size: 1.4rem;
    color: white;
}

/* Botões Redondos (Bolinhas) */
.btn-round {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: 0.3s;
}

.btn-round:hover { background: rgba(255, 255, 255, 0.4); }

#contador-itens {
    position: absolute;
    top: 0;
    right: 0;
    background: #e63946;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Carrinho Lateral */
#carrinho-lateral {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background-color: var(--card-bg);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: 0.4s ease-in-out;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.carrinho-hidden { transform: translateX(100%); }

/* Botões de Compra e Finalizar */
.btn-add, #btn-finalizar {
    background-color: var(--primary-btn);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

#btn-finalizar { background-color: #25D366; } /* Verde WhatsApp */

/* Catálogo organizado em 2 colunas fixas */
.catalogo {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Força exatamente 2 colunas */
    gap: 30px;
    padding: 40px 20px;
    max-width: 800px; /* Reduzi o tamanho máximo para os cards não ficarem gigantes */
    margin: 0 auto;
}

/* Ajuste para ecrãs de telemóvel (opcional) */
@media (max-width: 600px) {
    .catalogo {
        grid-template-columns: 1fr; /* No telemóvel fica 1 por linha para não apertar */
    }
}

.produto {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}   

/* --- HEADER (HERO) CENTRALIZADO --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    text-align: center;
    padding: 100px 20px;
    background-color: var(--secondary-bg);
    width: 100%; 
    box-sizing: border-box;
    /* Adicione estas linhas abaixo para garantir o alinhamento total */
    position: relative;
    left: 0;
}

.hero h1, .hero p {
    margin: 5px 0;
    color: var(--header-text);
    width: 100%; /* Força o texto a respeitar o centro da tela */
}

/* --- CARRINHO LATERAL COM BOTÃO FIXO NO FINAL --- */
#carrinho-lateral {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column; /* Organiza os itens em coluna */
    padding: 0; /* Tiramos o padding geral para o footer encostar nas bordas */
}

.carrinho-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

#lista-carrinho {
    list-style: none;
    padding: 20px;
    margin: 0;
    flex-grow: 1; /* Faz a lista ocupar todo o espaço disponível no meio */
    overflow-y: auto; /* Permite rolar os itens se houver muitos */
}

.carrinho-footer {
    padding: 20px;
    background-color: var(--card-bg);
    border-top: 1px solid rgba(0,0,0,0.1);
}

#btn-finalizar {
    background-color: #25D366; /* Verde oficial do WhatsApp */
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

#btn-finalizar:hover {
    background-color: #128C7E;
    transform: scale(1.02);
}

/* Estilização dos botões dentro do carrinho */
.btn-carrinho-menos {
    background-color: #ff4d4d; /* Vermelho */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.btn-carrinho-mais {
    background-color: #28a745; /* Verde */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Botão X de fechar o carrinho */
.btn-fechar {
    background: none;
    border: none;
    color: #ff4d4d; /* Vermelho */
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* Ajuste para o nome não quebrar o layout */
.item-carrinho-info {
    max-width: 60%; 
    font-size: 0.9rem;
    word-wrap: break-word; /* Faz o nome quebrar linha se for muito grande */
}

#lista-carrinho li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}