:root {
  --accent: #0d3a7f;
  --text: #111;
  --muted: #666;
  --bg: #fff;
  --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  --radius: 0;
  font-family: "Google Sans", "Product Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ...existing styles... */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #ffffff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-style: italic;
}

.wrap {
  max-width: 920px;
  margin: 28px auto;
  padding: 6px;
}

/* header */
.header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
  position: relative;
}

/* add a tiled background limited to a fixed height (set by JS via --header-bg-h) */
.header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--header-bg-h, 90px);
  background-image: url('/pizza_bg.png');
  background-repeat: repeat; /* ensure the image tiles across the header area */
  background-size: auto; /* keep natural tile sizing, allow JS to control height */
  background-position: top center;
  z-index: 0;
  pointer-events: none;
}

/* ensure header content sits above the background */
.header > * {
  position: relative;
  z-index: 1;
}

.logo {
  width: 267px;
  height: auto;
  display: block;
  object-fit: contain;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: #0000005e 6px 5px 20px 0px;
  border-radius: 149px;
}

.header h1 {
  font-size: 3.15rem;
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* compact grouped list */
.menu-card {
  background: var(--bg);
  /* removed border-radius */
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  width: -webkit-fill-available;
}

/* category header */
.category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0d3a7f;
  color: white;
  margin: 0;
  width: 100%;
}

/* small tipo label placed before category name */
.cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-logo {
  width: 40px;
  height: 40px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
  flex-shrink: 0;
  display: block;
  vertical-align: middle;
}

.type-small {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: capitalize;
  color: #e6f0ff;
  margin-right: 4px;
}

.category h2 {
  font-size: 25px;
  margin: 0;
  color: #fff;
  font-weight: 300;
}

.category small {
  color: #ffffff8c;
  font-size: 0.85rem;
  font-weight: 100;
}

/* download button styling */
.download-cat {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px;
  /* removed border-radius */
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.download-cat svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* loading state shows subtle spinner via rotation of svg */
.download-cat.loading {
  opacity: 0.85;
  pointer-events: none;
}

.download-cat.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* compact table rows */
.items {
  width: 100%;
  border-collapse: collapse;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 201px;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px dashed #ccc;
}

.item-row:last-child {
  border-bottom: 0;
}

.item-name {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.1;
  color: #0d3a7f;
  font-weight: 600;
}

.item-ingredients {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.item-price {
  font-size: 0.95rem;
  text-align: right;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* price grid boxes */
.price-box {
  background: #fff;
  /* border: 1px solid #f0f0f0; */
  padding: 6px 10px;
  /* removed border-radius */
  /* min-width:56px; */
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  font-weight: 600;
  color: #0d3a7f;
  /* display:flex; */
  align-items: center;
  /* gap:8px; */
  background: #e5e7ebb8;
  flex-direction: row;
  text-align: center;
  /* border-bottom: 2px solid #0d3a7f45; */
}

.price-box small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin: 0;
  padding: 0 6px;
  background: transparent;
  border-radius: 4px;
}

.price-single {
  /* background:linear-gradient(180deg,rgba(211,47,47,0.06),transparent); */
  /* border-color:rgba(211,47,47,0.12); */
  padding: 6px 6px;
}

/* empty / error */
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

/* footer */
.footer {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 6px;
  margin: 8px 0;
  justify-content: space-around;
}

/* allow toolbar to be hidden via .hidden */
.toolbar.hidden {
  display: none;
}

/* visible toggle button in header */
.toolbar-toggle {
  margin-top: 6px;
  padding: 6px 10px;
  /* removed border-radius */
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(13,58,127,0.12);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  align-self: flex-end; /* alinhado à direita */
  opacity: 0.9;
  box-shadow: none;
}

/* Layout padrão para telas de celular (uma coluna) */
#menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}



.whatsapp-cta {
  display: flex;
  justify-content: center;
  padding: 18px 0;
}

.whatsapp-btn {
  background: #208d49;
  color: #fff;
  padding: 10px 16px;
  /* removed border-radius */
  border: none;
  font-weight: 700;
  display: inline-flex;
  gap: 10px;
  align-items: center; 
  cursor: pointer;
  text-decoration: none;
}

.whatsapp-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Estilos para telas de desktop (duas colunas) */  
@media (min-width: 768px) {
  #menu {
    /* O `column-count` fará com que o conteúdo flua como em colunas de jornal */
    column-count: 2;
    column-gap: 20px;
    display: block; /* Desativa o flexbox para usar as colunas */
  }
  /* Garante que os itens de menu não quebrem e mantenham a fluidez */
  .menu-card {
    /* display: inline-block; */
    width: 100%;
    margin-bottom: 20px;
  }
}

.tool-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #eee;
  /* removed border-radius */  
  background: #fafafa;
}

.tool-select {
  padding: 8px 10px;
  border: 1px solid #eee;
  /* removed border-radius */
  background: #fff;
}

.tool-btn {
  padding: 8px 10px;
  /* removed border-radius */
  border: 1px solid #eee;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  height: -webkit-fill-available;
}

.tool-toggle {
  display: none; /* kept for compatibility if referenced elsewhere */
}

.backtopo {
    width: 100%;
    height: 170px;
    position: relative;
    top: -34px;
    margin-bottom: -179px;
    background-image: url('/pizza_bg.png');
    background-size: 911px; /* slightly smaller tile so pattern repeats pleasantly */
    background-position: 0px center;
    background-repeat: repeat; /* make the small .backtopo area tile */
}

/* responsive */
@media (max-width: 520px) {
  .wrap {
    /* padding:12px; *//* margin:12px; */
  }
  .header {
    gap: 6px;
  }
  /* remove header tiled background on small screens */
  .header::before { 
    display: none;
  }
  .logo {
    width: 135px;
    border-radius: 80px;
    box-shadow: #0000002e 6px 6px 8px 0px;
  }
  .item-row {
    grid-template-columns: 1fr auto;
    padding: 9px 15px;
    align-items: center;
  }
  .category h2 {
    font-size: 24px;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .tool-input {
    flex-basis: 100%;
  }
  .tool-select {
    flex-basis: 48%;
    /* min-width:120px; */
  }
  .tool-btn {
    flex-basis: 48%;
  }
  .item-price {
    gap: 6px;
  }
  .price-box {
    padding: 6px 8px;
    font-size: 0.88rem;
    min-width: 44px;
  }
  .backtopo {
    height: var(--header-bg-h, 135px);
    /* top: 0; */
    margin-bottom: 0;
    /* background-size: auto; */
    margin-bottom: -109px;
  }
}