/* Importações e Variáveis Globais */
:root {
  --primary-green: #0a3a1e;
  --dark-wood: #211717;
  --text-light: #f5f5f5;
  --gold-accent: #d4af37;
  --red-accent: #c0392b;
  --font-main: "Poppins", sans-serif;
  --font-title: "Oswald", sans-serif;
}

html {
  /* Deixa um espaço no topo ao rolar para um link #, considerando a altura do header + nav */
  scroll-padding-top: 150px;
}

body {
  font-family: var(--font-main);
  background-color: var(--dark-wood);
  color: var(--text-light);
  margin: 0;
  padding-bottom: 100px; /* Espaço para o botão flutuante */
}

/* --- Tela de Boas-Vindas (index.php) --- */
.welcome-body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("https://i.imgur.com/your-snooker-bg.jpg") no-repeat center center;
  background-size: cover;
}
.welcome-container {
  text-align: center;
  background-color: rgba(10, 58, 30, 0.9);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--gold-accent);
}
.welcome-container .logo {
  font-family: var(--font-title);
  font-size: 3.5rem;
  color: var(--gold-accent);
  margin-bottom: 10px;
}
.welcome-container h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.welcome-container p {
  font-size: 1rem;
  margin-bottom: 25px;
}
.welcome-container input {
  width: 80%;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--gold-accent);
  background-color: #f5f5f5;
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 20px;
}
.welcome-container button {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  background-color: var(--gold-accent);
  color: var(--dark-wood);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.welcome-container button:hover {
  background-color: #f0c96f;
}

/* --- Cardápio (cardapio.php) --- */
header {
  background-color: var(--primary-green);
  padding: 15px 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--gold-accent);
  margin: 0;
}
.mesa-info {
  font-size: 1.2rem;
}

main {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
}

.category-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--gold-accent);
  border-bottom: 2px solid var(--primary-green);
  padding-bottom: 10px;
  margin-bottom: 30px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 5px solid var(--primary-green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.item-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #ccc;
  max-width: 400px;
}

.item-price-action {
  text-align: right;
}
.price {
  font-size: 1.3rem;
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
  color: var(--text-light);
}
.add-to-cart-btn {
  padding: 10px 20px;
  background-color: var(--gold-accent);
  color: var(--dark-wood);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}
.add-to-cart-btn:hover {
  background-color: #f0c96f;
}

/* --- Carrinho Flutuante (FAB) e Modal --- */
#cart-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: var(--gold-accent);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  z-index: 1001;
}
#cart-fab i {
  font-size: 1.8rem;
  color: var(--dark-wood);
}
#cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--red-accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}
.modal-content {
  background-color: var(--dark-wood);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid var(--gold-accent);
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  position: relative;
}
.close-btn {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
#cart-items .cart-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #444;
}
.cart-total {
  text-align: right;
  font-size: 1.5rem;
  margin-top: 20px;
}
#checkout-btn {
  width: 100%;
  padding: 15px;
  margin-top: 20px;
  background-color: var(--red-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* --- Estilos Adicionais para o Modal do Carrinho --- */
#cart-items .cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5px;
  border-bottom: 1px solid #444;
}
.cart-item-info span {
  display: block;
}
.cart-item-info .cart-item-price {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 5px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-item-controls span {
  font-size: 1.1rem;
  min-width: 20px;
  text-align: center;
}
.cart-item-controls .cart-action {
  background-color: var(--primary-green);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: bold;
  line-height: 28px;
}
.cart-item-controls .cart-action.remove {
  background-color: var(--red-accent);
  font-size: 1.5rem;
}
/* --- Itens do Cardápio --- */
.menu-item {
  display: flex;
  /* Alinha os itens no topo */
  align-items: flex-start;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 5px solid var(--primary-green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Adicionamos a nova regra para a imagem */
.item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  /* Adiciona o espaçamento de 20px que você pediu */
  margin-right: 20px;
  flex-shrink: 0; /* Impede que a imagem encolha */
}

.item-info h3 {
  /* Remove qualquer margem que possa estar desalinhando o texto */
  margin: 0 0 5px 0;
  font-size: 1.3rem;
  color: var(--text-light);
}

/* Estilo para imagem na tabela do admin */
.img-tabela {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

/* Estilo para preview de imagem no modal do admin */
.img-preview {
  max-width: 100px;
  margin-top: 10px;
  display: block;
}

.logo-img {
  width: 200px;
  height: auto;
}

.logo-cardapio {
  width: 70px;
  height: auto;
}

/* --- Estilos para o Menu de Categorias --- */
#category-nav {
  background-color: var(--dark-wood);
  position: sticky;
  /* Aumentamos o valor para garantir espaço para o header */
  top: 86px;
  z-index: 999;
  padding: 10px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  overflow-x: auto;
  white-space: nowrap;
}
.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

#category-nav a {
  color: var(--text-light);
  text-decoration: none;
  padding: 8px 15px;
  margin-right: 10px;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.3s, color 0.3s;
}

#category-nav a:hover,
#category-nav a:focus {
  background-color: var(--gold-accent);
  color: var(--dark-wood);
}

/* Esconde a barra de rolagem mas mantém a funcionalidade */
#category-nav::-webkit-scrollbar {
  display: none;
}
#category-nav {
  -ms-overflow-style: none; /* IE e Edge */
  scrollbar-width: none; /* Firefox */
}

/* Estilos para o Modal de Sabores */
#flavor-options {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.flavor-label {
  display: block;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 12px;
  border: 1px solid #555;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.flavor-label input {
  margin-right: 10px;
  transform: scale(1.2);
}
.flavor-label:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
#flavor-confirm-btn {
  width: 100%;
  padding: 10px 20px;
  background-color: var(--gold-accent);
  color: var(--dark-wood);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}

/* Estilo para a lista de sabores na descrição do produto */
.sabores-lista {
  display: inline-block; /* Permite aplicar margem no topo */
  margin-top: 8px;
  font-size: 0.85rem; /* Um pouco menor que a descrição principal */
  color: #b8b8b8; /* Um tom de cinza claro para diferenciar */
  font-style: italic;
}

.sabores-lista strong {
  font-style: normal; /* Tira o itálico do "Sabores:" */
}
