/* ==========================================================================
   1. GERAIS E VARIÁVEIS
   ========================================================================== */
:root { --cor-principal: #e63946; } /* Fallback */
body { margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }

/* ==========================================================================
   2. CABEÇALHO E BANNER
   ========================================================================== */
.saas-header-wrapper { margin-bottom: 40px; background: #fff; width: 100%; }
.saas-top-bar { width: 100%; height: 120px; background-color: var(--cor-principal); }

.saas-banner-frame {
    width: 94%; max-width: 1000px; margin: 0 auto; margin-top: -80px;
    border: 5px solid #fff; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden; background: #fff; position: relative; z-index: 10;
}
.saas-banner { width: 100%; aspect-ratio: 1920 / 500; background-size: cover; background-position: center; }
.saas-header-info { max-width: 1000px; margin: 0 auto; padding: 0 40px; position: relative; display: flex; align-items: flex-end; gap: 25px; margin-top: -50px; z-index: 20; }
.saas-logo-box { width: 140px; height: 140px; background: #fff; padding: 5px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); flex-shrink: 0; }
.saas-logo-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px !important; }
.saas-logo-placeholder { width: 100%; height: 100%; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 50px; }
.saas-text-content { padding-top: 60px; flex: 1; }
.saas-title { font-size: 32px; font-weight: 700; color: #333; margin: 0; line-height: 1.1; }
.saas-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.saas-badge { font-size: 12px; font-weight: bold; padding: 4px 10px; border-radius: 30px; text-transform: uppercase; }
.status-aberto { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-fechado { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.saas-horario { font-size: 13px; color: #666; font-weight: 500; }

/* ==========================================================================
   3. CONTROLES E GRID (LUPA NA DIREITA)
   ========================================================================== */
.saas-controls-bar { position: sticky; top: 10px; z-index: 99; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 10px 15px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.08); margin: 0 auto 30px auto; max-width: 1000px; display: flex; gap: 15px; align-items: center; justify-content: space-between; }
.saas-cat-nav { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; flex: 1; scrollbar-width: none; }
.saas-cat-pill { white-space: nowrap; padding: 8px 16px; background: #f0f2f5; color: #555; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; text-decoration: none; border: 1px solid transparent; }
.saas-cat-pill.active { background: var(--cor-principal); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.saas-search-box { position: relative; width: 200px; }
.saas-search-box input { 
    width: 100%; 
    padding: 10px 40px 10px 15px; /* Espaço para lupa na direita */
    border-radius: 20px; 
    border: 1px solid #ccc !important; 
    font-size: 16px; 
    outline: none; 
}
.search-icon { 
    position: absolute; 
    right: 12px; /* Direita */
    left: auto;  
    top: 50%; 
    transform: translateY(-50%); 
    color: #999; 
}

/* ==========================================================================
   4. GRID DE PRODUTOS E CARDS (CORREÇÃO DE RATIO DA IMAGEM)
   ========================================================================== */
.mesa-status-bar { background: #f8f9fa; color: #555; border: 1px solid #eee; padding: 8px; text-align: center; border-radius: 8px; margin-bottom: 10px; max-width: 98%; margin-left: auto; margin-right: auto; font-weight: 600; gap: 10; }

#saas-cardapio-container { max-width: 1000px; margin: 0 auto; padding-bottom: 80px; }

.cat-section { margin-bottom: 50px; scroll-margin-top: 130px; }
.cat-titulo { font-size: 22px; margin-bottom: 20px; color: #333; border-left: 5px solid var(--cor-principal); padding-left: 15px; font-weight: 800; }

.saas-grid-produtos { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }

/* Card Flutuante Clean */
.card-produto { 
    background: #fff; 
    border: none; /* Sem borda cinza */
    border-radius: 16px; 
    padding: 15px; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    transition: all 0.3s ease; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); /* Sombra suave */
    position: relative;
    overflow: hidden;
}
.card-produto:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.1); 
}

/* --- IMAGEM COM RATIO CORRIGIDO (4:3) --- */
.prod-img-box { 
    width: 100%; 
    /* height: 160px; <-- REMOVIDO A ALTURA FIXA */
    aspect-ratio: 4 / 3; /* <-- ADICIONADO RATIO FIXO */
    border-radius: 12px; 
    overflow: hidden; 
    background: #f9f9f9; 
    position: relative;
}
.prod-img-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* Garante que preencha o ratio 4:3 */
    transition: transform 0.5s ease; 
}
.card-produto:hover .prod-img-box img { transform: scale(1.08); }

.prod-info { flex: 1; display: flex; flex-direction: column; }
.prod-info h3 { margin: 5px 0 5px 0; font-size: 17px; color: #222; font-weight: 700; line-height: 1.3; }
.prod-info p { margin: 0 0 10px 0; font-size: 13px; color: #777; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.prod-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.preco { font-weight: 800; color: #333; font-size: 17px; }

/* Botão Redondo Vermelho */
.btn-add-mini { 
    background: var(--cor-principal); 
    color: #fff; 
    width: 35px; height: 35px; 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: bold; font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    padding-bottom: 3px !important;
}

/* ==========================================================================
   5. MODAL PREMIUM (CENTRALIZADO & TRAVADO)
   ========================================================================== */
#modal-produto-saas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: 99999;
    display: none; 
}

.modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
}

.modal-content-modern {
    /* CENTRALIZAÇÃO ABSOLUTA */
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    
    width: 95%; max-width: 900px; 
    height: auto; max-height: 90vh; 
    
    background: #fff;
    border-radius: 16px; 
    overflow: hidden; 
    z-index: 100000;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    
    display: flex; 
    flex-direction: row; 
}

/* HERO IMAGE */
.modal-col-image { width: 55%; background: #000; position: relative; min-height: 300px; }
.modal-col-image img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important; border-radius: 0 !important; }

/* INFO COLUMN */
.modal-col-info { width: 45%; display: flex; flex-direction: column; background: #fff; position: relative; }

/* BOTÃO FECHAR */
.btn-fechar-float {
    position: absolute; top: 15px; right: 15px;
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff !important; 
    border: none !important;
    color: var(--cor-principal) !important; /* X Vermelho */
    font-size: 24px !important; cursor: pointer; z-index: 200;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    display: flex; align-items: center; justify-content: center;
    padding-top: 4px !important;
}
.btn-fechar-float:hover { transform: scale(1.1); }

/* SCROLL AREA */
.modal-header-info { padding: 30px 30px 10px 30px; }
#modal-titulo { font-size: 24px; font-weight: 800; color: #222; margin: 0 0 10px 0; line-height: 1.2; }
#modal-desc { font-size: 15px; color: #666; line-height: 1.5; margin: 0; }

#wrapper-adicionais { flex: 1; overflow-y: auto; padding: 0 30px 20px 30px; }
.titulo-adicionais { margin: 20px 0 10px 0; font-size: 13px; font-weight: 700; text-transform: uppercase; color: #999; letter-spacing: 1px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.item-adicional { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f9f9f9; }
.check-adicional { width: 20px; height: 20px; accent-color: var(--cor-principal); }

/* FOOTER */
.modal-footer-modern { padding: 20px 30px; border-top: 1px solid #eee; background: #fff; margin-top: auto; }
.action-row { display: flex; gap: 15px; align-items: stretch; height: 50px; }

/* SELETOR QTD */
.qtd-pill { display: flex; align-items: center; justify-content: space-between; border: 1px solid #ddd !important; border-radius: 8px !important; width: 120px !important; background: #fff !important; padding: 0 5px; }
.btn-qtd { width: 40px !important; height: 100% !important; border: none !important; background: transparent !important; font-size: 22px !important; color: var(--cor-principal) !important; cursor: pointer !important; font-weight: bold !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; }
#qtd-numero { font-weight: 600; font-size: 18px; color: #333; }

/* BOTÃO ADD */
.btn-add-zaap { flex: 1 !important; background-color: var(--cor-principal) !important; color: #fff !important; border: none !important; border-radius: 8px !important; font-size: 16px !important; font-weight: 700 !important; display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 0 20px !important; cursor: pointer !important; box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important; text-transform: none !important; height: 100% !important; }
.btn-add-zaap:hover { opacity: 0.95 !important; }
.txt-price { font-weight: 700 !important; opacity: 0.9 !important; font-size: 14px !important; }

/* RESPONSIVIDADE MOBILE (MODAL + GRID) */
@media (max-width: 768px) {
    /* Modal */
    .modal-content-modern { 
        flex-direction: column; 
        width: 100%; height: 100%; max-height: 100%; 
        max-width: 100%; border-radius: 0;
        top: 0; left: 0; transform: none;
    }
    .modal-col-image { width: 100%; height: 250px; flex-shrink: 0; }
    .modal-col-info { width: 100%; flex: 1; overflow: hidden; }
    .modal-header-info { padding: 20px 20px 10px 20px; }
    #wrapper-adicionais { padding: 0 20px 20px 20px; }
    .modal-footer-modern { padding: 15px 20px; }

    /* Grid de Produtos (Lista) */
    .saas-grid-produtos { grid-template-columns: 1fr; gap: 15px; }
    .card-produto { flex-direction: row; align-items: center; padding: 12px; }
    
    /* Ratio no mobile também */
    .prod-img-box { 
        width: 110px; 
        height: auto; /* Deixa a altura automática */
        aspect-ratio: 1 / 1; /* Quadrado no mobile fica melhor na lista */
        flex-shrink: 0; 
    }
    
    .prod-info { padding-left: 10px; }
    .prod-info h3 { font-size: 15px; }
    .prod-info p { font-size: 12px; -webkit-line-clamp: 2; }
    
    /* Controles */
    .saas-controls-bar { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
    .saas-search-box { width: 100%; }
}

/* ==========================================================================
   6. SACOLA (FINAL)
   ========================================================================== */
#saas-side-cart { position: fixed; top: 0; right: -350px; width: 320px; height: 100%; background: #fff; z-index: 100001; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: -2px 0 15px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
#saas-side-cart.cart-open { right: 0; }
.cart-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.close-cart { font-size: 28px; cursor: pointer; color: #333; }
#cart-items-content { flex: 1; overflow-y: auto; padding: 15px; }
.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #fcfcfc; }
.cart-total { display: flex; justify-content: space-between; font-weight: bold; font-size: 18px; margin-bottom: 15px; }
#btn-finalizar-pedido { width: 100%; background: var(--cor-principal); color: #fff; border: none; padding: 15px; border-radius: 10px; cursor: pointer; font-weight: bold; font-size: 15px; }
#btn-pedir-conta { width: 100%; background: #333; color: #fff; border: none; padding: 12px; border-radius: 10px; margin-top: 10px; cursor: pointer; font-weight: 600; }
#floating-cart-btn { position: fixed; bottom: 20px; right: 20px; background: var(--cor-principal); color: #fff; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 999; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.cart-count { position: absolute; top: -2px; right: -2px; background: #000; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; text-align: center; line-height: 22px; border: 1px solid #fff; }
#cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; display: none; }