/* ==========================================
   1. DESIGN SYSTEM (Variáveis Globais)
   ========================================== */
:root {
    /* Cores */
    --bg-app: #121212;
    --bg-card: #1E1E1E;
    --bg-detalhe: #2C2C2C;
    --accent: #FF6B00;
    --accent-glow: rgba(255, 107, 0, 0.4);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --success: #2ed573;
    --danger: #ff4757;

    /* Arredondamentos (Bordas) */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Transições e Animações */
    --transition-fast: 0.2s ease;
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================
   2. RESET E BASE (Otimizado para Touch)
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    user-select: none; /* Impede a seleção de texto ao tocar no ecrã */
    -webkit-tap-highlight-color: transparent; /* Remove o flash azul nativo do Android ao clicar */
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    touch-action: pan-y; /* Permite scroll vertical, bloqueia zoom nativo indesejado */
}

/* Scrollbars customizadas e minimalistas */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-detalhe); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

button {
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

/* ==========================================
   3. TELA 1: SCREENSAVER (BOAS-VINDAS)
   ========================================== */
#welcome-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #2a1a0f 0%, var(--bg-app) 70%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 100; transition: opacity 0.5s, visibility 0.5s;
}
#welcome-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.welcome-logo-box {
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    width: 100px; height: 100px; border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px var(--accent-glow);
    margin-bottom: 30px;
}

.welcome-title {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 5px;
    text-transform: uppercase;
    text-shadow: 0px 4px 20px rgba(0,0,0,0.9); /* Sombra pesada para contrastar com a foto de fundo */
}
.welcome-subtitle {
    font-size: 22px; color: #F0F0F0;
    letter-spacing: 2px;
    margin-bottom: 80px;
    text-shadow: 0px 2px 10px rgba(0,0,0,0.9);

}
/* O botão principal agora reage ao toque */
.btn-start-interaction:active .icon-hand-circle {
    transform: scale(0.85);
    background: var(--accent-glow);
    border-color: transparent;
}

.btn-start-interaction { display: flex; flex-direction: column; align-items: center; color: var(--accent); animation: pulse 2s infinite; }
.icon-hand-circle { width: 70px; height: 70px; border: 2px solid var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.btn-start-text { font-size: 18px; font-weight: 600; }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================
   4. TELA 2: MENU PRINCIPAL
   ========================================== */
#menu-screen { height: 100%; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.8s; }
#menu-screen.visible { opacity: 1; }

.menu-header-container {
    padding: 15px 30px 10px 30px; /* Reduzimos o padding vertical */
    background: var(--bg-app);
    z-index: 10; }
.top-bar { display: flex; align-items: center; margin-bottom: 12px; }
.top-bar-icon { background: var(--accent); width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-right: 15px; }
.top-bar h2 { font-size: 24px; font-weight: 700; }

.category-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }

.category-pill {
    background: var(--bg-detalhe);
    color: var(--text-secondary);
    padding: 14px 26px; /* <-- Aumentamos a área de toque (era 10px 20px) */
    border-radius: 40px;
    font-weight: 700;
    font-size: 18px; /* <-- Letra maior para leitura rápida */
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    transition: all 0.15s ease; /* Transição rápida para feedback imediato */
}
/* Efeito de "afundar" ao tocar (Micro-interação vital para Totens) */
.category-pill:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}
.category-pill.active {
    background: var(--accent); color: var(--text-primary); box-shadow: 0 4px 15px var(--accent-glow); }

.main-content-area { flex: 1; overflow-y: auto; padding: 0 30px 100px 30px; }

/* --- CARDS DOS PRODUTOS --- */
.product-grid-dark { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; padding-top: 10px; }

.dark-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dark-card:active {
    transform: translateY(2px) scale(0.98);
    border-color: var(--accent);
    box-shadow: 0 20px 35px -10px var(--accent-glow);
}

.card-img-header { width: 100%; aspect-ratio: 1 / 1; position: relative; background-color: var(--bg-detalhe); overflow: hidden; }
.card-img-header img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.4s ease; }
.dark-card:active .card-img-header img { transform: scale(1.05); }

