/* ==========================================
   1. BARRA DE CATEGORIAS
   ========================================== */
.categorias {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    max-width: 100%;
    box-sizing: border-box;
    background-color: var(--cor-de-fundo);
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.categorias::-webkit-scrollbar {
    display: none;
}

.categorias a {
    color: rgba(247, 245, 236, 0.72);
    text-decoration: none;
    background-color: var(--cor-de-fundo-baloes);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 7px 14px;
    border-radius: 6px;
    font-family: Poppins, sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    white-space: nowrap;
    transition: 0.2s;
}

.categorias a:hover,
.categorias a.ativo {
    background-color: rgba(168, 130, 66, 0.14);
    color: var(--branco-destaque);
    border-color: var(--dourado-texto);
    font-weight: 500;
}

/* ==========================================
   2. SEÇÕES E CARDS DO CARDÁPIO
   ========================================== */
main {
    width: 100%;
    max-width: 1100px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 18px 16px;
    background-color: var(--cor-de-fundo);
    color: var(--branco-destaque);
    font-family: Poppins, sans-serif;
    min-height: 70vh;
}

main section,
main section:nth-of-type(n) {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 14px;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 28px;
    padding: 0;
    background: transparent;
}

main section.ativa {
    display: grid;
}

main section:nth-of-type(n) h2 {
    grid-column: 1 / -1;
    color: var(--branco-destaque);
    font-family: Poppins, sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    border-left: 3px solid var(--dourado-texto);
    padding-left: 10px;
    margin: 0 0 4px 0;
}

main section:nth-of-type(n) article,
main section:nth-of-type(n) article:first-of-type {
    position: static;
    height: auto;
    overflow: visible;
    grid-column: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    background-color: var(--cor-de-fundo-baloes);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

main section:nth-of-type(n) article img {
    width: 100%;
    height: 130px;
    margin: 0;
    object-fit: cover;
    border-radius: 6px;
}

main section:nth-of-type(n) article img[hidden] {
    display: none;
}

.card--indisponivel {
    opacity: 0.62;
    border-color: rgba(255, 107, 107, 0.25);
}

.badge__indisponivel {
    align-self: flex-start;
    background-color: rgba(255, 107, 107, 0.16);
    color: #ff9c9c;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 999px;
    padding: 2px 10px;
    font-family: Montserrat, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
}

.card__rodape button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #3a3a42;
    color: #c2bfb6;
    box-shadow: none;
}

main section:nth-of-type(n) article h3 {
    color: var(--branco-destaque);
    font-family: Poppins, sans-serif;
    font-size: 0.94rem;
    font-weight: 500;
    margin: 0;
}

main section:nth-of-type(n) article p {
    color: var(--branco-destaque);
    opacity: 0.65;
    font-family: Montserrat, sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

main section:nth-of-type(n) article .card__rodape {
    position: static;
    background: transparent;
    padding: 6px 0 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

main section:nth-of-type(n) article .card__rodape span {
    font-family: Poppins, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dourado-texto);
    margin: 0;
}

button {
    background-color: transparent;
    color: var(--branco-destaque);
    border: 1px solid rgba(168, 130, 66, 0.45);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-family: Poppins, sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    transition: 0.2s;
}

button:hover {
    background-color: rgba(168, 130, 66, 0.16);
    border-color: var(--dourado-texto);
}

#confirmar_adicionais,
.monte__resumo button {
    background: var(--dourado-buttom);
    color: var(--cor-de-fundo);
    border-color: var(--dourado-texto);
    font-weight: 600;
}

/* ==========================================
   3. MONTE SEU COMBO
   ========================================== */
#monte_seu_combo.ativa {
    display: block;
}

#lista_pecas_unitarias h3 {
    margin: 18px 0 8px;
    color: var(--dourado-texto);
    font-family: Poppins, sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
}

main section:nth-of-type(n) article.peca__item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 10px 12px;
}

.peca__item > div:first-child {
    min-width: 0;
}

.peca__item h4 {
    margin: 0 0 2px;
    font-family: Poppins, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--branco-destaque);
}

