/* css/style.css */

:root {
    --cor-fundo: #f8f9fa;
    --cor-texto: #333333;
    --cor-texto-claro: #666666;
    --cor-primaria: #0055A4; /* Será sobrescrita pelo banco depois */
    --cor-primaria-contraste: #FFFFFF;
    --cor-primaria-acento: #0055A4;
    --cor-primaria-acento-contraste: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Open Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    padding-bottom: 30px;
}

.layout-cardapio {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Cabeçalho do Restaurante */
.cabecalho-restaurante {
    background-color: var(--cor-primaria);
    color: var(--cor-primaria-contraste);
    padding: 5px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cabecalho-topo {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.cabecalho-identidade {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.logo-loja {
    max-width: 220px;
    max-height: 90px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
    object-position: left center;
    background: transparent;
    padding: 0;
    margin-bottom: 2px;
}

.cabecalho-restaurante h1 {
    font-size: 22px;
    line-height: 1.15;
    margin-bottom: 0;
}

.cabecalho-endereco {
    font-size: 14px;
    opacity: 1;
    line-height: 1.2;
    color: var(--cor-primaria-contraste);
}

.cabecalho-mesa {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cor-primaria-contraste);
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.cabecalho-whatsapp {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    background: #25D366;
    border-radius: 12px;
    padding: 13px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    line-height: 1.2;
    font-size: 14px;
    white-space: nowrap;
    align-self: center;
    margin-right: 0;
    margin-top: 2px;
}

.cabecalho-whatsapp strong {
    font-size: 18px;
}

.cabecalho-contato {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.cabecalho-func-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.cabecalho-func-status.aberto {
    background: rgba(20, 184, 96, 0.18);
    border: 1px solid rgba(110, 231, 183, 0.6);
    color: #eafff4;
}

.cabecalho-func-status.fechado {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(252, 165, 165, 0.64);
    color: #ffecec;
}

.cabecalho-func-hoje {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
}

.menu-categorias-wrap {
    position: sticky;
    top: 0;
    z-index: 950;
}

.menu-categorias {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.1);
    padding: 8px;
    margin-bottom: 10px;
}

.btn-menu-categorias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: var(--cor-primaria-acento);
    color: var(--cor-primaria-acento-contraste);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
}

.menu-categorias-lista {
    display: none;
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.menu-categorias-lista.aberto {
    display: flex;
}

.menu-categorias-link {
    display: inline-block;
    text-decoration: none;
    background: #eef2ff;
    color: #1f2937;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #dbe2f0;
}

.menu-categorias-link:hover {
    background: #e2e8f0;
}

/* Títulos das Categorias */
.titulo-categoria {
    font-size: 20px;
    padding: 12px 16px;
    margin: 22px 0 12px 0;
    background: linear-gradient(90deg, #fdfefe 0%, #ffffff 100%);
    border: 2px solid #d5dde8;
    border-left: 8px solid var(--cor-primaria-acento);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.1);
}

/* Cards dos Produtos */
.container-produtos {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
    width: 100%;
}

.bloco-categoria,
.titulo-categoria,
.container-produtos,
.card-produto {
    max-width: 100%;
}

.bloco-categoria {
    scroll-margin-top: 72px;
}

.card-produto {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

.info-produto {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.info-produto h3 {
    font-size: var(--font-titulo-produto, 18px);
    margin-bottom: 5px;
    color: var(--cor-texto);
}

.info-produto p {
    font-size: var(--font-descricao-produto, 15px);
    color: var(--cor-texto-claro);
    line-height: 1.4;
    margin-bottom: 10px;
}

.preco {
    font-size: 18px;
    font-weight: bold;
    color: var(--cor-primaria-acento);
    margin-top: auto;
    padding-top: 8px;
    display: inline-block;
}

.midia-produto {
    width: 108px;
    min-width: 108px;
    margin-left: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.imagem-ampliar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.imagem-produto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.imagem-ampliar-hint {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.58);
    backdrop-filter: blur(3px);
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 24px;
    padding: 0 9px;
    font-weight: 700;
    letter-spacing: .01em;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.28);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.imagem-ampliar-wrap:hover .imagem-ampliar-hint {
    background: rgba(17, 24, 39, 0.78);
    transform: translateX(-50%) translateY(-1px);
}

.imagem-ampliar-icone {
    width: 13px;
    height: 13px;
    display: block;
    fill: currentColor;
}

/* Destaque (Estrelinha) */
.badge-destaque {
    background-color: #ffc107;
    color: #333;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    display: inline-block;
}
/* Botão do WhatsApp no Card de Produto */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #25D366; /* Verde oficial do WhatsApp */
    color: white;
    text-decoration: none;
    padding: 8px 10px;
    min-height: var(--altura-btn-pedir, 44px);
    border-radius: 10px;
    font-weight: bold;
    font-size: 13px;
    margin-top: 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
    transition: background-color 0.2s;
}

.btn-whatsapp:hover {
    background-color: #1ebe57;
}

.midia-produto .btn-whatsapp {
    margin-top: 2px;
}

.btn-whatsapp-indisponivel {
    background: #9ca3af !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

.btn-whatsapp-indisponivel:hover {
    background: #9ca3af !important;
}

.modal-imagem {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    padding: 16px;
}

.modal-imagem.ativo {
    display: flex;
}

.modal-imagem-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.modal-imagem-src {
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.modal-imagem-legenda {
    margin-top: 8px;
    font-size: 14px;
    color: #1f2937;
    text-align: center;
    font-weight: 600;
}

.modal-imagem-fechar {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 24px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.modal-pedido {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-pedido.ativo {
    display: flex;
}

.modal-pedido-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.modal-pedido-fechar {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

#modal-finalizar .modal-pedido-fechar {
    top: 8px;
    right: 8px;
    z-index: 3;
}

#modal-pedido .modal-pedido-fechar {
    top: 8px;
    right: 8px;
    z-index: 3;
}

.modal-pedido-nome {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.2;
}

#modal-finalizar .modal-pedido-nome {
    padding-right: 38px;
}

#modal-pedido .modal-pedido-nome {
    padding-right: 38px;
}

.modal-pedido-preco {
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 12px;
}

.modal-pedido-campo label {
    display: block;
    font-size: 13px;
    color: #374151;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-pedido-campo .label-frete-inline {
    color: #b91c1c;
    font-weight: 700;
}

.modal-pedido-campo + .modal-pedido-campo {
    margin-top: 10px;
}

.modal-pedido-campo textarea {
    width: 100%;
    min-height: 64px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    resize: vertical;
}

.modal-pedido-campo input[type="text"],
.modal-pedido-campo input[type="tel"],
.modal-pedido-campo select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    background: #fff;
}

.modal-pedido-campo select {
    cursor: pointer;
}

.modal-pedido-campo .dica-campo {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.modal-pedido-qtd {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-pedido-qtd input {
    width: 92px;
    height: 42px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
}

.modal-pedido-qtd-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #1f2937;
}

.modal-pedido-resumo {
    margin-top: 10px;
    font-size: 13px;
    color: #4b5563;
}

.finalizar-itens-lista {
    display: grid;
    gap: 10px;
}

.finalizar-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
    align-items: center;
}

.finalizar-item-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #d9e2ec;
}

.finalizar-item-img-wrap {
    width: 44px;
    height: 44px;
    position: relative;
}

.finalizar-item-obs-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0ea5e9;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 0 1px #93c5fd;
}

.finalizar-item-info {
    min-width: 0;
}

.finalizar-item-nome {
    font-size: 15px;
    line-height: 1.2;
    color: #1f2937;
    font-weight: 700;
    margin: 0;
}

.finalizar-item-obs {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.finalizar-obs-editor {
    margin-top: 6px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #f8fbff;
    padding: 6px;
}

.finalizar-obs-input {
    width: 100%;
    min-height: 50px;
    border: 1px solid #cfd8e3;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 12px;
    color: #334155;
    resize: vertical;
}

.finalizar-obs-acoes {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.finalizar-obs-btn {
    border: 0;
    border-radius: 7px;
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.finalizar-obs-btn.cancelar {
    background: #e5e7eb;
    color: #334155;
}

.finalizar-obs-btn.salvar {
    background: #0ea5e9;
    color: #ffffff;
}

.finalizar-item-subtotal {
    margin-top: 4px;
    font-size: 13px;
    color: #0ea5e9;
    font-weight: 700;
}

.finalizar-item-acoes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 4px 6px;
    background: #f8fafc;
}

.finalizar-item-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #d1d5db;
}

.finalizar-item-btn.plus {
    color: #0ea5e9;
}

.finalizar-item-btn.remover {
    color: #dc2626;
    font-size: 17px;
}

.finalizar-item-qtd {
    min-width: 18px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.finalizar-subtotal {
    margin-top: 12px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.finalizar-sugestoes-wrap {
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.finalizar-sugestoes-titulo {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.finalizar-sugestoes-carousel {
    position: relative;
}

.finalizar-sugestoes-linha {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.finalizar-sugestoes-linha::-webkit-scrollbar {
    height: 6px;
}

.finalizar-sugestoes-linha::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.finalizar-sug-card {
    position: relative;
    flex: 0 0 96px;
    min-width: 96px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px 6px 7px;
    text-align: center;
    scroll-snap-align: start;
}

.finalizar-sug-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dbe4ee;
    display: block;
    margin: 0 auto 5px;
}

.finalizar-sug-add {
    position: absolute;
    right: 6px;
    top: 50px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}

.finalizar-sug-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 15px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}

.finalizar-sug-nav.prev {
    left: -6px;
}

.finalizar-sug-nav.next {
    right: -6px;
}

.finalizar-sug-nome {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.15;
    color: #1f2937;
    font-weight: 700;
    min-height: 30px;
}

.finalizar-sug-preco {
    margin-top: 3px;
    font-size: 13px;
    color: #0284c7;
    font-weight: 700;
}

.modal-pedido-acoes {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.modal-pedido-btn {
    border: 0;
    border-radius: 10px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.modal-pedido-btn-sec {
    background: #0ea5e9;
    color: #ffffff;
}

.modal-pedido-btn-pri {
    background: #25D366;
    color: #ffffff;
}
.modal-pedido-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    filter: grayscale(0.12);
}

.pedido-flutuante {
    position: fixed;
    right: 12px;
    bottom: 14px;
    z-index: 11000;
    border: 0;
    border-radius: 999px;
    background: #25D366;
    color: #ffffff;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.pedido-flutuante[hidden] {
    display: none !important;
}

.pedido-flutuante-qtd {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
}

body.modal-aberta {
    overflow: hidden;
}

body.modal-aberta .pedido-flutuante {
    display: none !important;
}

@media (max-width: 640px) {
    .limite-cardapio {
        padding: 0 10px;
    }

    .cabecalho-topo {
        gap: 6px;
    }

    .cabecalho-identidade {
        flex: 1;
    }

    .logo-loja {
        max-width: 160px;
        max-height: 70px;
        width: auto;
        height: auto;
    }

    .cabecalho-restaurante h1 {
        font-size: 18px;
    }

    .cabecalho-whatsapp {
        padding: 11px 14px;
        font-size: 13px;
    }

    .cabecalho-whatsapp strong {
        font-size: 16px;
    }

    .cabecalho-func-status {
        font-size: 11px;
        padding: 3px 8px;
    }

    .cabecalho-func-hoje {
        font-size: 10px;
    }

    .cabecalho-mesa {
        padding: 2px 8px;
        font-size: 11px;
    }

    .card-produto {
        padding: 13px;
    }

    .midia-produto {
        width: 102px;
        min-width: 102px;
        gap: 10px;
    }

    .pedido-flutuante {
        right: 10px;
        left: 10px;
        bottom: 10px;
        justify-content: center;
    }

    .menu-categorias {
        padding: 7px;
    }

    .btn-menu-categorias {
        width: 100%;
    }

    .modal-pedido {
        align-items: flex-start;
        padding: 8px;
        overflow-y: auto;
    }

    .modal-pedido-box {
        margin-top: 6px;
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        padding: 14px;
    }

    .modal-pedido-fechar {
        top: 8px;
        right: 8px;
        z-index: 2;
    }

    .modal-pedido-nome {
        padding-right: 34px;
    }

    .finalizar-item {
        grid-template-columns: 38px 1fr;
        gap: 8px;
    }

    .finalizar-item-img-wrap {
        width: 38px;
        height: 38px;
    }

    .finalizar-item-obs-btn {
        top: -6px;
        right: -6px;
    }

    .finalizar-item-acoes {
        grid-column: 1 / -1;
        justify-self: end;
        margin-top: 4px;
    }

    .finalizar-sug-card {
        flex-basis: 92px;
        min-width: 92px;
    }

    .finalizar-sug-img {
        width: 52px;
        height: 52px;
    }

    .finalizar-sug-add {
        top: 46px;
        right: 5px;
    }

    .finalizar-sug-nav {
        width: 20px;
        height: 20px;
        font-size: 13px;
        line-height: 20px;
    }

    .finalizar-sug-nav.prev {
        left: -4px;
    }

    .finalizar-sug-nav.next {
        right: -4px;
    }
}
