:root {
  --primary: #d32f2f; /* Vermelho intenso */
  --primary-dark: #b71c1c;
  --secondary: #ffb300; /* Amarelo/Dourado */
  --secondary-dark: #ff8f00;
  
  --bg: #121212; /* Fundo grafite escuro/preto */
  --surface: #1e1e1e; /* Superfícies */
  --surface-light: #2c2c2c; 
  
  --text-light: #ffffff; /* Textos e títulos */
  --text: #ffffff;
  --text-dim: #a0a0a0; /* Textos secundários */
  --text-dark: #121212; 
  
  --success: #43a047;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-light);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-light);
  border-radius: 10px;
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text-light);
}

/* HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #121212;
  height: 64px; /* Header compacto */
  padding: 0 8px; /* Reduzido padding lateral no mobile para dar mais espaço */
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px; /* Espaço flexível otimizado */
}

/* 1. BRAND AREA */
.brand-area {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-img-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface);
}

.brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0; /* Permite truncar text-overflow */
}

.brand-main {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.5rem, 2.1vw, 0.75rem); 
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.brand-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.45rem, 1.8vw, 0.65rem);
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  margin-left: 4px; /* sutil */
}

.brand-ampersand {
  color: var(--secondary);
}

/* 2. NAVIGATION */
.header-nav {
  display: flex;
  gap: clamp(4px, 1.5vw, 12px);
  align-items: center;
  flex-shrink: 0; /* Não deixar encolher e quebrar */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-dim);
  font-size: clamp(0.55rem, 1.8vw, 0.65rem);
  font-weight: 600;
  gap: 3px;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item i {
  font-size: clamp(1.1rem, 3.5vw, 1.3rem);
}

.nav-item.active {
  color: var(--text-light);
}

.nav-item.active i {
  color: var(--secondary);
}

.nav-item.active span {
  position: relative;
}

.nav-item.active span::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--secondary);
  border-radius: 2px;
}

/* 3. ACTIONS (CART & MENU) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.cart-toggle {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  position: relative;
  cursor: pointer;
}

.cart-toggle i {
  font-size: 1.4rem;
}

.cart-toggle:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.cart-count {
  position: absolute;
  top: 0px;
  right: -2px;
  background: var(--primary);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #121212;
}

.menu-toggle {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
}

.menu-toggle i {
  font-size: 1.5rem;
}

/* HERO */
.hero {
  position: relative;
  width: 100%;
  padding-top: 50%; /* Melhor proporção para não cortar textos no mobile */
  background: linear-gradient(to bottom, rgba(18,18,18,0.1) 0%, rgba(18,18,18,0.8) 100%), url('../images/novo_hero_banner.jpg') center/cover no-repeat;
  background-color: var(--surface);
}

@media (min-width: 768px) {
  .hero {
    padding-top: 32%; /* Ajuste desktop */
  }
}


/* INFO SECTION (Área de Endereço e Status) */
.info-section {
  background: var(--surface);
  margin: -35px 16px 20px 16px; /* Flutua acima do hero */
  padding: 16px;
  border-radius: 16px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
}

.info-address {
  font-size: 0.95rem;
  color: var(--text-light);
}

.info-badges {
  /* Scroll horizontal limpo em celulares finos */
  scrollbar-width: none;
}
.info-badges::-webkit-scrollbar {
  display: none;
}

.info-badge {
  /* Estilos in-line controlados no HTML */
}

/* CATEGORY NAV */
.category-nav {
  /* Não é mais sticky para fluir naturalmente com o cardápio */
  background-color: transparent;
  padding: 16px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-card-btn {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  width: 90px;
  height: 96px;
  border-radius: 16px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.cat-card-btn:active {
  transform: scale(0.95);
}

.cat-card-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-dim);
  transition: all 0.2s;
}

.cat-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-dim);
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 90%;
  white-space: nowrap;
}

.cat-chevron {
  display: none; /* Mantido no HTML mas escondido no CSS por limpeza visual */
}

.cat-card-btn.active {
  border: 1px solid var(--secondary);
  background: rgba(255, 179, 0, 0.05);
}

.cat-card-btn.active .cat-card-icon {
  background: transparent;
}
.cat-card-btn.active .cat-card-icon i {
  color: var(--secondary); /* Destaque amarelo */
}

.cat-card-btn.active .cat-card-title {
  color: var(--text-light);
}

/* MENU LAYOUT */
.menu-container {
  padding: 16px;
  padding-bottom: 120px; /* Space for floating cart */
  max-width: 1200px;
  margin: 0 auto;
}

.category-section {
  margin-bottom: 2.5rem;
}

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

.category-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-header-title i {
  font-size: 1.8rem;
  color: var(--primary);
  background: rgba(211, 47, 47, 0.1); /* Fundo vermelho bem sutil */
  padding: 8px;
  border-radius: 50%;
}