.peca__item span {
    font-family: Montserrat, sans-serif;
    font-size: 0.8rem;
    color: var(--dourado-texto);
    font-weight: 500;
}

.contador {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.contador button {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1rem;
}

.contador span {
    color: var(--branco-destaque);
    font-family: Poppins, sans-serif;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
    font-size: 0.88rem;
}

.monte__resumo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
    background-color: var(--cor-de-fundo-baloes);
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 18px;
    border: 1px solid rgba(168, 130, 66, 0.35);
}

.monte__resumo span {
    font-family: Poppins, sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--branco-destaque);
}

/* ==========================================
   4. MODAL DE ADICIONAIS (<dialog>)
   ========================================== */
dialog {
    margin: auto;
    background-color: var(--cor-de-fundo-baloes);
    color: var(--branco-destaque);
    border: 1px solid rgba(168, 130, 66, 0.35);
    border-radius: 10px;
    padding: 18px;
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    font-family: Poppins, sans-serif;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.78);
}

dialog h3 {
    margin-top: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--branco-destaque);
}

dialog h4 {
    margin: 14px 0 6px;
    color: var(--dourado-texto);
    font-size: 0.85rem;
    font-weight: 500;
}

.adicional__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: Montserrat, sans-serif;
    font-size: 0.85rem;
}

.adicional__nome {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.adicional__nome strong {
    color: var(--dourado-texto);
    font-size: 0.76rem;
    font-weight: 500;
}

dialog .contador button {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
}

#observacao_pedido {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--cor-de-fundo);
    color: var(--branco-destaque);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: Montserrat, sans-serif;
    font-size: 0.82rem;
    resize: vertical;
}

#observacao_pedido:focus {
    outline: none;
    border-color: var(--dourado-texto);
}

.modal__botoes {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

#fechar_modal {
    background: transparent;
    color: rgba(247, 245, 236, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==========================================
   5. CABEÇALHO, CARREGAMENTO E BARRA DO CARRINHO
   ========================================== */
#mensagemCardapio,
#mensagemMonteCombo {
    margin: 10px 0;
}

.loading__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    color: rgba(247, 245, 236, 0.7);
    font-family: Poppins, sans-serif;
    font-size: 0.85rem;
}

.loading__container[hidden] {
    display: none;
}

.loading__spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--dourado-texto);
    border-radius: 50%;
    animation: girarSpinner 0.8s linear infinite;
}

@keyframes girarSpinner {
    to {
        transform: rotate(360deg);
    }
}

.barra__carrinho {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    max-width: 1068px;
    box-sizing: border-box;
    margin: 0 16px 16px;
    padding: 12px 16px;
    background-color: var(--cor-de-fundo-baloes);
    color: var(--branco-destaque);
    border: 1px solid rgba(168, 130, 66, 0.45);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    text-decoration: none;
    font-family: Poppins, sans-serif;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.barra__carrinho strong {
    color: var(--dourado-texto);
    font-weight: 600;
}

.barra__carrinho[hidden] {
    display: none;
}

/* ==========================================
   6. RODAPÉ E RESPONSIVIDADE MOBILE
   ========================================== */
.footer__login {
    font-size: 14px;
    background-color: var(--cor-de-fundo-baloes);
    max-width: 1100px;
    margin: auto;
    padding: 0;
    font-family: Poppins, sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer__login img {
    height: 50px;
    width: auto;
    display: block;
}

.footer__login p {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    color: #535353;
}

@media (max-width: 600px) {
    header {
        padding: 10px 10px;
        gap: 6px;
        flex-wrap: nowrap;
    }

    header img {
        height: 28px;
    }

    .categorias {
        padding: 8px 12px;
    }

    main {
        padding: 14px 12px;
    }

    .monte__resumo {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .monte__resumo button {
        width: 100%;
    }

    .barra__carrinho {
        margin: 0 12px 12px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 390px) {
    header {
        padding: 8px 8px;
        gap: 5px;
    }

    header img {
        height: 26px;
    }
}
