@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #FBF6EE;
  --surface: #FFFFFF;
  --border: #EADFCB;
  --text: #3B2A20;
  --text-muted: #8A7565;
  --text-soft: #5C4A3B;
  --accent: #A6512C;
  --accent-soft: #FFF9EF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.serif { font-family: 'Fraunces', serif; }

[hidden] { display: none !important; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo-img {
  height: 46px; width: auto; max-width: 120px; object-fit: contain; flex-shrink: 0;
}
.brand-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; line-height: 1.1; }
.brand-tagline { font-size: 12px; color: var(--text-muted); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px;
}
.search-box input { border: none; outline: none; background: transparent; font-size: 14px; color: var(--text); flex-grow: 1; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Grid */
.product-grid {
  padding: 18px 20px 120px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 60vh; /* evita o rodapé "pular" pro meio da tela enquanto carrega */
  max-width: 1100px;
  margin: 0 auto;
}
.product-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.product-photo {
  position: relative; width: 100%; height: auto; aspect-ratio: 1 / 1; background: #C7A96A;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-photo .letter { font-family: 'Fraunces', serif; font-weight: 600; font-size: 44px; color: rgba(255,255,255,.85); }

/* Foto quadrada sem cortar conteúdo: fundo desfocado da própria imagem +
   a imagem inteira por cima, contida no quadrado. */
.photo-square-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: blur(18px) brightness(.82); transform: scale(1.15);
}
.photo-square-fg {
  position: relative; width: 100%; height: 100%;
  object-fit: contain; object-position: center; z-index: 1;
}
.product-body { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.product-cat { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.product-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15px; line-height: 1.25; }
.product-unit { font-size: 12px; color: var(--text-muted); }
.product-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.product-price { font-family: 'Fraunces', serif; font-weight: 700; font-size: 16px; }
.add-btn {
  width: 30px; height: 30px; border-radius: 999px; border: none; background: var(--accent);
  color: var(--bg); font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Cart bar */
.cart-bar {
  position: fixed; left: 20px; right: 20px; bottom: 20px;
  background: var(--text); border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 10px 24px rgba(59,42,32,.28);
}
.cart-bar span { color: var(--bg); }
.cart-bar .count { font-size: 13px; font-weight: 500; }
.cart-bar .total { font-family: 'Fraunces', serif; font-weight: 700; font-size: 15px; }

/* Product detail (modal) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(59,42,32,.4); z-index: 20;
  display: flex; align-items: flex-end;
}
.modal-sheet {
  background: var(--bg); width: 100%; max-height: 90vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding-bottom: 110px; position: relative;
}
.modal-close {
  position: sticky; top: 12px; margin-left: 12px; width: 36px; height: 36px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.modal-gallery-main {
  position: relative;
  width: calc(100% - 40px); margin: -30px auto 0; height: 220px; border-radius: 18px;
  background: #C7A96A; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.modal-thumbs { display: flex; gap: 8px; padding: 8px 20px 0; }
.modal-thumb { position: relative; flex: 1; height: 56px; border-radius: 12px; border: none; overflow: hidden; padding: 0; }
.modal-info { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.modal-note {
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-size: 12px; color: var(--text-soft); line-height: 1.5;
}
.qty-row { display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.qty-control { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.qty-control button { width: 24px; height: 24px; border-radius: 999px; border: none; background: #F1E7D6; color: var(--text); font-size: 16px; }
.add-to-cart-btn {
  flex-grow: 1; background: var(--accent); border-radius: 12px; padding: 12px; border: none;
  color: var(--bg); font-size: 14px; font-weight: 600;
}

@media (max-width: 380px) {
  .product-grid { gap: 10px; }
}

@media (min-width: 860px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topbar > * { max-width: 1100px; margin-left: auto; margin-right: auto; width: 100%; }
}

/* Rodapé */
.site-footer {
  background: #0E2A1B;
  padding: 40px 24px calc(110px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 12px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { width: 96px; height: auto; object-fit: contain; }
.footer-store-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 18px; color: #F4EFE4; }
.footer-tagline { font-size: 13px; color: #B9C9BC; }

.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-heading { font-family: 'Fraunces', serif; font-weight: 600; font-size: 14px; color: #D9A64E; }
.footer-line { font-size: 13px; color: #CBD6CD; line-height: 1.5; display: block; }
a.footer-line:hover { color: #F4EFE4; }
.footer-legal { font-size: 11px; color: #8FA096; line-height: 1.5; margin-top: 2px; }

@media (min-width: 640px) {
  .site-footer {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .footer-brand { flex-basis: 100%; flex-direction: row; align-items: center; gap: 16px; }
}

/* WhatsApp — botão flutuante padrão, pra tirar dúvidas (separado do carrinho) */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: bottom .15s ease;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.28));
}
.whatsapp-float-img { width: 100%; height: 100%; object-fit: contain; }
.whatsapp-float.acima-carrinho {
  bottom: 96px;
}
