/* ==========================================
   1. CONFIGURAÇÕES GERAIS E VARIÁVEIS
   ========================================== */

:root {
    --cor-predominante: #1B3B22;
    --cor-branca: #FFFFFF;
    --cor-texto-escura: #1B3B22;
    --cor-sombra-escura: rgba(0, 0, 0, 0.30);
    --degrau-ouro-1: #c5a059;
    --degrau-ouro-2: #947436;
    --borda-ouro: #735926;
    --cor-texto-barra: #1a1a1a;
    --barra-bg: linear-gradient(145deg, var(--degrau-ouro-1), var(--degrau-ouro-2));
    --barra-border: 1px solid var(--borda-ouro);
    --barra-shadow: inset 0px 1px 2px rgba(255,255,255,0.2), 0px 4px 6px rgba(0,0,0,0.30);
    --barra-font-style: italic;
}

/* ==========================================
   2. MODELOS
   ========================================== */

.app-container.modelo01 {
    --cor-predominante: #1B3B22;
    --cor-texto-escura: #1B3B22;
}

.app-container.modelo02 {
    --cor-predominante: #809758;
    --cor-texto-escura: #809758;
}

.app-container.modelo03 {
    --cor-predominante: #669887;
    --cor-texto-escura: #669887;
}

.app-container.modelo04 {
    --cor-predominante: #1B3B22;
    --cor-texto-escura: #1B3B22;
    --cor-texto-barra: #1B3B22;
    --barra-bg: #FFFFFF;
    --barra-border: 1px solid rgba(0,0,0,0.10);
    --barra-shadow: 0px 4px 6px rgba(0,0,0,0.30);
    --barra-font-style: normal;
}

.app-container.modelo05 {
    --cor-predominante: #809758;
    --cor-texto-escura: #809758;
}

.app-container.modelo06 {
    --cor-predominante: #669887;
    --cor-texto-escura: #669887;
}

/* ==========================================
   RESET
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================
   BODY
   ========================================== */

body {
    background-color: #f0f2f5;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
}

/* ==========================================
   APP CONTAINER
   ========================================== */

.app-container {
    background-color: var(--cor-predominante);
    width: 100%;
    max-width: 380px;
    height: 870px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.40);
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    transition: background-color 0.3s ease;
}

/* ==========================================
   CABEÇALHO – TAMANHO FIXO
   ========================================== */

.app-header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 18px 0 20px 0;
    flex-shrink: 0;
}

.header-centro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    margin: 0 auto;
}

.logo-container {
    width: 98px;
    height: 98px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.linha-nome {
    display: block;
    width: 100%;
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 500;
    color: #FFF;
    line-height: 1.0;
    text-align: center;
}

.linha-sobrenome {
    display: block;
    width: 100%;
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 500;
    color: #FFF;
    line-height: 1.0;
    text-align: center;
}

.header-text h2 {
    margin-top: 6px;
    width: 100%;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
}

/* ==========================================
   BARRA DOURADA – REMOVIDA
   ========================================== */

/* ==========================================
   CAIXA CENTRAL – ALTURA FIXA (um pouco menor)
   ========================================== */

.main-banner {
    background-color: #FFFFFF;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-shrink: 0;       /* não encolhe */
    border-radius: 22px;
    padding: 31px 24px;
    overflow-y: visible;
    margin-bottom: 12px;
    box-shadow: inset 0px 2px 8px rgba(0,0,0,0.10);
    color: #333333;
    line-height: 1.6;
    font-size: 14px;
}

.main-banner h3 {
    font-family: 'Playfair Display', serif;
    color: var(--cor-texto-escura);
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.main-banner p {
    color: #444444;
    line-height: 1.7;
    font-size: 14px;
}

/* ==========================================
   GRADE DE BOTÕES – ALTURA FIXA
   ========================================== */

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    height: 220px;        /* altura fixa – não cresce */
    flex-shrink: 0;       /* não encolhe */
    align-content: stretch;
    margin-bottom: 4px;
}

/* ==========================================
   BOTÕES – ESTILO
   ========================================== */

.btn-3d {
    background-color: #FFFFFF;
    color: var(--cor-texto-escura);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.25;
    border: 1px solid #e2e2e2;
    border-bottom: 4px solid #cccccc;
    box-shadow: 0px 5px 6px rgba(0,0,0,0.25);
    transition: all 0.08s ease;
    cursor: pointer;
    width: 100%;
    height: 100%;
    word-break: break-word;
    text-align: center;
}

.btn-3d:active {
    transform: translateY(3px);
    border-bottom: 1px solid #cccccc;
}

/* ==========================================
   BOTÃO ESPECÍFICO: "Compras e Documentos"
   ========================================== */

.btn-3d.btn-pequeno {
    font-size: 10px;
    padding: 6px 2px;
    line-height: 1.3;
}

/* ==========================================
   ESPAÇO EXTRA EMBAIXO (respiro)
   ========================================== */

.spacer {
    flex: 1;              /* ocupa todo o espaço remanescente */
    min-height: 10px;
}

/* ==========================================
   WHATSAPP – REMOVIDO
   ========================================== */

/* ==========================================
   ROLAGEM DA CAIXA CENTRAL
   ========================================== */

.main-banner::-webkit-scrollbar {
    width: 6px;
}

.main-banner::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.20);
    border-radius: 10px;
}