.category-header-title h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  color: var(--text-light);
  font-weight: 800;
  letter-spacing: -0.2px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 colunas travadas no mobile */
  gap: 10px; /* Gap estreito para não espremer conteúdo em 320px */
}

@media (min-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

/* PRODUCT CARDS */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  min-width: 0; /* Previne overflow */
}

.product-card:active {
  transform: scale(0.96);
}

.product-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 12;
  background-color: var(--surface-light);
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.product-name {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.7rem, 3.5vw, 0.95rem);
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: clamp(0.6rem, 2.8vw, 0.75rem);
  color: var(--text-dim);
  line-height: 1.3;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-action-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.product-price {
  font-size: clamp(0.9rem, 4vw, 1.15rem);
  font-weight: 800;
  color: var(--secondary); /* Amarelo/Dourado */
  line-height: 1;
}

.pizza-price {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

.add-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: clamp(0.7rem, 3vw, 0.85rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.cart-btn-icon {
  font-size: 1.1rem;
}

/* FLOATING CART SUMMARY (BOTTOM) */
.cart-floating-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: var(--surface-light);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 600px;
  margin: 0 auto;
}
.cart-floating-bar.visible {
  transform: translateY(0);
}

.cart-summary-text {
  display: flex;
  flex-direction: column;
}
.cart-total-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
}

.checkout-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: bold;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(5px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end; /* Bottom sheet */
  justify-content: center;
}
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center; /* Centralizado no desktop */
  }
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border-top: 1px solid var(--surface-light);
}
@media (min-width: 768px) {
  .modal-content {
    border-radius: 24px;
    border: 1px solid var(--surface-light);
  }
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--surface-light);
  padding-bottom: 16px;
}
.modal-title {
  font-size: 1.3rem;
  color: var(--text-light);
  font-weight: 700;
}

.close-modal {
  background: var(--surface-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PIZZA MODAL SPECIFICS */
.size-selector, .flavor-selector {
  margin-bottom: 24px;
}
.section-title {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--secondary);
  font-weight: 600;
}

.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkbox-group {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
}

.radio-label, .checkbox-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--surface-light);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}
.checkbox-label {
  justify-content: flex-start;
  gap: 16px;
}

.radio-label.selected, .checkbox-label.selected {
  border-color: var(--primary);
  background: rgba(211, 47, 47, 0.05);
}
.radio-label span.price {
  color: var(--secondary);
  font-weight: bold;
}
.checkbox-label.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.checkbox-label input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

.btn-block {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.btn-block:disabled {
  background: var(--surface-light);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* CART MODAL SPECIFICS */
.cart-items {
  margin-bottom: 24px;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--surface-light);
}
.cart-item-details {
  flex: 1;
  padding-right: 12px;
}
.cart-item-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-light);
}
.cart-item-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
  margin-bottom: 8px;
}
.cart-item-price {
  color: var(--secondary);
  font-weight: bold;
  font-size: 1.1rem;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-light);
  border-radius: 20px;
  padding: 6px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}
.qty-btn.remove {
  color: var(--primary);
}

.empty-cart {
  text-align: center;
  padding: 50px 0;
  color: var(--text-dim);
  font-size: 1.1rem;
}

/* CHECKOUT MODAL SPECIFICS */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: var(--surface-light);
  border: 1px solid #3a3a3a;
  color: var(--text-light);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #2a2a2a;
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* TOAST ANIMATION */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface-light);
  color: var(--text-light);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--success);
  animation: slideDown 0.3s ease-out forwards;
}
.toast.hide {
  animation: fadeOut 0.3s ease-in forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* CLOSED POPUP */
.closed-popup {
  text-align: center;
  padding: 20px 0;
}
.closed-popup h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.5rem;
}
.closed-popup p {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* SPLASH SCREEN */
.splash-svg {
  width: 150px; /* Reduzido e modernizado para mobile-first */
  height: auto;
}
.splash-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(211,47,47,0.3) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
}

/* FOOTER - PRESERVED STYLES */
/* O footer original em index.php usa tags <style> inline, então deixamos o CSS base aqui por precaução */

/* SIDEBAR DRAWER */
.sidebar-drawer {
  max-width: 300px;
  margin-left: auto;
  margin-right: 0;
  height: 100vh;
  border-radius: 20px 0 0 20px;
  animation: slideLeft 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  padding-bottom: 30px;
}
.sidebar-btn {
  width: 100%;
  background: var(--surface-light);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-light);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: transform 0.2s, background 0.2s;
}
.sidebar-btn:active {
  transform: scale(0.98);
  background: rgba(255,255,255,0.1);
}
.sidebar-btn i {
  font-size: 1.4rem;
  color: var(--primary);
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
