/* =============================================================
   WS DELIVERY — Cardápio público (cliente)
   A cor do restaurante (--cor) é injetada inline no PHP.
   ============================================================= */

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

:root {
    --escuro: #0F0F0F;
    --cinza:  #1A1A1A;
    --borda:  #2A2A2A;
    --texto:  #F5F5F5;
    --muted:  #888;
}
body { font-family: 'DM Sans', sans-serif; background: var(--escuro); color: var(--texto); padding-bottom: 120px; }

/* HEADER */
.header {
    position: relative;
    background: var(--cinza);
    border-bottom: 1px solid var(--borda);
}
.banner {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    opacity: .7;
}
.banner-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--cor)22, var(--cinza));
}
.header-info {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo-empresa {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--borda);
    flex-shrink: 0;
}
.logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--borda);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.empresa-nome { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; }
.empresa-info { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-aberto  { background: rgba(16,185,129,.15); color: #34D399; }
.badge-fechado { background: rgba(239,68,68,.15);  color: #F87171; }

/* NAV CATEGORIAS */
.nav-cats {
    position: sticky;
    top: 0;
    background: var(--cinza);
    border-bottom: 1px solid var(--borda);
    z-index: 10;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0 16px;
    scrollbar-width: none;
}
.nav-cats::-webkit-scrollbar { display: none; }
.nav-cat-btn {
    display: inline-block;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    text-decoration: none;
}
.nav-cat-btn:hover, .nav-cat-btn.ativo {
    color: var(--cor);
    border-bottom-color: var(--cor);
}

/* CONTEÚDO */
.container { max-width: 680px; margin: 0 auto; padding: 24px 16px; }

.secao-banner { width:100%; height:100px; object-fit:cover; border-radius:12px; margin-bottom:10px; display:block; }

.secao-titulo {
    font-family: 'Syne', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--borda);
}

.secao { margin-bottom: 32px; }

/* PRODUTO CARD */
.produto-card {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--borda);
    cursor: pointer;
    transition: opacity .2s;
}
.produto-card:hover { opacity: .85; }
.produto-card:last-child { border-bottom: none; }

.produto-info { flex: 1; }
.produto-nome { font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.produto-desc { font-size: 13px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.produto-preco { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--cor); font-size: 15px; }
.produto-preco-promo { font-size: 12px; color: var(--muted); text-decoration: line-through; margin-right: 6px; }
.badge-destaque { font-size: 11px; background: var(--cor)22; color: var(--cor); padding: 2px 8px; border-radius: 10px; margin-left: 6px; }

.produto-img {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.produto-sem-img {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    background: var(--borda);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cor);
    color: #fff;
    font-size: 20px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-end;
    transition: opacity .2s, transform .1s;
}
.btn-add:hover { opacity: .85; }
.btn-add:active { transform: scale(.92); }

/* CARRINHO FIXO */
.carrinho-bar {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 480px;
    background: var(--cor);
    color: #fff;
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    transition: opacity .2s;
}
.carrinho-bar:hover { opacity: .92; }
.carrinho-bar.visivel { display: flex; }
.carrinho-qtd {
    background: rgba(255,255,255,.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 700;
}
.carrinho-label { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }
.carrinho-total { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }

/* MODAL CARRINHO */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.aberto { display: flex; }

.modal {
    background: var(--cinza);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; }
.btn-fechar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--borda);
    border: none;
    color: var(--texto);
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* MODAL PRODUTO */
#modalProduto .modal { position: relative; }
.prod-fechar { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.55); }
#prodImgWrap { margin: -16px -20px 16px; }
.prod-img { width: 100%; height: 240px; object-fit: cover; display: block; }
.prod-sem-img { width: 100%; height: 180px; background: var(--borda); display: flex; align-items: center; justify-content: center; font-size: 56px; }
.prod-nome { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.prod-desc { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.prod-desc:empty { display: none; }
.prod-preco-linha { display: flex; align-items: baseline; gap: 8px; }
.prod-preco { font-family: 'Syne', sans-serif; font-weight: 800; color: var(--cor); font-size: 22px; }
.prod-footer { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--borda); }
.prod-qtd { display: flex; align-items: center; gap: 14px; }
.btn-prod-add { flex: 1; padding: 14px; background: var(--cor); color: #fff; border: none; border-radius: 12px; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; cursor: pointer; }
.btn-prod-add:active { transform: scale(.98); }

/* ADICIONAIS NO MODAL */
.prod-adic-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.prod-adic-row:last-child { border-bottom: none; }
.prod-adic-nome { font-size: 14px; }
.prod-adic-preco { font-size: 13px; color: var(--cor); margin-left: 8px; }
.prod-adic-limite { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.prod-adic-ctrl { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* GRUPO DE ACOMPANHAMENTOS (recolhível) */
.prod-adic-grupo { margin-top: 14px; border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; }
.prod-adic-grupo-titulo { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: none; border: none; cursor: pointer; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--texto); text-align: left; }
.prod-adic-grupo-info { display: flex; flex-direction: column; gap: 2px; }
.prod-adic-grupo-limite { font-size: 11px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.prod-adic-grupo-seta { font-size: 12px; color: var(--muted); transition: transform .2s; }
.prod-adic-grupo-titulo.aberto .prod-adic-grupo-seta { transform: rotate(180deg); }
.prod-adic-grupo-itens { padding: 0 14px; }
.prod-adic-grupo-itens.oculto { display: none; }
.prod-adic-grupo-itens .prod-adic-row:last-child { border-bottom: none; }

/* subitem (adicional) na lista do carrinho */
.item-adic { font-size: 12px; color: var(--muted); margin-top: 3px; }

.item-carrinho {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--borda);
}
.item-carrinho:last-child { border-bottom: none; }
.item-nome-carr { flex: 1; font-size: 14px; }
.controles-qtd { display: flex; align-items: center; gap: 10px; }
.btn-qtd {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--borda);
    background: var(--escuro);
    color: var(--texto);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .2s;
}
.btn-qtd:hover { border-color: var(--cor); }
.qtd-num { font-family: 'Syne', sans-serif; font-weight: 700; min-width: 20px; text-align: center; }
.item-subtotal { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: var(--cor); min-width: 70px; text-align: right; }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--borda);
}

.resumo-valores { margin-bottom: 16px; }
.resumo-linha { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.resumo-linha.total { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; color: var(--texto); margin-top: 10px; }

/* FORMULÁRIO CLIENTE */
.form-titulo { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 5px; }
.campo input { width: 100%; background: var(--escuro); border: 1px solid var(--borda); border-radius: 8px; padding: 11px 14px; color: var(--texto); font-family: 'DM Sans', sans-serif; font-size: 14px; outline: none; transition: border-color .2s; }
.campo input:focus { border-color: var(--cor); }

.btn-finalizar {
    width: 100%;
    padding: 14px;
    background: var(--cor);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
    margin-top: 4px;
}
.btn-finalizar:hover { opacity: .9; }
.btn-finalizar:disabled { opacity: .5; cursor: not-allowed; }

.fechado-aviso {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.2);
    color: #F87171;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 16px;
}
