/* ============================================================
    RESET E CONFIGURAÇÕES GERAIS
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: #f7f7f7;
    color: #333;
    line-height: 1.6;
    padding-top: 0; 
}

.container {
    width: 100%;
    max-width: 75rem; 
    margin: 0 auto;
    padding: 0 1.2rem;
}

/* ============================================================
    CABEÇALHO (NAVBAR) - NORDGO FOOD (VERSÃO FINAL DESKTOP)
   ============================================================ */
.main-header {
    background: #fff;
    height: 4.5rem; 
    display: flex;
    align-items: center;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    grid-template-columns: 1fr auto 1fr;
    max-width: 75rem;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-left {
    flex: 1;
    min-width: 180px; 
    display: flex;
    align-items: center;
}

.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.header-right { 
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    /* TRAVA DE SEGURANÇA: Impede a barra de busca de encostar no usuário */
    padding-left: 2.5rem !important; 
}

/* --- PÍLULAS PADRONIZADAS --- */
.pill-badge, 
.search-bar-wrapper,
.btn-login {
    height: 3rem; 
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 6.25rem; 
    border: 0.0625rem solid #e2e2e2;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.location-text {
    margin-left: 1.25rem;
}

/* Home e Voltar: Ícone na esquerda e texto centralizado no resto */
.pill-home, .pill-back {
    width: 140px; 
    flex-shrink: 0;
    padding: 0 0.8rem !important; 
    justify-content: flex-start; 
}

.pill-home span, .pill-back span {
    flex: 1; 
    text-align: center; 
    font-weight: 500;
    /* Compensa o ícone da esquerda para o texto centralizar na pílula toda */
    margin-right: 1.2rem; 
}

/* FIX: Pílula de Título (Meu Perfil) - Impede que vire círculo no Desktop */
.pill-page-title {
    width: auto !important;
    min-width: 120px;
    padding: 0 1.5rem !important;
    justify-content: center;
    cursor: default;
}

.pill-page-title span {
    margin: 0 !important; /* Sem margem de compensação aqui */
    white-space: nowrap;
}

.pill-badge {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.pill-badge:hover, .btn-login:hover {
    background-color: #ededed;
}

/* --- ÁREA DO USUÁRIO: Foto na Direita --- */
.pill-user {
    flex-direction: row-reverse; 
    padding: 0 0.5rem 0 1.2rem !important; 
    gap: 0.8rem;
    white-space: nowrap;
}

.user-photo-placeholder {
    width: 1.875rem;
    height: 1.875rem;
    background: #e2e2e2;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- LOGO E ÍCONES --- */
.main-logo {
    height: 1.5rem; 
    width: auto;
    display: block;
}

.back-icon-img {
    height: 1.2rem;
    width: auto;
    display: block;
}

/* --- BOTÃO DE LOGIN --- */
.btn-login {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    gap: 0.6rem;
    white-space: nowrap;
}

.btn-login:hover {
    background-color: #219150;
}

/* --- BARRA DE BUSCA --- */
.search-bar-wrapper {
    width: 100%;
    padding: 0 1.2rem;
}

.search-bar-wrapper input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    padding: 0.5rem;
}

/* --- DROPDOWN --- */
.dropdown-content {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px); 
    position: absolute;
    left: 50%; 
    top: calc(100% + 8px);
    background-color: #fff;
    min-width: 13rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 0.6rem 0;
    z-index: 1100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu-container {
    position: relative;
}

.user-menu-container:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content a, .dropdown-content button {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #444;
    font-size: 0.9rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

/* ============================================================
    SEÇÃO HERO E CARDS
   ============================================================ */
.hero {
    padding: 2.5rem 1rem;
    text-align: center;
    background: #fff;
    margin-bottom: 1rem;
}

.hero h2 {
    font-size: 1.5rem;
    max-width: 90%;
    margin: 0 auto 0.5rem;
}

.card-loja {
    background: white;
    border-radius: 1rem; /* 16px */
    overflow: hidden;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 0.0625rem solid #f0f0f0;
}

/* ============================================================
    BOTÕES DE ADIÇÃO E CARRINHO (PADRÃO GLOBAL - ATUALIZADO)
   ============================================================ */

/* 1. Botão de Adicionar Unificado (Slim: + 🛒) */
.btn-add-carrinho {
    display: flex !important;
    width: 3.4rem;
    height: 2.4rem;
    background-color: #ff4757;
    color: white;
    border: none;
    border-radius: 0.7rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    z-index: 5;
}

.btn-add-carrinho i:first-child {
    font-size: 0.7rem; /* Sinal de + */
}

.btn-add-carrinho i:last-child {
    font-size: 0.95rem; /* Ícone de Carrinho */
}

.btn-add-carrinho:hover {
    background-color: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.3);
}

.btn-add-carrinho:active {
    transform: scale(0.95);
}

/* 2. Carrinho Flutuante (Layout: Preço sobre Quantidade) */
.carrinho-flutuante {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    background-color: #2ed573;
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    z-index: 9999;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.4);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.carrinho-flutuante.hidden {
    display: none !important;
}

.carrinho-flutuante:hover {
    transform: scale(1.05);
    background-color: #26af5d;
}

/* Container do Ícone (Esquerda) */
.cart-icon-container {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container do Texto Empilhado (Direita) */
.cart-stack-info {
    display: flex;
    flex-direction: column; /* Empilha os itens verticalmente */
    align-items: flex-start;
    line-height: 1.1; /* Deixa o texto mais "juntinho" */
}

/* Valor Total (Destaque Superior) */
.carrinho-valor-total {
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
}

/* Label de Quantidade (Texto Inferior Menor) */
.cart-count-label {
    font-size: 0.75rem; /* Tamanho reduzido conforme pedido */
    font-weight: 400;
    opacity: 0.9;
}

/* Animação para entrada lateral */
@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
    LAYOUT DA PÁGINA DE CARRINHO (GRID E MULTILOJA)
   ============================================================ */

.carrinho-layout {
    display: grid;
    grid-template-columns: 1fr 22rem;
    gap: 2rem;
    margin-top: 2rem;
}

/* Card de Agrupamento por Loja */
.card-loja-carrinho {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.header-loja-carrinho {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f2f6;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #2f3542;
}

.header-loja-carrinho i {
    color: #ff4757; /* Destaque para o ícone da loja */
}

/* Estilização dos Itens (Simples) dentro da Loja */
.item-carrinho-simples {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.item-carrinho-simples:last-child {
    border-bottom: none;
}

.item-carrinho-simples img {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.5rem;
    object-fit: cover;
}

.info-item {
    flex: 1;
}

.info-item h4 {
    font-size: 1rem;
    color: #2f3542;
    margin-bottom: 0.2rem;
}

.info-item span {
    color: #2ed573;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Controles de Quantidade Compactos */
.controles-qtd-carrinho {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #f1f2f6;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
}

.controles-qtd-carrinho button {
    background: none;
    border: none;
    color: #2f3542;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    transition: color 0.2s;
}

.controles-qtd-carrinho button:hover {
    color: #ff4757;
}

.controles-qtd-carrinho span {
    font-weight: 700;
    min-width: 1.2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================================
    SISTEMA DE CUPONS E RESUMO
   ============================================================ */

/* Campos de Cupom */
.cupom-global-area, .cupom-loja-area {
    margin-top: 1rem;
}

.cupom-global-area label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #57606f;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input, .input-cupom-loja {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #dfe4ea;
    border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border 0.2s;
}

.input-group input:focus {
    border-color: #2ed573;
}

.btn-aplicar {
    background: #2ed573;
    color: white;
    border: none;
    padding: 0 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-aplicar:hover {
    background: #26af5f;
}

/* Resumo do Pedido */
.card-resumo {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    height: fit-content;
    position: sticky;
    top: 6rem;
    box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.05);
}

.resumo-detalhes {
    margin-top: 1.5rem;
}

.linha-resumo {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    color: #57606f;
    font-size: 0.95rem;
}

.linha-resumo.desconto {
    color: #2ed573;
    font-weight: 600;
}

.linha-resumo.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2f3542;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f1f2f6;
}

.btn-finalizar-checkout {
    width: 100%;
    background: #ff4757;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: transform 0.2s, background 0.2s;
}

.btn-finalizar-checkout:hover {
    background: #ff6b81;
    transform: translateY(-2px);
}

/* ============================================================
    ANIMAÇÕES E RESPONSIVIDADE
   ============================================================ */

.hidden { display: none !important; }

@keyframes slideUp {
    from { bottom: -5rem; opacity: 0; }
    to { bottom: 1.5rem; opacity: 1; }
}

/* --- LOGIN-LOJA / CADASTRO DE VENDEDOR --- */

/* Overlay de carregamento (Impede o flicker antes de verificar se é dono) */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    color: var(--cor-principal); /* Certifique-se de ter essa cor definida no :root */
}

.loader-content i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Badge de Vendedor */
.badge-vendedor {
    background: #e3f2fd;
    color: #1976d2;
    display: inline-block;
    padding: 0.375rem 1rem; /* 6px 16px */
    border-radius: 3.125rem; /* 50px */
    font-size: 0.75rem; /* 12px */
    font-weight: 600;
    margin-bottom: 0.75rem; /* 12px */
}

/* Grid de Cadastro para organizar os campos */
.grid-cadastro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9375rem; /* 15px */
}

.grid-cadastro .full-width {
    grid-column: span 2;
}

/* Títulos das Seções no Formulário */
.grid-cadastro h3 {
    font-size: 1rem;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-cadastro h3 i {
    color: var(--cor-principal);
}

/* Ajustes para Textarea */
#loja-descricao {
    resize: none;
    font-family: inherit;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* --- ESTILIZAÇÃO DO SELECT (CATEGORIAS) --- */

#loja-categoria {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    /* Ícone de seta customizado */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23d35400' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem; /* 16px */
    cursor: pointer;
    padding-right: 2.5rem; /* 40px */
}

/* Efeito ao passar o mouse */
#loja-categoria:hover {
    border-color: var(--cor-principal);
}

/* Efeito ao clicar/focar */
#loja-categoria:focus, 
.login-form input:focus {
    outline: none;
    border-color: var(--cor-principal);
    /* Brilho suave usando rem para o espalhamento */
    box-shadow: 0 0 0 0.1875rem rgba(211, 84, 0, 0.1); 
}
/* Estilizando as opções (limitado pelo navegador, mas ajuda no espaçamento) */
#loja-categoria option {
    padding: 10px;
    background-color: #fff;
    color: #333;
}

/* Ajuste para o placeholder (primeira opção) ficar cinza */
#loja-categoria:invalid,
#loja-categoria option[value=""] {
    color: #999;
}

