
:root {
    --bg-dark: #0b111e;         
    --bg-input: #162235;        
    --primary-blue: #1b62ff;    
    --primary-hover: #004be5;   
    --text-white: #ffffff;       
    --text-muted: #64748b;     
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 380px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}


.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 60px; 
}

.logo-icon {
    width: 65px;
    height: 65px;
    background-color: var(--text-white);
    border-radius: 50%;
    border: 15px solid var(--primary-blue); 
    box-shadow: 0 4px 15px rgba(27, 98, 255, 0.3);
}

.brand-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
}


.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px; 
}

.input-group {
    width: 100%;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px 24px;
    background-color: var(--bg-input);
    border: none;
    border-radius: 30px; 
    color: var(--text-white);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-group input:focus {
    box-shadow: 0 0 0 2px var(--primary-blue);
    background-color: #1a2940; 
}


.btn-primary {
    width: 70%; 
    margin: 20px auto 0 auto; 
    padding: 14px;
    background-color: var(--primary-blue);
    color: var(--text-white);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(27, 98, 255, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}


.form-footer {
    margin-top: 40px;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-white);
}

.back-link i {
    font-size: 0.8rem;
}

.welcome-message {
    width: 100%;
    color: var(--text-white);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 30px;
    text-align: left;
    font-weight: 500;
}

#user-name {
    color: var(--primary-blue); 
    font-weight: 700;
}

.app-container {
    width: 100%;
    max-width: 410px; 
    height: 92vh;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.search-bar-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
}

.search-bar-container input {
    width: 100%;
    padding: 14px 14px 14px 50px;
    background-color: var(--bg-input);
    border: none;
    border-radius: 25px;
    color: var(--text-white);
    font-size: 1rem;
    outline: none;
}

.menu-toggle-btn {
    width: 48px;
    height: 48px;
    background-color: var(--bg-input);
    border: none;
    border-radius: 50%;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 100px 20px; 
    display: flex;
    flex-direction: column;
    gap: 35px;
}


.main-content::-webkit-scrollbar {
    width: 0px;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}

.see-more {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}


.horizontal-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 0px;
}


.product-card {
    min-width: 110px;
    width: 110px;
    background-color: #121b2a; 
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-image {
    width: 100%;
    height: 75px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-name {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.weight {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.add-btn {
    width: 100%;
    background-color: #1a2638;
    border: none;
    border-radius: 6px;
    color: var(--text-white);
    padding: 4px 0;
    margin-top: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}


.receipt-card {
    min-width: 150px;
    width: 150px;
    background-color: #121b2a;
    border-radius: 12px;
    overflow: hidden;
}

.receipt-image {
    width: 100%;
    height: 85px;
    background-size: cover;
    background-position: center;
}

.receipt-info {
    padding: 10px;
}

.receipt-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
}

.time-ago {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.bottom-nav-container {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    z-index: 10;
}

.bottom-nav {
    width: 100%;
    background-color: #131c2e;
    border-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-item {
    color: #64748b;
    font-size: 1.2rem;
    text-decoration: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.nav-item.active {
    background-color: var(--primary-blue);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(27, 98, 255, 0.4);
}

.empty-state-message {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 20px 10px;
    text-align: left;
}

.empty-state-message a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.empty-state-message a:hover {
    color: var(--text-white);
}

/* ==========================================================================
   12. TELA MAIS COMPRADOS (GRID DE CATEGORIAS)
   ========================================================================== */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 25px;
}

/* Cria a malha de duas colunas iguais */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

/* Estilo de cada Card individual do Figma */
.category-card {
    background-color: #121b2a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 120px;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-2px);
    background-color: #172336;
}

.category-info {
    display: flex;
    flex-direction: column;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
}

.category-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Alinha o ícone/imagem no canto inferior direito do card */
.category-icon-container {
    align-self: flex-end;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   13. TELA DE PAINEL DA CATEGORIA SPECÍFICA
   ========================================================================== */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    width: 100%;
}

.back-arrow-btn {
    width: 40px;
    height: 40px;
    background-color: var(--bg-input);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.back-arrow-btn:hover {
    background-color: #1c2d47;
}

.category-main-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-white);
    text-transform: capitalize; /* Deixa a primeira letra maiúscula automaticamente */
}

/* Grid de produtos dentro da categoria */
.products-vertical-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 produtos por linha igual à home */
    gap: 15px;
    width: 100%;
}

/* ==========================================================================
   14. TELA DE FAVORITOS (CUSTOM CARD)
   ========================================================================== */
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Garante que o preço fique grudado no fundo do card */
    padding-top: 8px;
}

.product-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-white);
}

