/* ===================================================
   CameloMix v2 - Estilos Mobile App-Like (max-width: 768px)
   =================================================== */

/* === RESET & LAYOUT GLOBAL MOBILE === */
body {
    padding-bottom: 70px; /* Espaço para a bottom navigation bar */
}

:root {
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 40px;
    --font-size-2xl: 1.8rem;
    --font-size-xl: 1.5rem;
}

/* === NAVBAR: TOPO MINIMALISTA === */
.navbar {
    padding: var(--space-sm) 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.navbar .container {
    flex-wrap: wrap;
    flex-direction: column;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
}
.navbar-brand {
    flex: 1 1 100%; /* A logo ocupa linha inteira */
    justify-content: center; /* Centraliza conteúdo da logo */
}
.navbar-brand img {
    height: 120px !important; /* Logo maior no mobile */
}
.navbar-brand span {
    font-size: var(--font-size-xl);
    display: none; /* Esconde nome se tiver logo grande */
}

/* Ocultar elementos desktop obsoletos */
.navbar-actions { 
    display: none !important; /* Oculta carrinho, conta e hamburguer superiores (vão pra bottom nav) */ 
}
.categories-bar { 
    display: none !important; /* Oculta a barra de categorias antiga do topo */
}
#theme-toggle {
    display: flex !important; /* Só manteremos no topo o botão de modo escuro */
    width: 36px; height: 36px; font-size: 1rem;
    margin-right: 0;
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Caixa de pesquisa: linha abaixo da logo */
.navbar-search {
    display: block !important; /* Força exibir no mobile (sobrepondo o global) */
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 5px;
    margin-bottom: 10px;
    position: relative;
    z-index: 10;
}
.navbar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border-radius: 20px;
    display: block !important;
}

/* === BOTTOM NAVIGATION BAR (A la PWA) === */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    width: 25%;
    height: 100%;
    transition: var(--transition-fast);
    position: relative;
}
.bottom-nav-item i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}
.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item:hover i, .bottom-nav-item.active i {
    transform: translateY(-2px);
}
.bottom-nav-badge {
    position: absolute;
    top: 6px;
    right: 25%;
    transform: translateX(50%);
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* === PRODUTOS: GRID DE 2 COLUNAS COMPACTO === */
.products-grid, .grid-3, .grid-4, .grid-5, .grid-auto {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
}
.product-card {
    border-radius: var(--border-radius); /* Cards um pouco mais rentes */
}
.product-card .product-info {
    padding: 10px 8px 12px;
}
.product-card .product-name {
    font-size: 13px; /* Nome um pouco menor e focado */
    line-height: 1.3;
}
.price-container .current-price, .promo-price {
    font-size: 16px !important; /* Preço focadíssimo */
}
.product-card .btn {
    padding: 8px; /* Reduzindo botão de comprar em mobile pra caber os dois no grid */
    font-size: 12px;
}

/* === ALINHAMENTOS E ESPAÇOS === */
.section-header {
    flex-direction: row; /* Mantém título e link ver mais lado a lado se couber */
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}
.section-header h2 {
    font-size: var(--font-size-xl);
}
.hero-slide {
    min-height: 250px; /* Banner mais achatadinho em cel. */
}
.hero-content {
    padding: var(--space-lg);
}

/* Flutuantes (WhatsApp/Chat) para não baterem no bottom-nav */
.whatsapp-float {
    bottom: 85px; /* Subindo o botão pra dar chance a bottom nav */
    right: 16px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
}
.chat-fab {
    bottom: 85px;
    left: 16px; /* Movendo para esquerda p/ balancear ou outro lugar */
    right: auto;
}
.chat-fab-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

/* Toast alert centralizado abaixo */
.toast-container {
    bottom: 80px; 
    left: 10px;
    right: 10px;
    top: auto !important;
}

/* Carrinho Sidebar se estiver aberta no cel ocupa toda width */
.cart-sidebar {
    width: 100% !important;
}

/* Forms e Tables */
table, th, td, tr, thead, tbody {
    font-size: var(--font-size-sm);
}
.form-group {
    width: 100%; /* Ajuste natural de blocos de contato form */
}

/* === CORREÇÕES DE GRID (Minha Conta E Carrinho) === */
div[style*="grid-template-columns:240px 1fr"],
div[style*="grid-template-columns:1fr 360px"],
div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
}

/* === ITENS DO CARRINHO (Mobile) === */
#cart-page-content .flex.items-center.gap-lg {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-md) !important;
}
#cart-page-content .flex.items-center.gap-lg > div[style*="flex:1"] {
    flex: 1 1 100% !important; /* Força o nome do produto ocupar a linha */
}
#cart-page-content .flex.items-center.gap-lg > .flex.items-center.gap-sm {
    margin-right: auto;
}

/* === TABELAS RESPONSIVAS (Mobile Padrão Checkout) === */
.table-wrapper table, .table-wrapper tbody, .table-wrapper tr {
    display: block;
    width: 100%;
}
.table-wrapper thead {
    display: none;
}
.table-wrapper tr {
    border-bottom: 2px solid var(--border-color);
    padding: 10px 0;
}
.table-wrapper tr:last-child {
    border-bottom: none;
}
.table-wrapper td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 !important;
    border: none !important;
    font-size: var(--font-size-sm);
}
.table-wrapper td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
}
.table-wrapper td:first-child {
    flex-direction: column;
    align-items: flex-start;
}
.table-wrapper td:first-child::before {
    display: none; /* Imagem do produto não precisa de label */
}