/* ==========================================
   RESPONSIVO
   ========================================== */

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    .app-container {
        width: 100vw;
        min-height: 100vh;       /* fallback para navegadores mais antigos */
        min-height: 100dvh;      /* altura real da tela visível em celulares */
        height: auto;
        max-width: 100%;
        border-radius: 0;
        padding: 15px 15px calc(90px + env(safe-area-inset-bottom, 0px)) 15px;
        justify-content: flex-start;
    }
    .header-text h1 {
        font-size: 34px;
    }
    .logo-container {
        width: 95px;
        height: 95px;
    }
    .main-banner {
        height: auto;          /* cresce com o conteúdo, sem rolagem interna */
        max-height: none;
        overflow-y: visible;
        padding: 26px 19px;
        font-size: 13px;
    }
    .main-banner img {
        max-width: 190px;      /* imagem menor, deixa espaço pro texto aparecer inteiro */
    }
    .main-banner h3 {
        font-size: 18px;
    }
    .buttons-grid {
        height: auto;          /* não força altura fixa, evita sobra de espaço vazio */
        gap: 8px;
    }
    .btn-3d {
        font-size: 13px;
        padding: 12px 3px;
        min-height: 56px;
    }
    .btn-3d.btn-pequeno {
        font-size: 11px;
        padding: 6px 2px;
    }
}

@media (max-width: 380px) {
    .btn-3d {
        font-size: 11px;
        padding: 10px 2px;
    }
    .btn-3d.btn-pequeno {
        font-size: 10px;
    }
    .buttons-grid {
        gap: 6px;
    }
    .main-banner {
        padding: 12px 14px;
    }
}

/* ==========================================
   BOTÃO FLUTUANTE - BAIXAR O APP
   ========================================== */

.btn-instalar-app {
    position: fixed;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
    z-index: 9999;
    background-color: #e30613;
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-instalar-app:hover {
    transform: scale(1.04);
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.45);
}

.btn-instalar-app:active {
    transform: scale(0.97);
}

.btn-instalar-app .icone-instalar {
    font-size: 18px;
    line-height: 1;
}

.btn-instalar-app[hidden] {
    display: none;
}

@media (max-width: 380px) {
    .btn-instalar-app {
        padding: 12px 16px;
        font-size: 13px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
    }
}

/* ==========================================
   MODAL DE INSTRUÇÕES
   ========================================== */

.overlay-instalar-app {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay-instalar-app[hidden] {
    display: none;
}

.caixa-instalar-app {
    background: #FFFFFF;
    border-radius: 14px;
    max-width: 340px;
    width: 100%;
    padding: 24px 22px;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.4);
}

.caixa-instalar-app h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    color: #1B3B22;
}

.caixa-instalar-app p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333333;
    line-height: 1.5;
    text-align: left;
}

.caixa-instalar-app .fechar-instalar-app {
    margin-top: 16px;
    background-color: #e30613;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}