/* ==================================== */
/* 1. Estilos Base                      */
/* ==================================== */

/* Variáveis CSS para cores */
:root {
    --cor-principal: #4CAF50;
    --cor-fundo: #f4f4f4;
    --cor-secundaria: #ffffff;
    --cor-texto-escuro: #333;
    --cor-texto-claro: #777;
    --sombra-leve: 0 1px 3px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 2px 4px rgba(0, 0, 0, 0.2);
    --sombra-pesada: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--cor-fundo);
    padding-bottom: 90px;
}

/* ==================================== */
/* 2. Cabeçalho                         */
/* ==================================== */

#cabecalho-principal {
    background-color: var(--cor-secundaria);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

#cabecalho-principal img:first-child {
    height: auto;
    max-height: 50px;
    width: auto;
}

#cabecalho-principal h1 {
    font-size: 1.5em;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icons img {
    height: 24px;
    width: 24px;
}

#carrinho-link {
    position: relative;
    display: inline-block;
}

.contador-carrinho {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    display: none;
}

/* ==================================== */
/* 3. Catálogo de Produtos              */
/* ==================================== */

#catalogo-produtos {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#catalogo-produtos h2 {
    color: var(--cor-texto-escuro);
}

.produto {
    background-color: var(--cor-secundaria);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: var(--sombra-leve);
}

.produto img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.produto-info {
    flex-grow: 1;
}

.produto-info h3 {
    margin: 0 0 5px;
    font-size: 1.2em;
    color: var(--cor-texto-escuro);
}

.produto-info p {
    margin: 0 0 5px;
    font-size: 0.9em;
    color: var(--cor-texto-claro);
}

.preco {
    font-weight: bold;
    color: var(--cor-principal);
}

/* ==================================== */
/* 4. Botão de Adicionar                */
/* ==================================== */

.controle-quantidade button {
    background-color: var(--cor-principal);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--sombra-media);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.controle-quantidade button:hover {
    background-color: #45a049;
    transform: scale(1.1);
}

/* ==================================== */
/* 5. Modal (Carrinho)                  */
/* ==================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-conteudo {
    background-color: var(--cor-secundaria);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: var(--sombra-pesada);
    text-align: center;
}

#lista-carrinho {
    list-style-type: none;
    padding: 0;
}

#lista-carrinho li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#lista-carrinho li:last-child {
    border-bottom: none;
}

/* Container para os botões do carrinho */
.carrinho-botoes-acao {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* NOVO: Alinhamento preciso para os textos */
#lista-carrinho li > span,
.carrinho-botoes-acao > span {
    display: inline-flex;
    align-items: center;
}

.modal-conteudo button {
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

#fechar-carrinho {
    background-color: #f44336;
}

#enviar-whatsapp {
    background-color: #25D366;
}

#fechar-carrinho:hover {
    background-color: #d32f2f;
}

#enviar-whatsapp:hover {
    background-color: #1a7a35;
}

.modal-alerta {
    max-width: 400px;
}

#alerta-mensagem {
    font-size: 1.1em;
    color: var(--cor-texto-escuro);
    margin-bottom: 20px;
}

#fechar-alerta {
    background-color: var(--cor-principal);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#fechar-alerta:hover {
    background-color: #45a049;
}

/* ==================================== */
/* 6. Estilos para Botões do Modal      */
/* ==================================== */

.remover-item,
.limpar-item {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.remover-item:hover,
.limpar-item:hover {
    background-color: #d32f2f;
}

/* ==================================== */
/* 7. Responsividade                    */
/* ==================================== */

@media (max-width: 600px) {
    #cabecalho-principal h1 {
        font-size: 1.2em;
    }
    .modal-conteudo {
        width: 90%;
        margin: 10% auto;
    }
}
/* ==================================== */
/* 8. Botão Flutuante (Rodapé)          */
/* ==================================== */

.botao-flutuante {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    z-index: 99;
    background-color: var(--cor-principal);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--sombra-pesada);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.botao-flutuante:hover {
    background-color: #45a049;
    transform: scale(1.02);
}