.bookmark-btn {
    background: none;
    border: none;
    color: var(--primary-blue); /* Ícone de favorito ativo na cor do app */
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.bookmark-btn:hover {
    color: #ff4a4a; /* Se clicar de novo dá o efeito de "desfavoritar" em vermelho */
}

/* ==========================================================================
   15. TELA DE LISTAS DE COMPRAS
   ========================================================================== */
.cart-btn {
    width: 48px;
    height: 48px;
    background-color: var(--bg-input);
    border: none;
    border-radius: 50%;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.listas-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    flex: 1;
    justify-content: flex-start;
}

/* Centraliza o botão quando não houver nenhuma lista, igual ao Figma */
.listas-wrapper.empty-state {
    justify-content: center;
    align-items: center;
}

/* Botão de + Criar Lista do Figma */
.btn-criar-lista {
    background-color: #1a2638;
    color: var(--text-white);
    border: none;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-criar-lista:hover {
    background-color: #24354f;
    transform: scale(1.02);
}

/* Card das listas criadas pelo usuário */
.lista-item-card {
    background-color: #121b2a;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lista-item-card:hover {
    background-color: #172336;
}

.lista-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-white);
}

.btn-deletar-lista {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.btn-deletar-lista:hover {
    color: #ff4a4a;
}

/* ==========================================================================
   16. POP-UP / MODAL CUSTOMIZADO
   ========================================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* Desfoca o fundo do app */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* Classe ativa que o JS vai injetar para mostrar o pop-up */
.custom-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-card {
    background-color: #121b2a; /* Mesmo azul escuro dos seus cards */
    border: 1px solid #1c2d47;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.custom-modal-overlay.show .custom-modal-card {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.modal-input-field {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid #1c2d47;
    border-radius: 8px;
    padding: 12px;
    color: var(--text-white);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 20px;
}

.modal-input-field:focus {
    border-color: var(--primary-blue);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-cancel {
    background-color: #1c2d47;
    color: var(--text-white);
}

.btn-cancel:hover {
    background-color: #24354f;
}

.btn-confirm {
    background-color: var(--primary-blue);
    color: var(--text-white);
}

.btn-confirm:hover {
    background-color: #357ae8;
}

/* ==========================================================================
   17. TELA DE DETALHES DA LISTA (ITENS E CLASSIFICAÇÃO)
   ========================================================================== */
.add-item-box {
    background-color: #121b2a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.add-item-box input, .add-item-box select {
    background-color: var(--bg-input);
    border: 1px solid #1c2d47;
    border-radius: 8px;
    padding: 12px;
    color: var(--text-white);
    outline: none;
    font-size: 0.9rem;
}

.select-row {
    display: flex;
    gap: 10px;
}

.select-row select {
    flex: 1;
}

.add-item-btn {
    background-color: var(--primary-blue);
    color: var(--text-white);
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divisões de categorias geradas pelo JS */
.categoria-group-box {
    margin-bottom: 20px;
    width: 100%;
}

.categoria-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* Linhas dos itens individuais */
.item-lista-row {
    background-color: #121b2a;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.item-lista-row:hover {
    background-color: #172336;
}

.item-text-container {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
    font-size: 0.95rem;
}

/* Estilo de riscado para quando o item for comprado */
.item-lista-row.comprado .item-text-container {
    text-decoration: line-through;
    color: var(--text-muted);
}

.item-lista-row.comprado {
    opacity: 0.6;
}

.btn-remover-item-lista {
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
}

.btn-remover-item-lista:hover {
    color: #ff4a4a;
}

/* ==========================================================================
   18. RODAPÉ FIXO DE SOMA TOTAL (CARRINHO)
   ========================================================================== */
.total-footer-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px; /* Alinhado com o container do seu app */
    background-color: #0b121f;
    border-top: 1px solid #1c2d47;
    padding: 16px 20px;
    z-index: 999;
}

.total-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.total-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.total-count {
    font-size: 0.75rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.total-price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-white);
}

/* Ajustes finos na linha do item */
.item-meta-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}