* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    background: #0a0c0f;
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #2a2c33;
    border-top: 4px solid #f5b042;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1a1c23;
    max-width: 500px;
    width: 100%;
    padding: 32px;
    border-radius: 32px;
    border: 1px solid #f5b04240;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #f5b042;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #2a2c33;
    border: 1px solid #3a3c43;
    border-radius: 16px;
    color: white;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 60px;
    resize: vertical;
}

.error-message {
    color: #ff6666;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.btn-primary {
    background: #f5b042;
    color: #0a0c0f;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 60px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #ffc45e;
    transform: scale(0.98);
}

.btn-secondary {
    background: #2a2c33;
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 60px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #3a3c43;
}

.btn-danger {
    background: #ff4444;
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 60px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger:hover {
    background: #ff6666;
}

.btn-garcom {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: bold;
}

.toast-notification {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    background: #00c853;
    color: white;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: bold;
    text-align: center;
    z-index: 1002;
    animation: toastDrop 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast-notification.erro {
    background: #ff4444;
}

@keyframes toastDrop {
    from { transform: translate(-50%, -12px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.cliente-header {
    background: #111;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.info-cliente {
    background: #1f1f2e;
    padding: 8px 16px;
    border-radius: 60px;
    font-size: 0.9rem;
}

.btn-mudar {
    background: #2a2c33;
    border: none;
    padding: 8px 16px;
    border-radius: 60px;
    cursor: pointer;
    color: #f5b042;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.btn-cat {
    background: #1f1f2e;
    border: none;
    padding: 8px 20px;
    border-radius: 60px;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.btn-cat.ativo {
    background: #f5b042;
    color: #0a0c0f;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.card {
    background: #14161b;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #2a2c33;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    border-color: #f5b042;
    transform: translateY(-4px);
}

.img-card {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
}

.img-card:hover {
    opacity: 0.8;
}

.badge-estoque {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff4444;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-indisponivel {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #888;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
}

.conteudo-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.preco {
    font-size: 1.5rem;
    color: #f5b042;
    font-weight: bold;
    margin: 10px 0;
}

.qtd-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    background: #1f1f2e;
    padding: 8px;
    border-radius: 60px;
    justify-content: space-between;
}

.qtd-control button {
    background: #f5b042;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
}

.qtd-control button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-adicionar {
    background: #f5b042;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    margin-top: auto;
}

.btn-adicionar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
}

.comanda-flutuante {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: #f5b042;
    color: #0a0c0f;
    padding: 16px 24px;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.modal-comanda {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-comanda.active {
    display: flex;
}

/* Estrutura antiga, mantida no HTML apenas por compatibilidade. O pedido atual
   é finalizado pela Minha Comanda, portanto este checkout não deve aparecer. */
.modal-checkout {
    display: none !important;
}

.comanda-content {
    background: #1a1c23;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 32px;
}

.item-carrinho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2a2c33;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-remover-item {
    background: #ff4444;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    color: white;
    font-size: 0.8rem;
}

.btn-cancelar-pedido {
    background: #ff4444;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
}

.modal-ingredientes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.98);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-ingredientes.active {
    display: flex;
}

.ingredientes-content {
    background: #1a1c23;
    max-width: 500px;
    width: 100%;
    padding: 24px;
    border-radius: 32px;
    text-align: center;
}

.ingredientes-content img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 20px;
}

.ingredientes-lista {
    background: #0a0c0f;
    padding: 16px;
    border-radius: 20px;
    margin-top: 15px;
    text-align: left;
}

footer {
    background: #111;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #2a2c33;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
    color: #888;
    font-size: 0.85rem;
}

footer a {
    color: #f5b042;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.delivery-options {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.delivery-options button {
    flex: 1;
    padding: 15px;
    border-radius: 16px;
    border: 2px solid #2a2c33;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    font-weight: bold;
}

.delivery-options button.selected {
    border-color: #f5b042;
    background: #f5b04220;
}

.delivery-options button:hover {
    border-color: #f5b042;
}

.pagamento-opcoes-finalizacao {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.pagamento-opcoes-finalizacao button {
    padding: 14px 8px;
    border: 2px solid #343741;
    border-radius: 14px;
    background: #1f2128;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.pagamento-opcoes-finalizacao button.selecionado {
    border-color: #f5b042;
    background: #f5b042;
    color: #0a0c0f;
}

@media (max-width: 480px) {
    .pagamento-opcoes-finalizacao { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .cardapio-item { flex-direction: column; text-align: center; }
    .categoria-item { flex-direction: column; text-align: center; }
    th, td { font-size: 0.8rem; padding: 8px; }
}


/* Grade do cardápio: 3 produtos por fileira também em celulares/tablets */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .card { border-radius: 14px; min-width: 0; }
    .img-card { height: 105px; }
    .conteudo-card { padding: 9px; }
    .conteudo-card h3 { font-size: .82rem; line-height: 1.15; margin: 2px 0 5px; word-break: break-word; }
    .conteudo-card .desc { font-size: .68rem; line-height: 1.2; min-height: 2.4em; overflow: hidden; }
    .preco { font-size: .9rem; margin: 6px 0; }
    .qtd-control { gap: 4px; padding: 4px; margin: 6px 0; }
    .qtd-control button { width: 24px; height: 24px; font-size: .9rem; }
    .qtd-control span { font-size: .78rem; }
    .btn-adicionar { padding: 8px 3px; font-size: .68rem; border-radius: 12px; }
    .badge-estoque, .badge-indisponivel { top: 5px; left: 5px; padding: 3px 5px; font-size: .55rem; }
}

@media (max-width: 380px) {
    .grid { gap: 6px; }
    .img-card { height: 88px; }
    .conteudo-card { padding: 7px; }
    .conteudo-card h3 { font-size: .74rem; }
    .conteudo-card .desc { display: none; }
    .preco { font-size: .8rem; }
    .btn-adicionar { font-size: .6rem; padding: 7px 2px; }
}


/* Botão opcional para produtos com tamanhos/adicionais */
.btn-personalizar {
    width: 100%;
    margin-top: 6px;
    padding: 9px 8px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-weight: 700;
}
.btn-personalizar:disabled { opacity: .5; cursor: not-allowed; }


/* ===== Checkout / Minha Comanda V7 ===== */
#modalComanda {
    padding: clamp(10px, 2vw, 24px);
    background: rgba(3, 5, 8, .82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#modalComanda .comanda-content {
    width: min(100%, 640px);
    max-width: 640px;
    max-height: min(92dvh, 900px);
    padding: 0;
    border-radius: 28px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255,255,255,.09);
    background:
        radial-gradient(circle at top right, rgba(245,176,66,.12), transparent 28%),
        linear-gradient(180deg, #191c23 0%, #12151b 100%);
    box-shadow: 0 28px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(245,176,66,.04) inset;
    scrollbar-width: thin;
    scrollbar-color: #5b606d transparent;
}

#modalComanda .comanda-content > * { margin-left: 24px; margin-right: 24px; }
#modalComanda .comanda-content > .comanda-cabecalho { margin: 0; padding: 26px 24px 18px; }

.comanda-cabecalho {
    position: sticky;
    top: 0;
    z-index: 8;
    background: rgba(25,28,35,.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.comanda-cabecalho h2 { margin: 2px 0 4px; font-size: clamp(1.35rem, 4vw, 1.7rem); letter-spacing: -.02em; }
.comanda-cabecalho p { margin: 0; color: #969ba7; font-size: .88rem; }
.comanda-etapa { color: #f5b042; font-size: .7rem; font-weight: 900; letter-spacing: .14em; }

#listaComanda { margin-top: 18px; display: grid; gap: 10px; }
#modalComanda .item-carrinho {
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.035);
    border-radius: 16px;
    padding: 13px 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
#modalComanda .btn-remover-item { min-height: 34px; padding: 7px 11px; }

.comanda-total {
    margin-top: 16px;
    padding: 16px 17px;
    border: 1px solid rgba(245,176,66,.22);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(245,176,66,.12), rgba(245,176,66,.035));
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}
.comanda-total span:first-child { color: #c4c7cf; font-size: .9rem; }
.comanda-total strong { color: #f5b042; font-size: 1.45rem; white-space: nowrap; }
.comanda-total strong span { color: inherit; font-size: inherit; }

.finalizacao-card {
    margin-top: 16px !important;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    background: rgba(8,10,14,.44);
}
.finalizacao-titulo { display:flex; gap:12px; align-items:center; margin-bottom:16px; }
.finalizacao-titulo > span {
    width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
    display:grid; place-items:center; color:#0a0c0f; background:#f5b042; font-weight:900;
    box-shadow: 0 8px 22px rgba(245,176,66,.22);
}
.finalizacao-titulo h3 { margin:0; font-size:1.08rem; }
.finalizacao-titulo p { margin:3px 0 0; font-size:.8rem; color:#9298a4; }

#modalComanda .form-group { margin-bottom: 15px; }
#modalComanda .form-group label { display:block; margin-bottom:7px; color:#dfe2e8; font-size:.86rem; font-weight:700; }
#modalComanda input,
#modalComanda textarea,
#modalComanda select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #343944;
    border-radius: 13px;
    background: #101319;
    color: #fff;
    padding: 11px 13px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#modalComanda textarea { min-height: 92px; resize: vertical; }
#modalComanda input:focus,
#modalComanda textarea:focus,
#modalComanda select:focus { border-color:#f5b042; box-shadow:0 0 0 3px rgba(245,176,66,.12); }

#modalComanda .pagamento-opcoes-finalizacao {
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 9px;
    margin: 10px 0 4px;
}
#modalComanda .pagamento-opcoes-finalizacao button {
    min-height: 54px;
    border-radius: 15px;
    border: 1px solid #363b46;
    background: linear-gradient(180deg,#20242c,#181b21);
    box-shadow: 0 7px 18px rgba(0,0,0,.15);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
#modalComanda .pagamento-opcoes-finalizacao button:hover { transform: translateY(-1px); border-color:#f5b042; }
#modalComanda .pagamento-opcoes-finalizacao button.selecionado {
    border-color:#f5b042;
    background:linear-gradient(135deg,#f7b84d,#e99a1d);
    box-shadow:0 10px 24px rgba(245,176,66,.2);
}

.pagamento-online-box {
    margin-top: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.09);
}
.pix-online-box { border-color: rgba(0,200,83,.38); background: linear-gradient(180deg,rgba(0,200,83,.07),rgba(255,255,255,.018)); }
.cartao-online-box { background: linear-gradient(180deg,rgba(54,113,255,.06),rgba(255,255,255,.018)); }
.pagamento-online-cabecalho { display:flex; align-items:center; gap:12px; text-align:left; margin-bottom:12px; }
.pagamento-online-icone { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:#0e1117; border:1px solid rgba(255,255,255,.08); font-size:1.2rem; }
.pagamento-online-cabecalho h3 { margin:0; font-size:1rem; color:#fff; }
.pagamento-online-cabecalho p { margin:3px 0 0; color:#9298a4; font-size:.79rem; }
.pix-qr-box { background:#fff; padding:13px; border-radius:17px; margin:14px auto 10px; width:max-content; max-width:100%; box-shadow:0 15px 35px rgba(0,0,0,.22); }
#pixMercadoPagoCodigo { margin-top: 10px; }
#copiarPixMercadoPagoBtn { min-height: 46px; }
.card-brick-shell { background:#fff; border-radius:15px; padding:10px; overflow:hidden; }
.pagamento-seguro-aviso { margin-top:10px; padding:10px 12px; border-radius:12px; background:rgba(255,255,255,.035); color:#aeb3bd; font-size:.78rem; text-align:center; }

#pagamentoOnlineStatus {
    border: 1px solid rgba(245,176,66,.22) !important;
    background: rgba(245,176,66,.07);
    border-radius: 14px !important;
}

.acoes-finalizacao {
    position: sticky;
    bottom: 0;
    z-index: 7;
    display: grid;
    grid-template-columns: 1.45fr .8fr;
    gap: 10px;
    margin: 18px 0 0 !important;
    padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg,rgba(18,21,27,.1),#12151b 28%);
    border-top: 1px solid rgba(255,255,255,.07);
}
#modalComanda .acoes-finalizacao .btn-primary,
#modalComanda .acoes-finalizacao .btn-secondary { min-width:0 !important; min-height:50px; border-radius:15px; font-weight:850; }
#modalComanda .acoes-finalizacao .btn-primary { box-shadow:0 12px 28px rgba(245,176,66,.18); }

@media (max-width: 560px) {
    #modalComanda { align-items:flex-end; padding:0; }
    #modalComanda .comanda-content {
        width:100%; max-width:none; max-height:94dvh; border-radius:24px 24px 0 0; border-bottom:0;
    }
    #modalComanda .comanda-content > * { margin-left:16px; margin-right:16px; }
    #modalComanda .comanda-content > .comanda-cabecalho { margin:0; padding:20px 16px 15px; }
    .finalizacao-card { padding:14px; border-radius:18px; }
    #modalComanda .pagamento-opcoes-finalizacao { grid-template-columns: repeat(3,minmax(0,1fr)); gap:7px; }
    #modalComanda .pagamento-opcoes-finalizacao button { font-size:.78rem; padding:10px 5px; min-height:50px; }
    .acoes-finalizacao { margin-inline:0 !important; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .comanda-total strong { font-size:1.25rem; }
}

@media (max-width: 360px) {
    .acoes-finalizacao { grid-template-columns:1fr; }
    #modalComanda .pagamento-opcoes-finalizacao { grid-template-columns:1fr; }
}

/* ===== V12: cards padronizados + detalhes completos ===== */
.conteudo-card .desc{
    display:-webkit-box !important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    overflow:hidden;
    min-height:3.75em;
    max-height:3.75em;
    line-height:1.25;
    cursor:pointer;
}
.conteudo-card h3.abrir-detalhes-produto,
.img-card.abrir-detalhes-produto{cursor:pointer}
.produto-descricao-completa,
.ingredientes-lista{
    margin-top:12px;
    padding:14px 15px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:14px;
    background:rgba(255,255,255,.035);
}
.produto-descricao-completa h3,
.ingredientes-lista h3{margin:0 0 8px;font-size:.95rem}
.produto-descricao-completa p,
.ingredientes-lista p{margin:0;line-height:1.55;white-space:pre-wrap}
@media (max-width:420px){
    .conteudo-card .desc{
        display:-webkit-box !important;
        -webkit-line-clamp:2;
        min-height:2.5em;
        max-height:2.5em;
    }
}
