:root {
  --couro: #6B4226;
  --mostarda: #D9A441;
  --oliva: #4B5320;
  --quermesse: #A63A32;
  --creme: #F3E9D2;
  --couro-escuro: #4a2d19;
  --sombra: 0 4px 14px rgba(107, 66, 38, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--creme);
  color: var(--couro-escuro);
  font-family: "Inter", "Nunito", sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: "Fraunces", serif;
  color: var(--couro);
  margin: 0 0 0.4em;
}

.accent {
  font-family: "Caveat", cursive;
  color: var(--quermesse);
}

a { color: inherit; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.topbar {
  background: var(--couro);
  color: var(--creme);
  padding: 18px 0;
  box-shadow: 0 2px 8px rgba(107, 66, 38, 0);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.topbar.rolado { padding: 10px 0; box-shadow: var(--sombra); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.topbar .brand { color: var(--creme); font-size: 1.6rem; margin: 0; text-decoration: none; }
.topbar .tagline { font-family: "Caveat", cursive; font-size: 1rem; color: var(--mostarda); display: block; margin-top: -4px; }
.topbar nav a {
  color: var(--creme);
  text-decoration: none;
  margin-left: 18px;
  font-weight: 600;
  position: relative;
}
.cart-count {
  background: var(--quermesse);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  padding: 1px 6px;
  margin-left: 4px;
  display: inline-block;
  transition: transform 0.2s ease;
}
.cart-count.pulso { animation: contadorPulso 0.4s ease; }
@keyframes contadorPulso {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--couro) 0%, var(--couro-escuro) 100%);
  color: var(--creme);
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(217,164,65,0.05) 0 2px, transparent 2px 20px);
}
.hero h1 { color: #fff; font-size: 2.6rem; position: relative; animation: heroSobe 0.7s ease both; }
.hero p { color: var(--mostarda); font-size: 1.3rem; font-family: "Caveat", cursive; position: relative; margin: 0; animation: heroSobe 0.7s ease 0.15s both; }
@keyframes heroSobe {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner explicativo fechavel */
.banner {
  background: var(--mostarda);
  color: var(--couro-escuro);
  padding: 12px 0;
  text-align: center;
  font-weight: 600;
  position: relative;
}
.banner .container { display: flex; align-items: center; justify-content: center; gap: 12px; }
.banner button.fechar {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--couro-escuro);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.banner.oculto { display: none; }

/* Filtros de categoria */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 30px 0; }
.filtros button {
  background: #fff;
  border: 2px solid var(--couro);
  color: var(--couro);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.filtros button.ativo, .filtros button:hover { background: var(--couro); color: var(--creme); }
.filtros button:active { transform: scale(0.94); }

/* Grid de produtos */
.grid-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin: 30px 0 60px;
}
.card-produto {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s cubic-bezier(.2,.8,.2,1);
  opacity: 0;
  transform: translateY(20px);
}
.card-produto.visivel { opacity: 1; transform: translateY(0); }
.card-produto:hover { transform: translateY(-6px); box-shadow: 0 10px 24px rgba(107, 66, 38, 0.24); }
.card-produto .imagem {
  height: 160px;
  background: var(--creme);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}
.card-produto .imagem img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card-produto:hover .imagem img { transform: scale(1.08); }
.card-produto .gatilho {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  animation: carimbo 0.4s ease-out;
}
@keyframes carimbo {
  0% { transform: scale(1.4) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(-4deg); opacity: 1; }
}
.card-produto .corpo { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-produto h3 { font-size: 1.05rem; margin: 0; }
.card-produto .desc { font-size: 0.85rem; color: #6b5544; flex: 1; }
.card-produto .preco { font-size: 1.3rem; font-weight: 800; color: var(--quermesse); }
.card-produto .preco small { font-size: 0.75rem; font-weight: 400; color: #6b5544; }
.card-produto button.add {
  background: var(--oliva);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s, transform 0.15s;
}
.card-produto button.add:hover { background: #3a4319; }
.card-produto button.add:active { transform: scale(0.97); }
.card-produto button.add:disabled { background: #999; cursor: not-allowed; }
.card-produto button.add.confirmado { background: var(--quermesse); }

/* Skeleton de carregamento */
.skeleton-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sombra);
  height: 300px;
}
.skeleton-card .skeleton-bloco {
  background: linear-gradient(90deg, #eee2cc 25%, #f5ecd9 37%, #eee2cc 63%);
  background-size: 400% 100%;
  animation: skeletonBrilho 1.4s ease infinite;
}
.skeleton-card .skeleton-imagem { height: 160px; }
.skeleton-card .skeleton-linha { height: 14px; margin: 16px 16px 0; border-radius: 4px; }
.skeleton-card .skeleton-linha.curta { width: 60%; }
@keyframes skeletonBrilho {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Botao flutuante WhatsApp */
.whatsapp-flutuante {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  animation: pulso 2.2s infinite;
  z-index: 30;
}
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* Aviso de estoque */
.secao-aviso {
  background: var(--oliva);
  color: var(--creme);
  padding: 40px 0;
  text-align: center;
}
.secao-aviso form { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.secao-aviso input {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  min-width: 220px;
}
.secao-aviso button {
  background: var(--mostarda);
  color: var(--couro-escuro);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

footer {
  background: var(--couro-escuro);
  color: var(--creme);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
}

/* Carrinho lateral */
.carrinho-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; z-index: 40;
}
.carrinho-overlay.aberto { display: block; }
.carrinho-painel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 90vw);
  background: #fff; z-index: 41; padding: 20px; overflow-y: auto;
  transform: translateX(100%); transition: transform 0.25s;
}
.carrinho-overlay.aberto .carrinho-painel { transform: translateX(0); }
.carrinho-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eee; }
.carrinho-item .qtd-controles { display: flex; align-items: center; gap: 6px; }
.carrinho-item .qtd-controles button { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--couro); background: #fff; cursor: pointer; }
.carrinho-total { font-size: 1.2rem; font-weight: 800; margin: 16px 0; display: flex; justify-content: space-between; }
.btn-primario {
  background: var(--quermesse);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-size: 1rem;
}
.btn-primario:hover { background: #8c2f28; }
.btn-primario:disabled { background: #999; cursor: not-allowed; }

/* Forms genericos (checkout/admin) */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--sombra);
  padding: 24px;
  margin: 20px 0;
}
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 0.9rem; }
input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d8c9ae;
  font-family: inherit;
  font-size: 1rem;
}
.erro { color: var(--quermesse); font-weight: 600; margin-top: 8px; }
.sucesso { color: var(--oliva); font-weight: 600; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
th { color: var(--couro); }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; color: #fff; display: inline-block; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: #fff; border: 2px solid var(--couro); color: var(--couro); padding: 8px 16px; border-radius: 30px; cursor: pointer; font-weight: 600; }
.tabs button.ativo { background: var(--couro); color: #fff; }