.promo-tag { position: absolute; top: 15px; left: 15px; background: var(--danger); color: white; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; z-index: 2; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

.card-body { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; }
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.card-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer-row { display: flex; justify-content: space-between; align-items: flex-end; }
.card-price { font-size: 24px; font-weight: 800; color: var(--text-primary); display: flex; flex-direction: column; line-height: 1; }

/* Botão Flutuante do Carrinho */
.floating-cart-btn {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--accent); color: white; border: none;
    padding: 15px 25px; border-radius: 50px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 10px 30px var(--accent-glow);
    z-index: 90; transition: transform var(--transition-fast); font-size: 16px;
}
.floating-cart-btn:active { transform: scale(0.95); }
.cart-count-bubble { background: white; color: var(--accent); font-weight: 800; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.cart-total-text { font-weight: 700; font-size: 18px; }

/* ==========================================
   5. OVERLAYS E MODAIS BASE
   ========================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; transition: opacity var(--transition-fast);
}
.modal-overlay.show { display: flex; opacity: 1; }

/* ==========================================
   6. MODAL DO PRODUTO (Detalhes)
   ========================================== */
.modal-produto-content {
    background: var(--bg-card); width: 95%; max-width: 420px; border-radius: var(--radius-lg);
    position: relative; transform: translateY(50px); transition: var(--transition-bounce);
    display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.modal-overlay.show .modal-produto-content { transform: translateY(0); }

.btn-fechar-img {
    position: absolute; top: 15px; right: 15px;
    background: rgba(0,0,0,0.4); color: white; border: none;
    width: 40px; height: 40px; border-radius: 50%; font-size: 18px; font-weight: bold;
    z-index: 10; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal-img-container { width: 100%; height: 260px; background: #000; }
.modal-img-container img { width: 100%; height: 100%; object-fit: cover; }

.modal-produto-body { padding: 25px; text-align: left; }
.modal-produto-body h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.modal-produto-body p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal-produto-preco-destaque {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 25px; }

.modal-action-row { display: flex; gap: 15px; align-items: stretch; height: 56px; }
.qtd-selector-large {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-detalhe);
    border-radius: var(--radius-md);
    padding: 0 15px; width: 130px;
    padding: 0 5px; /* Reduzimos o padding lateral da caixa... */
    width: 150px; /* ... e aumentamos a largura total (era 130px) */
}
.qtd-selector-large button {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    width: 50px;
    height: 56%;
    cursor: pointer;
}
.qtd-selector-large span { font-size: 18px; font-weight: 700; }

.btn-add-large {
    flex: 1;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    transition: transform 0.1s;
    box-shadow: 0 8px 20px var(--accent-glow);
    white-space: nowrap; /* A MÁGICA AQUI: Proíbe o texto de quebrar linha */
    padding: 0 15px; /* Garante que o texto não cola nas bordas */

}
.btn-add-large:active { transform: scale(0.96); }

/* ==========================================
   7. MODAL DE CHECKOUT (Wizard)
   ========================================== */
.modal-cart-content {
    background: var(--bg-card); width: 95%; max-width: 500px;
    border-radius: var(--radius-xl); padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: translateY(50px); transition: var(--transition-bounce);
    display: flex; flex-direction: column; max-height: 90vh;
}
.modal-overlay.show .modal-cart-content { transform: translateY(0); }

/* Topo do Wizard */
.header-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.header-title-group { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.header-title-group h2 { color: var(--text-primary); font-size: 24px; font-weight: 800; }
.btn-fechar-dark { background: var(--bg-detalhe); border: none; color: white; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; }
.btn-voltar { background: none; border: none; color: var(--text-secondary); font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-weight: 600; padding: 5px 0; }

/* Lista de Itens (Carrinho) */
.cart-items-list { flex: 1; overflow-y: auto; overflow-x: hidden; text-align: left; margin-bottom: 20px; padding-right: 5px; }
.cart-item-row { background: var(--bg-detalhe); border-radius: var(--radius-md); padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cart-item-img { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; }
.cart-item-name { font-weight: 600; font-size: 16px; color: var(--text-primary); line-height: 1.2; margin-bottom: 4px; }
.cart-item-price { font-weight: 700; color: var(--accent); font-size: 14px;}

.qtd-controls { display: flex; align-items: center; background: var(--bg-card); border-radius: var(--radius-sm); padding: 4px 8px; gap: 10px; }
.btn-qtd { background: none; border: none; color: white; font-size: 20px; width: 30px; height: 30px; }
.qtd-numero { font-weight: 700; width: 20px; text-align: center; font-size: 16px; }
.btn-remove { background: none; border: none; color: var(--danger); font-size: 16px; width: auto; padding: 0 10px; height: 36px; margin-left: 5px; opacity: 0.8; }

/* Resumo (Lista Limpa) */
.resumo-title { font-size: 28px; font-weight: 800; margin-bottom: 20px; text-align: left; }
.resumo-item-row { background: var(--bg-detalhe); border-radius: var(--radius-md); padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.resumo-item-info { text-align: left; }
.resumo-item-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.resumo-item-sub { color: var(--text-secondary); font-size: 14px; }
.resumo-item-total { font-weight: 800; color: var(--accent); font-size: 18px; }

/* Botões de Pagamento */
.pay-header { text-align: center; margin-bottom: 30px; }
.pay-header svg { color: var(--accent); margin-bottom: 10px; }
.pay-method-btn { background: var(--bg-app); border: 1px solid var(--bg-detalhe); border-radius: 20px; padding: 15px 20px; width: 100%; display: flex; align-items: center; gap: 15px; margin-bottom: 15px; transition: var(--transition-fast); }
.pay-method-btn:active { border-color: var(--accent); transform: scale(0.98); }
.pay-icon-box { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.bg-blue { background: #3772FF; }
.bg-green { background: #2ED573; }
.bg-teal { background: #1DD1A1; }
.pay-method-text { color: var(--text-primary); font-size: 18px; font-weight: 700; }

/* Rodapé / Checkout Geral */
.cart-total-wrapper { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--bg-detalhe); }
.cart-total-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.cart-total-row span:first-child { color: var(--text-secondary); font-size: 18px; }
.cart-total-row span:last-child { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }

.btn-primary { background: var(--accent); color: white; border: none; width: 100%; height: 60px; border-radius: var(--radius-md); font-size: 18px; font-weight: 700; transition: var(--transition-fast); box-shadow: 0 8px 20px var(--accent-glow); }
.btn-primary:active { transform: scale(0.96); }

/* PIX, Loader e Sucesso */
.qr-box { background: white; padding: 15px; border-radius: 20px; display: inline-block; margin: 20px 0; }
.qr-box img { display: block; width: 220px; height: 220px; }
.senha-gigante { font-size: 70px; font-weight: 800; color: var(--success); margin: 20px 0; line-height: 1; }
.loader { border: 4px solid var(--bg-detalhe); border-top: 4px solid var(--accent); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }