/* 
-----------------------------------
PALETA DE CORES E VARIÁVEIS
-----------------------------------
*/
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --primary-color: #e63946; /* Vermelho Forte */
    --secondary-color: #ffb703; /* Amarelo/Dourado */
    --text-main: #f1faee;
    --text-muted: #a8dadc;
    --white: #ffffff;
    --gray: #333333;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* 
-----------------------------------
HEADER
-----------------------------------
*/
header {
    background-color: var(--bg-color);
    padding: 15px 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-circle {
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: var(--white);
    border: 2px solid var(--secondary-color);
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.4);
}

header h1 {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white);
    text-align: left;
}

header p {
    font-size: 11px;
    color: var(--secondary-color);
    font-weight: 500;
    text-align: left;
}

.header-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn-cart-trigger, .btn-admin-trigger {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-cart-trigger {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-cart-trigger:hover {
    background-color: #c12e3a;
    transform: scale(1.05);
}

.btn-admin-trigger {
    background-color: transparent;
    color: var(--text-muted);
    font-size: 12px;
    border: 1px solid var(--gray);
}

/* 
-----------------------------------
BANNER
-----------------------------------
*/
.banner {
    width: 100%;
    height: 200px;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1571091718767-18b5b1457add?ixlib=rb-1.2.1&auto=format&fit=crop&w=1352&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.banner h2 {
    font-size: 28px;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 5px;
}

.banner p {
    font-size: 16px;
    color: var(--white);
    max-width: 400px;
}

/* 
-----------------------------------
CATEGORIAS
-----------------------------------
*/
.categories-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    flex-wrap: wrap; /* Permite quebrar linha se necessário */
    transition: var(--transition);
}

.category-btn {
    background-color: var(--gray);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.category-btn.active {
    background-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
}

/* 
-----------------------------------
LISTA DE PRODUTOS
-----------------------------------
*/
.products-container {
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-best-seller {
    background-color: var(--secondary-color);
    color: #000;
}

.badge-combo {
    background-color: var(--primary-color);
    color: var(--white);
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--white);
}

.product-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary-color);
}

.btn-add {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.btn-add:hover {
    background-color: #c12e3a;
}

/* 
-----------------------------------
MODAIS (CARRINHO E ADMIN)
-----------------------------------
*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray);
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--secondary-color);
    text-transform: uppercase;
}

.btn-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

/* 
-----------------------------------
CARRINHO
-----------------------------------
*/
.cart-items {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray);
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.cart-item-info p {
    font-size: 12px;
    color: var(--secondary-color);
    font-weight: bold;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    background: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.qty-val {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: 20px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--gray);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.cart-form input, .cart-form select, .cart-form textarea {
    padding: 10px;
    background-color: var(--gray);
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.cart-form label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: -5px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    background-color: #25d366; /* WhatsApp Green */
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.empty-cart-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* 
-----------------------------------
ADMIN AREA
-----------------------------------
*/
.admin-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tab-btn {
    flex: 1;
    padding: 10px;
    background-color: var(--gray);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
}

.admin-tab-btn.active {
    background-color: var(--primary-color);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px;
    background-color: var(--gray);
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
}

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

.form-row > div {
    flex: 1;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center;
    gap: 10px !important;
}

.btn-save {
    background-color: var(--secondary-color);
    color: black;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.admin-list {
    margin-top: 20px;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--gray);
    margin-bottom: 8px;
    border-radius: 5px;
}

.admin-item-info h5 {
    font-size: 14px;
}

.admin-item-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-item, .btn-delete-item {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
}

.btn-edit-item { background-color: var(--secondary-color); color: black; }
.btn-delete-item { background-color: var(--primary-color); color: white; }

/* 
-----------------------------------
RESPONSIVIDADE
-----------------------------------
*/
/* 
-----------------------------------
BOTTOM NAVIGATION (DESIGN ATUALIZADO)
-----------------------------------
*/
#bottomNav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0d0d0d;
    border-top: 1px solid #1f1f1f;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 12px;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    color: #888;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.nav-item span {
    font-size: 20px;
}

.nav-item p {
    font-size: 10px;
    color: #888;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
    font-weight: bold;
    text-transform: uppercase;
}

.nav-item.active {
    background: #1a1a1a;
}

.nav-item.active span,
.nav-item.active p {
    color: #f5c518 !important;
}

/* Ajuste para o body não ficar cortado pelo rodapé */
body {
    padding-bottom: 80px;
}

/* Estilo para as telas */
.tela {
    display: none;
    width: 100%;
    min-height: 100vh;
}

#tela-cardapio {
    display: block;
}

/* Estilo para a tela de Auth */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.auth-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 350px;
    border: 1px solid var(--gray);
}

.auth-card h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.auth-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--gray);
    border: 1px solid #444;
    border-radius: 10px;
    color: white;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 600px) {
    header { padding: 10px 15px; justify-content: center; }
    .header-actions { display: none; }
    .banner { height: 140px; padding: 15px; }
    .banner h2 { font-size: 20px; }
    .banner p { font-size: 13px; }
    
    .categories-nav { 
        justify-content: center; 
        padding: 10px;
        gap: 8px;
    }

    .category-btn {
        padding: 8px 15px;
        font-size: 13px;
        flex: 0 1 auto;
    }

    .products-container { 
        grid-template-columns: 1fr; 
        padding: 0 15px 30px 15px; 
        gap: 15px;
    }

    .modal-content { 
        max-height: 85vh; 
        border-radius: 20px 20px 0 0; 
        position: fixed; 
        bottom: 70px;
        top: auto;
        left: 0;
        right: 0;
        margin: 0;
        width: 100%;
    }
    .cart-footer { padding: 15px; }
    .cart-form input, .cart-form select, .cart-form textarea { font-size: 16px; }
}

@media (min-width: 1024px) {
    .products-container { grid-template-columns: repeat(3, 1fr); }
}
