@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400..700;1,6..72,400..700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --primary: #851f18;
  --primary-container: #a6372d;
  --primary-fixed: #ffdad5;
  --on-primary: #ffffff;
  --on-primary-container: #ffcbc4;
  
  --secondary: #56633e;
  --secondary-container: #d7e5b7;
  --on-secondary: #ffffff;
  --on-secondary-container: #1b2609;
  
  --tertiary: #6c3900;
  --tertiary-container: #ffcea7;
  --on-tertiary: #ffffff;
  
  --surface: #fcf9f8;
  --surface-low: #f6f3f2;
  --surface-container: #f0eded;
  --surface-container-high: #eae7e7;
  --surface-lowest: #ffffff;
  
  --on-surface: #1b1c1c;
  --on-surface-variant: #57413f;
  --outline: #8b716e;
  --outline-variant: #debfbb;
  
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Container responsivo */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--surface);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  body {
    background: #f7f4f0 linear-gradient(180deg, #f2ece4 0%, #f7f4ef 100%);
    background-attachment: fixed;
  }

  .app-container {
    max-width: 1120px;
    box-shadow: 0 10px 40px rgba(74, 45, 23, 0.08);
    border-left: 1px solid var(--surface-container-high);
    border-right: 1px solid var(--surface-container-high);
    background-color: #ffffff;
  }

  .app-header {
    padding: 16px 32px;
  }

  .bottom-nav {
    max-width: 1120px;
    border-left: 1px solid var(--surface-container-high);
    border-right: 1px solid var(--surface-container-high);
    padding: 10px 32px 14px 32px;
    background-color: rgba(255, 255, 255, 0.98);
  }

  .homologacao-banner {
    margin: 16px 32px;
  }

  .content-section-padded {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }

  /* Carrossel de Banners no PC: exibição lado a lado em cards generosos */
  .carousel-container {
    padding: 8px 32px 16px 32px;
    gap: 20px;
    overflow-x: visible;
  }

  .hero-card {
    min-width: calc(50% - 10px);
    max-width: calc(50% - 10px);
    flex: 1;
  }

  /* Pílulas de Categoria no PC */
  .category-pills {
    padding: 8px 32px;
    gap: 8px;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  /* Grid de Produtos: no PC vira grade de 2 a 3 colunas elegante */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 12px 32px 32px 32px;
  }

  .product-card {
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(133, 31, 24, 0.09);
    border-color: var(--primary-fixed-dim);
  }

  .product-thumb {
    width: 104px;
    height: 104px;
  }
}

@media (min-width: 1200px) {
  .app-container {
    max-width: 1240px;
  }

  .bottom-nav {
    max-width: 1240px;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Tipografia */
h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
}

.text-title-xl { font-size: 28px; line-height: 34px; font-weight: 600; }
.text-title-lg { font-size: 22px; line-height: 28px; font-weight: 600; }
.text-title-md { font-size: 18px; line-height: 24px; font-weight: 600; }

.text-body-md { font-size: 14px; line-height: 20px; font-weight: 400; }
.text-body-sm { font-size: 12px; line-height: 16px; font-weight: 400; }

.text-label-lg { font-size: 14px; line-height: 18px; font-weight: 700; }
.text-label-md { font-size: 13px; line-height: 16px; font-weight: 600; }
.text-label-sm { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: 0.5px; }

/* Header Fixo */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(252, 249, 248, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-container-high);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 44px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
  display: block;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-container), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(133, 31, 24, 0.25);
}

.brand-info h1 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* Banner de Homologação StayCloud */
.homologacao-banner {
  margin: 12px 16px 4px 16px;
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  border: 1px solid rgba(86, 99, 62, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.homologacao-banner .icon {
  color: var(--secondary);
  font-size: 20px;
  margin-top: 1px;
}

/* Segmented Control / Abas */
.segmented-control {
  background-color: var(--surface-container);
  padding: 4px;
  border-radius: 12px;
  display: flex;
  gap: 4px;
  margin: 12px 16px;
}

.segmented-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented-btn.active {
  background-color: var(--surface-lowest);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Banners Destaques Carrossel */
.carousel-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 12px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.hero-card {
  min-width: 86%;
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--surface-lowest);
  box-shadow: 0 4px 14px rgba(74, 45, 23, 0.08);
  position: relative;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.hero-image {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27, 28, 28, 0.85) 0%, rgba(27, 28, 28, 0.3) 50%, transparent 100%);
}

.hero-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-text {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  color: #fff;
}

.hero-text span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-fixed);
  font-weight: 600;
}

.hero-text h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

/* Categorias em Pílulas */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
}

.category-pills::-webkit-scrollbar { display: none; }

.pill-btn {
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--surface-container-high);
  background-color: var(--surface-lowest);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(133, 31, 24, 0.3);
}

/* Cards de Produtos */
.products-grid {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  background-color: var(--surface-lowest);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 12px;
  border: 1px solid var(--surface-container);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.product-thumb {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--surface-container);
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.25;
}

.product-info p {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.btn-add {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background-color: var(--primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-add:hover {
  background-color: var(--primary-container);
}

/* Barra de Navegação Inferior Fixa */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  background-color: rgba(252, 249, 248, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--surface-container-high);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px 14px 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--on-surface-variant);
  font-size: 10px;
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}

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

.nav-item .material-symbols-outlined {
  font-size: 22px;
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 16px);
  background-color: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Utilitários Gerais */
.space-bottom {
  padding-bottom: 120px !important;
}

.card-box {
  background-color: var(--surface-lowest);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--surface-container);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: none;
  background-color: var(--primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(133, 31, 24, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Toast */
.toast-msg {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background-color: #1b1c1c;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Cartões de seleção de bebidas — demonstração estática */
.drink-thumb { flex:0 0 86px; width:86px; min-height:86px; border-radius:12px;
  display:flex; justify-content:center; align-items:center; }
.drink-thumb .material-symbols-outlined { font-size:46px; }
.drink-thumb-juice { background:#e7edd9; color:#56633e; }
.drink-thumb-soda { background:#e5eced; color:#436b77; }
.drink-thumb-beer { background:#f6e8d4; color:#98601f; }
.drink-thumb-wine { background:#f4e5e7; color:#851f18; }
.product-card { color:inherit; text-decoration:none; }
.product-card:focus-visible { outline:3px solid var(--secondary); outline-offset:3px; }
