/* ===== reset básico ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f9f6f2;
  color: #333;
  line-height: 1.5;
  padding: 20px;
}

/* container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
  overflow: hidden;
}

/* header */
header {
  background: linear-gradient(135deg, #849E65 0%, #A6956D 100%);
  color: #fff;
  padding: 26px;
  text-align: center;
  position: relative;
}

.back-link {
  position: absolute;
  left: 18px;
  top: 18px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.logo {
  position: absolute;
  right: 18px;
  top: 10px;
}

.logo img {
  height: 86px;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

h1 {
  font-size: 28px;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  opacity: .95;
}

/* filtros */
.menu-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: #f5f0e6;
}

.category-btn {
  padding: 8px 16px;
  border: 2px solid #849E65;
  background: #fff;
  border-radius: 24px;
  color: #849E65;
  font-weight: 700;
  cursor: pointer;
}

.category-btn.active,
.category-btn:hover {
  background: #849E65;
  color: #fff;
}

/* conteúdo */
.menu-content {
  padding: 28px;
}

.category-title {
  color: #849E65;
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #EAA8B4;
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.item {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eee;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
}

.item img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  background: #fafafa;
  border-bottom: 3px solid #EAA8B4;
}

.item-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-content h4 {
  color: #849E65;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.meta .weight {
  font-size: .9rem;
  color: #666;
}

.meta .price {
  margin-left: auto;
  font-weight: 800;
  color: #333;
}

.tags {
  margin-bottom: 8px;
}

.tag {
  display: inline-block;
  background: #f0e8d8;
  color: #A6956D;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 12px;
  margin-right: 6px;
}

.short-desc {
  color: #666;
  font-size: .95rem;
  flex: 1;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  gap: 8px;
}

.add-btn,
.info-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.add-btn {
  background: #25d366;
  color: #fff;
  font-weight: 700;
}

.info-btn {
  background: #fff;
  border: 1px solid #ddd;
  color: #333;
}

/* footer */
footer {
  margin-top: 30px;
  text-align: center;
  padding: 18px;
  background: #333;
  color: #fff;
  border-radius: 0 0 12px 12px;
}

/* modal imagens */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

.image-modal.open {
  display: flex;
}

.close-modal {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 2rem;
  color: #fff;
  text-decoration: none;
}

/* carrinho flutuante */
.cart-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
}

.cart-toggle {
  background: #fff;
  border: 0;
  padding: 12px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  cursor: pointer;
  font-size: 18px;
}

#cart-count {
  background: #ff3b30;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 6px;
  font-weight: 700;
}

/* sidebar */
.cart-sidebar {
  position: fixed;
  right: 18px;
  bottom: 72px;
  width: 340px;
  max-width: 90vw;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
}

.cart-sidebar.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}

.cart-items {
  max-height: 320px;
  overflow: auto;
  padding: 6px;
}

.cart-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #f2f2f2;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item .ci-info {
  flex: 1;
}

.cart-item .ci-info h5 {
  font-size: 14px;
  margin-bottom: 6px;
}

.cart-item .ci-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.qty-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.cart-footer {
  padding: 8px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-total {
  font-weight: 800;
  font-size: 1.05rem;
}

#cart-note {
  width: 100%;
  min-height: 56px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
}

.send-whatsapp {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* whatsapp float */
.whatsapp-float {
  position: fixed;
  bottom: 18px;
  left: 18px;
  background: #25d366;
  color: #fff;
  padding: 12px;
  border-radius: 50%;
  font-size: 18px;
  z-index: 1100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  text-decoration: none;
}

/* responsivo */
@media (max-width: 768px) {
  .menu-categories {
    gap: 8px;
    padding: 12px;
  }

  /* AJUSTE DO CABEÇALHO PARA CELULAR */
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
  }

  .back-link {
    position: static;
    margin-bottom: 15px;
    font-size: 14px;
    /* Coloca o link no topo ou acima do logo */
    order: -2;
  }

  .logo {
    position: static;
    margin-bottom: 10px;
    /* Coloca o logo logo abaixo do link (ou acima de tudo se preferir ordem diferente) */
    order: -1;
  }

  .logo img {
    height: 75px;
  }

  h1 {
    margin-top: 0;
    font-size: 24px;
    line-height: 1.2;
  }
  /* FIM DO AJUSTE */

  .item img {
    height: 180px;
  }

  .cart-sidebar {
    right: 12px;
    left: 12px;
    bottom: 80px;
    width: auto;
    max-width: calc(100% - 24px);
  }
}