/* Importação de uma fonte similar para replicar o layout */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --primary-color: #8c2a38;
    --secondary-color: #f7f3f0;
    --text-color: #333;
    --dark-brown: #3f1a1a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--secondary-color);
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
}

.cardapio-container {
    max-width: 600px;
    margin: 0 auto;
    background-image: url('/img/entradas.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* HEADER - Fundo e Logo */
.header {
    width: 100%;
    height: 300px; /* Ajuste conforme a imagem */
    background: transparent; /* Fundo transparente para mostrar o background da seção */
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center; /* Centraliza verticalmente */
}

.logo {
    width: 200px; /* Tamanho aumentado da logo */
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-link:hover {
    background: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* MENU DE NAVEGAÇÃO */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 3px solid var(--primary-color);
    overflow-x: auto;
    justify-content: center;
}

.nav-tab {
    padding: 10px 15px;
    background-color: var(--secondary-color);
    border: 2px solid var(--dark-brown);
    border-radius: 5px;
    color: var(--dark-brown);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
}

.nav-tab:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-tab.active {
    background-color: var(--dark-brown);
    color: white;
    border-color: var(--dark-brown);
}

/* SEÇÃO DE CATEGORIA (ENTRADAS) */
.menu-category {
    position: relative;
    background: transparent;
    display: none; /* Esconde todas as categorias por padrão */
    padding-top: 30px; /* Espaço entre o menu de navegação e o título */
}

.menu-category.active {
    display: block; /* Mostra apenas a categoria ativa */
}

.category-header {
    background-color: var(--dark-brown);
    width: 80%;
    position: absolute;
    top: 0; /* Ajustado de -30px para 0 */
    left: 0;
    padding: 10px 20px;
    border-radius: 0 5px 5px 0;
}

.category-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

/* LISTA DE ITENS */
.menu-items-list {
    padding-top: 50px; /* Espaço para o cabeçalho da categoria */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px; /* Espaço antes do footer */
    min-height: 300px; /* Altura mínima reduzida */
}

/* Mensagens de estado */
.loading-message, .empty-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 20px 0;
}

.loading-message {
    color: var(--primary-color);
    font-weight: 600;
}

.empty-message {
    color: #888;
}

/* FOOTER DA CATEGORIA */
.category-footer {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--primary-color);
    margin-top: 20px;
}

.category-footer p {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
}

.category-footer strong {
    color: var(--primary-color);
    font-weight: 700;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    margin: 5px 0;
    border-bottom: 1px solid #eee;
    background-color: rgba(255, 255, 255, 0.9); /* Fundo semi-transparente para legibilidade */
    border-radius: 5px;
    gap: 15px;
}

.menu-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.item-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.item-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1;
    gap: 10px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-size: 1rem;
    font-weight: 700;
}

.item-description {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* MODAL DE IMAGEM */
.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.9);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex; /* Usa flexbox para centralizar quando ativo */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes zoomIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
}

#modalCaption {
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 0 0 8px 8px;
    margin-top: -5px;
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .cardapio-container {
        width: 100%;
        box-shadow: none;
    }
    
    .category-nav {
        padding: 15px 10px;
        gap: 6px;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 80vh;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    #modalCaption {
        width: 95%;
        font-size: 0.9rem;
        padding: 12px 0;
    }
    
    .menu-items-list {
        min-height: 200px; /* Altura mínima ainda menor em mobile */
        padding-bottom: 15px;
    }
    
    .category-footer {
        padding: 15px;
        margin-top: 15px;
    }
    
    .category-footer p {
        font-size: 0.8rem;
    }
}