/* Classe utilitária para esconder elementos */
.hidden {
    display: none !important;
}

/* Botão de Sucesso (Verde) */
.btn-success {
    background-color: #28a745 !important;
    color: white;
    border: none;
    transition: background 0.3s ease;
}

.btn-success:hover {
    background-color: #218838 !important;
}

/* Botões Auxiliares */
.btn-success { background: #2ecc71 !important; color: #fff; }
.btn-secondary { background: #eee !important; color: #333 !important; }

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #999;
    font-size: 0.85rem;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.form-footer a {
    color: #ff4757;
    font-weight: 600;
    text-decoration: none;
}

/* Container do Menu do Usuário */
.user-menu-container {
    position: absolute;
    display: inline-block;
    cursor: pointer;
}

.user-name-display {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* O Menu Suspenso (Escondido por padrão) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    min-width: 10rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #eee;
}

/* Itens do Menu */
.dropdown-content a, .dropdown-content button {
    color: #333;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-content a:hover, .dropdown-content button:hover {
    background-color: #f8f9fa;
    color: #ff4757;
}

/* Mostrar ao passar o mouse */
.user-menu-container:hover .dropdown-content {
    display: block;
}

/* Estilo do botão de Sair (Logout) */
.btn-logout-menu {
    border-top: 1px solid #eee !important;
    color: #ff4757 !important;
}

/* Container do Perfil */
.profile-page {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 1.1rem;
    color: var(--cor-primaria, #e63946); /* Cor do NordGo */
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ajuste das linhas duplas (CEP/Bairro e Número/Obs) */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

/* Estilização dos Botões */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recovery-area {
    text-align: right;
    margin: -0.5rem 0 1rem 0;
}

.btn-principal, .btn-secundario, .btn-perigo {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

/* Botão Salvar (Verde ou Cor Primária) */
.btn-principal {
    background-color: #27ae60;
    color: white;
}

.btn-principal:hover {
    background-color: #219150;
}

/* Botão Sair (Cinza) */
.btn-secundario {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.btn-secundario:hover {
    background-color: #bdc3c7;
}

/* Botão Excluir (Vermelho) */
.btn-perigo {
    background-color: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-perigo:hover {
    background-color: #e74c3c;
    color: white;
}

/* ============================================================
    ESTILIZAÇÃO DOS BOTÕES (LOGIN E GOOGLE)
   ============================================================ */

/* Botão Entrar (E-mail/Senha) */
.btn-entrar {
    background-color: #ff4757; /* Vermelho NordGo */
    color: white;
    border: none;
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 0.5rem;
}

.btn-entrar:hover {
    background-color: #e84118;
    transform: translateY(-1px);
}

.btn-entrar:active {
    transform: translateY(0);
}

/* Botão Google */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #ffffff;
    color: #444;
    border: 1px solid #ddd;
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.2s;
}

.btn-google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-google i {
    font-size: 1.1rem;
    color: #4285F4; /* Azul padrão do Google */
}

/* Divisor "ou" */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #999;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.divider:not(:empty)::before {
    margin-right: .75rem;
}

.divider:not(:empty)::after {
    margin-left: .75rem;
}

/* ============================================================
    HERO SECTION
   ============================================================ */
.hero {
    background-color: #fff;
    padding: 3rem 1.5rem;
    text-align: center;
    border-bottom: 0.0625rem solid #eee;
}

.hero h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.hero p {
    color: #666;
    font-size: 1.1rem;
}

/* ============================================================
    SLIDER DE CATEGORIAS
   ============================================================ */
.categorias-slider {
    display: flex;
    gap: 0.75rem; /* 12px */
    overflow-x: auto;
    padding: 1.25rem 0; /* 20px */
    scroll-behavior: smooth;
    scrollbar-width: none; 
}

.categorias-slider::-webkit-scrollbar {
    display: none;
}

.cat-item {
    flex: 0 0 auto;
    padding: 0.625rem 1.375rem; /* 10px 22px */
    background: #fff;
    border-radius: 1.875rem; /* 30px */
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 0.0625rem solid #e2e2e2;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.02);
}

.cat-item:hover {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
    transform: translateY(-0.125rem); /* -2px */
}

/* ============================================================
    GRID DE LOJAS (RESTAURANTES)
   ============================================================ */
.section-title {
    margin-top: 2rem;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.grid-lojas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0 4rem;
}



.card-loja:hover {
    transform: translateY(-0.375rem); /* -6px */
    box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,0.1);
}

.banner-loja {
    height: 7.5rem; /* 120px */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-loja {
    width: 5rem; /* 80px */
    height: 5rem;
    border-radius: 50%;
    border: 0.25rem solid white;
    object-fit: cover;
    background: white;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
}

.info-loja {
    padding: 1.2rem;
}

.info-loja h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #2d3436;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-loja p {
    margin: 0.375rem 0 0;
    font-size: 0.85rem;
    color: #636e72;
}

/* Badge de Proximidade */
.badge-proximo {
    background: #2ecc71;
    color: white;
    font-size: 0.65rem;
    padding: 0.1875rem 0.5rem; /* 3px 8px */
    border-radius: 0.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
}

/* Estado de Carregamento */
.loading {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
    grid-column: 1 / -1;
}

/* ============================================================
   ESTILIZAÇÃO DA BARRA DE ROLAGEM (SCROLLBAR)
   ============================================================ */

/* Para o conteúdo interno do modal */
.modal-content::-webkit-scrollbar {
    width: 0.3rem; /* Barra bem fina */
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    /* Adiciona uma margem para a barra não encostar nas quinas arredondadas */
    margin: 1rem; 
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d1d8e0;
    border-radius: 1rem;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #ff4757; /* Ganha a cor do seu tema ao passar o mouse */
}

/* Suporte para Firefox */
.modal-content {
    background: #fff;
    width: 95%;
    max-width: 34.375rem;
    
    /* Define uma altura máxima para que o cartão não suma da tela */
    max-height: 85vh; 
    
    /* Habilita a rolagem APENAS dentro do cartão branco */
    overflow-y: auto; 
    overflow-x: hidden;
    
    border-radius: 1.5625rem;
    padding: 1.875rem;
    position: relative;
    transform: translateY(1.875rem);
    transition: all 0.4s ease;
    box-shadow: 0 1.25rem 3.125rem rgba(0,0,0,0.2);
}

/* ============================================================
    LOJA.HTML - ESTRUTURA E IDENTIDADE (DESKTOP/BASE)
   ============================================================ */

.loja-hero {
    position: relative;
    width: 100%;
    background-color: #fff;
}

/* Banner Compacto */
.loja-banner {
    width: 100%;
    height: 8.5rem; 
    background-size: cover;
    background-position: center;
    border-radius: 0 0 1rem 1rem;
    border-bottom: 1px solid #eee;
}

.loja-perfil {
    position: relative;
    padding: 0 1rem 1.5rem;
    margin-top: -3.125rem; /* Sobe a logo sobre o banner */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.loja-logo-container {
    width: 6.25rem;
    height: 6.25rem;
    background: #fff;
    border-radius: 50%;
    padding: 0.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 5;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.loja-logo-circular { 
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; 
}

.tag-categoria {
    font-size: 0.875rem; color: #666; background: #f1f2f6;
    padding: 0.25rem 0.75rem; border-radius: 1.25rem; margin-bottom: 1rem;
}

.loja-meta { 
    display: flex; align-items: center; gap: 0.5rem; 
    font-size: 0.875rem; color: #666; margin-bottom: 1rem; 
}
.loja-meta i { color: #ffb142; }

/* ============================================================
    GRIDS E CONTAINERS (2 COLUNAS)
   ============================================================ */

.titulo-sessao, .titulo-categoria {
    font-size: 1.25rem; font-weight: 600; color: #2f3542; margin: 2rem 0 1.2rem 0;
}

/* Mais Pedidos (Scroll Horizontal) */
.horizontal-scroll-container {
    display: flex; overflow-x: auto; gap: 1.2rem;
    padding: 15px 5px 1.5rem 5px; /* Padding evita corte do hover */
    margin-top: -10px; scrollbar-width: none;
}
.horizontal-scroll-container::-webkit-scrollbar { display: none; }

/* Grid de Categorias (2 Colunas Desktop) */
.grid-produtos-detalhado {
    display: grid; grid-template-columns: repeat(2, 1fr); 
    gap: 1.5rem; padding-top: 15px; margin-top: -10px;
}

/* ============================================================
    BOTÃO DE ADICIONAR UNIFICADO (.btn-add-carrinho)
   ============================================================ */

.btn-add-carrinho {
    display: flex;
    width: 3.4rem; height: 2.4rem;
    background-color: #ff4757; color: white;
    border: none; border-radius: 0.7rem;
    cursor: pointer; align-items: center; justify-content: center;
    gap: 3px; z-index: 5;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    transition: all 0.2s ease;
}

.btn-add-carrinho i:first-child { font-size: 0.7rem; }
.btn-add-carrinho i:last-child { font-size: 0.95rem; }

.btn-add-carrinho:hover {
    background-color: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.3);
}

.btn-add-carrinho:active { transform: scale(0.95); }

/* Lógica de posição: Se estiver dentro do card quadrado (Mais Pedidos) */
.card-produto-quadrado .btn-add-carrinho {
    position: absolute; right: 0.8rem; bottom: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ============================================================
    MODELO 1: CARD QUADRADO (MAIS PEDIDOS)
   ============================================================ */

.card-produto-quadrado {
    position: relative; width: 14rem; aspect-ratio: 1 / 1;
    border-radius: 1rem; overflow: hidden; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.3s ease;
}

.card-produto-quadrado:hover { transform: translateY(-8px); z-index: 10; }
.card-produto-quadrado img { width: 100%; height: 100%; object-fit: cover; }

.card-produto-quadrado .info-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 0.8rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 100%);
    display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none;
}

/* Textos no Card Quadrado (Corrigidos para Branco) */
.card-produto-quadrado h3 { 
    color: #fff; font-size: 1.1rem; margin-bottom: 4px; 
}
.card-produto-quadrado .preco-tag { 
    color: #fff; font-weight: 700; font-size: 1rem; 
}

/* ============================================================
    MODELO 2: CARD HORIZONTAL (CATEGORIAS)
   ============================================================ */

.card-produto-horizontal {
    display: flex; background: #fff; border: 1px solid #f0f0f0;
    border-radius: 1rem; padding: 0.85rem; gap: 1.2rem; align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-produto-horizontal:hover {
    transform: translateY(-4px); box-shadow: 0 5px 15px rgba(0,0,0,0.06); z-index: 10;
}

.prod-foto-lateral { 
    width: 6rem; height: 6rem; flex-shrink: 0; border-radius: 0.8rem; overflow: hidden; 
}
.prod-foto-lateral img { width: 100%; height: 100%; object-fit: cover; }

.prod-conteudo { display: flex; flex: 1; justify-content: space-between; align-items: center; }
.prod-textos { flex: 1; padding-right: 1rem; }

/* Status Badges */
.prod-header-info { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.prod-header-info h4 { font-size: 1.1rem; color: #2d3436; font-weight: 600; }

.status-badge { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.status-disponivel { color: #2ed573; }
.status-indisponivel { color: #ff4757; }

.prod-desc-completa { 
    font-size: 0.85rem; color: #777; line-height: 1.4; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; 
}

/* Coluna de Preço e Botão */
.prod-acoes-lateral { 
    display: flex; flex-direction: column; align-items: flex-end; 
    justify-content: center; gap: 0.5rem; min-width: 7rem; 
}
.preco-detalhe { font-size: 1.25rem; font-weight: 700; color: #2ed573; }

/* Estados de Esgotado */
.prod-esgotado { filter: grayscale(1); opacity: 0.6; }
.badge-esgotado {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7); color: #fff; padding: 0.3rem 0.6rem; border-radius: 0.4rem; font-size: 0.7rem;
}

/* ============================================================
    RESPONSIVIDADE (UNIFICADA - @MEDIA)
   ============================================================ */

/* TABLETS E SMARTPHONES (Até 768px / 48rem) */
@media (max-width: 48rem) {
    
    /* 1. HEADER: Ajuste de Estrutura */
    header.main-header {
        height: 4.5rem !important;
    }

    header.main-header .header-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 0.8rem !important;
        gap: 0.6rem !important;
    }

    /* Trava as pontas (Home, Voltar e Usuário/Entrar) */
    .header-left, .header-right {
        flex: 0 0 3.2rem !important; 
        min-width: 3.2rem !important;
        max-width: 3.2rem !important;
        width: 3.2rem !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .header-right {
        justify-content: flex-end !important;
    }

    .header-center {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        min-width: 0 !important;
    }

    /* BOTÕES CIRCULARES (Home, Voltar, Usuário e ENTRAR) */
    header.main-header .pill-home,
    header.main-header .pill-back,
    header.main-header .pill-user,
    header.main-header .btn-login {
        width: 3.2rem !important;
        height: 3.2rem !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        /* Garante que qualquer texto solto não empurre o layout */
        font-size: 0 !important; 
    }

    /* EXCEÇÃO: Pílula de Título (Meu Perfil) */
    header.main-header .pill-page-title {
        width: auto !important; 
        min-width: unset !important;
        max-width: 85% !important;
        height: 2.8rem !important;
        padding: 0 1.2rem !important;
        border-radius: 6.25rem !important;
        background-color: #f5f5f5 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Esconde Textos das pontas */
    .pill-home span, 
    .pill-back span, 
    .pill-user span,
    .user-name-text, 
    .location-text, 
    .btn-login span, 
    .pill-user i, 
    .icone-seta { 
        display: none !important; 
    }

    /* Garante que o ícone dentro do botão de login (se houver) apareça */
    .btn-login i {
        display: block !important;
        font-size: 1.2rem !important;
        margin: 0 !important;
        color: white;
    }

    /* Texto do título central (perfil.html) */
    header.main-header .pill-page-title span {
        display: block !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #333 !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    /* BARRA DE PESQUISA (index.html) */
    .search-bar-wrapper {
        width: 100% !important;
        height: 3rem !important;
        border-radius: 6.25rem !important;
        padding: 0 1rem !important;
    }

    /* Imagens nos círculos */
    .main-logo, .back-icon-img {
        height: 1.5rem !important;
        width: auto !important;
    }

    .user-photo-placeholder {
        width: 2.2rem !important;
        height: 2.2rem !important;
    }

    /* 2. VITRINE MOBILE: Banner Compacto */
    .loja-banner, .loja-banner-sk {
        height: 7rem !important;
    }

    /* 3. MAIS PEDIDOS */
    .card-produto-quadrado { width: 9.5rem !important; }
    .card-produto-quadrado .btn-add-carrinho {
        width: 2.6rem !important; height: 1.8rem !important;
    }

    /* 4. CATEGORIAS */
    /* Garante que a seção do cardápio não sangre para as bordas */
    .cardapio-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }

    /* Força o grid a se comportar como uma lista vertical de 100% de largura */
    .grid-produtos-detalhado { 
        display: flex !important;
        flex-direction: column !important; 
        gap: 1rem !important; 
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* O Card ocupa 100% do pai, sem margens externas para não vazar */
    .card-produto-horizontal { 
        width: 100% !important; 
        max-width: 100% !important;
        margin: 0 !important; 
        box-sizing: border-box !important;
        padding: 0.7rem !important; 
        gap: 0.8rem !important; /* Espaço ideal entre a foto e o conteúdo */
    }

    /* Container do conteúdo ganha flex dinâmico sem colapsar */
    .prod-conteudo {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex: 1 !important;
        min-width: 0 !important;
        gap: 0.5rem !important;
    }

    /* Bloco de textos ocupa o espaço restante */
    .prod-textos {
        flex: 1 !important;
        min-width: 0 !important;
    }

    /* CORREÇÃO DO BUG: Força o texto a quebrar por palavras, nunca por letras */
    .prod-textos h4 {
        font-size: 0.95rem !important;
        white-space: normal !important;
        word-break: normal !important; /* Impede a quebra letra por letra */
        overflow-wrap: break-word !important; /* Quebra apenas palavras gigantes */
    }

    .prod-desc-completa {
        font-size: 0.8rem !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    /* Mantém os botões e preços firmes na direita */
    .prod-acoes-lateral {
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0.3rem !important;
    }

    /* 5. MENU DROPDOWN */
    .dropdown-content { 
        right: 0 !important; 
        left: auto !important; 
        min-width: 12rem !important;
        transform: translateY(10px) !important; 
    }

    /* 6. MEU CARRINHO (Empilhamento e Ajuste de Fluxo Mobile) */
    
    /* Transforma o layout lado a lado em uma lista vertical */
    .carrinho-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Força tanto a lista de itens quanto o resumo a ocuparem a largura total da tela */
    .coluna-itens, 
    .coluna-resumo {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ajusta o card de resumo para não estourar os limites internos */
    .card-resumo {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 1.5rem 1.2rem !important;
    }

    /* Ajuste fino para os inputs de cupom não quebrarem o layout em telas estreitas */
    .cupom-global-area .input-group,
    .cupom-loja-area .input-group {
        width: 100% !important;
        display: flex !important;
        gap: 0.5rem !important;
    }

    .cupom-global-area input,
    .cupom-loja-area input {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

/* CELULARES PEQUENOS */
@media (max-width: 25rem) {
    .prod-foto-lateral { width: 4.8rem !important; height: 4.8rem !important; }
    header.main-header .header-container { gap: 0.4rem !important; }
    header.main-header .pill-page-title { padding: 0 0.8rem !important; }
}