/* Configurações Base e Variáveis */
:root {
    --cor-primaria: #e74c3c; /* Cor principal da loja */
    --cor-fundo: #f4f5f7;
    --cor-texto: #2d3436;
    --cor-texto-claro: #636e72;
    --branco: #ffffff;
    --borda-raio: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    padding-bottom: 90px; /* Espaço para o carrinho flutuante não tampar os últimos itens */
}

/* Container para centralizar no PC e ocupar tudo no celular */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--cor-fundo);
    min-height: 100vh;
}

/* Header (Capa da Loja) */
.loja-header {
    background-color: var(--branco);
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #ebebeb;
}

.loja-header h1 {
    font-size: 1.5rem;
    color: var(--cor-texto);
    margin-bottom: 5px;
}

.loja-header p {
    color: var(--cor-texto-claro);
    font-size: 0.9rem;
}

/* Menu de Categorias Deslizante (Sticky) */
.nav-categorias {
    display: flex;
    overflow-x: auto;
    background: var(--branco);
    padding: 15px 20px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Esconde a barra de rolagem no menu deslizante */
.nav-categorias::-webkit-scrollbar { display: none; }

.nav-item {
    background-color: #f1f2f6;
    color: var(--cor-texto-claro);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.2s;
}

.nav-item:hover, .nav-item:active {
    background-color: var(--cor-primaria);
    color: var(--branco);
}

/* Lista de Produtos e Cards */
.categoria-sessao {
    padding: 20px;
}

.categoria-titulo {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--cor-texto);
    font-weight: 700;
}

.produto-card {
    background: var(--branco);
    border-radius: var(--borda-raio);
    display: flex;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    cursor: pointer;
}

.produto-info {
    flex: 1;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.produto-info h3 {
    font-size: 1.05rem;
    margin-bottom: 5px;
}

.descricao {
    font-size: 0.85rem;
    color: var(--cor-texto-claro);
    line-height: 1.3;
    margin-bottom: 10px;
    /* Trunca o texto em 2 linhas se for muito grande */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preco {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1rem;
}

.produto-img img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
}

/* Botão de Adicionar (Estilo Anota Aí) */
.btn-add-icone {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: var(--branco);
    border: 2px solid var(--cor-primaria);
    color: var(--cor-primaria);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.btn-add-icone:active {
    background-color: var(--cor-primaria);
    color: var(--branco);
    transform: scale(0.95);
}

/* Carrinho Flutuante */
.barra-carrinho {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 560px;
    background-color: var(--cor-primaria);
    border-radius: var(--borda-raio);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--branco);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    z-index: 1001;
    cursor: pointer;
    transition: 0.3s transform;
}

.barra-carrinho.oculta {
    transform: translate(-50%, 150%); /* Esconde a barra descendo-a */
}

.resumo-carrinho {
    display: flex;
    flex-direction: column;
}

.resumo-carrinho .qtd { font-size: 0.85rem; opacity: 0.9; }
.resumo-carrinho .total { font-size: 1.1rem; font-weight: bold; }

.btn-ver-carrinho {
    background: transparent;
    color: var(--branco);
    border: none;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}


/* =========================================
   ESTILOS DO MODAL DE PRODUTO (ANOTA AÍ STYLE)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none; /* Escondido por padrão */
    align-items: flex-end; /* Alinha o modal embaixo no celular */
    justify-content: center;
}

.modal-content {
    background: var(--branco);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    position: relative;
    padding-bottom: 80px; /* Espaço pro botão fixo */
    animation: subirModal 0.3s ease-out;
}

@keyframes subirModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.btn-fechar-modal {
    position: absolute;
    top: 15px; left: 15px;
    background: rgba(255,255,255,0.8);
    border: none;
    width: 35px; height: 35px;
    border-radius: 50%;
    font-size: 1.2rem; font-weight: bold; color: #333;
    cursor: pointer; z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.modal-img { width: 100%; height: 200px; object-fit: cover; }
.modal-header { padding: 20px; border-bottom: 1px solid #eee; }
.modal-header h2 { margin: 0 0 10px; font-size: 1.4rem; color: var(--cor-texto); }
.modal-header p { color: var(--cor-texto-claro); font-size: 0.9rem; line-height: 1.4; }
.modal-preco-base { color: #27ae60; font-weight: bold; font-size: 1.2rem; margin-top: 10px; display: block;}

/* Grupos de Complementos */
.grupo-opcoes { padding: 20px; border-bottom: 5px solid var(--cor-fundo); }
.grupo-header-modal { display: flex; justify-content: space-between; margin-bottom: 15px; }
.grupo-titulo { font-weight: bold; font-size: 1.1rem; color: var(--cor-texto); margin: 0; }
.grupo-limite { font-size: 0.8rem; background: #eee; padding: 3px 8px; border-radius: 10px; color: #666; }

.opcao-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f2f6; cursor: pointer; }
.opcao-item:last-child { border-bottom: none; }
.opcao-nome { font-size: 1rem; color: var(--cor-texto); }
.opcao-preco { color: #27ae60; font-size: 0.9rem; font-weight: 500;}

/* Observações */
.caixa-observacao { padding: 20px; }
.caixa-observacao textarea { width: 100%; border: 1px solid #dcdde1; border-radius: 8px; padding: 12px; font-size: 1rem; outline: none; box-sizing: border-box; background: #fcfcfc;}
.caixa-observacao textarea:focus { border-color: var(--cor-primaria); }

/* Rodapé Fixo do Modal */
.modal-footer {
    position: fixed; bottom: 0; width: 100%; max-width: 600px;
    background: var(--branco); padding: 15px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: space-between; align-items: center; box-sizing: border-box;
}

.btn-add-modal {
    background: var(--cor-primaria); color: var(--branco); border: none;
    padding: 15px; border-radius: 8px; font-size: 1.1rem; font-weight: bold;
    flex: 1; margin-left: 15px; cursor: pointer; display: flex; justify-content: space-between;
}
.btn-add-modal:disabled { background: #bdc3c7; cursor: not-allowed; }