:root {
  --verde: #2e7d32;
  --verde-escuro: #1b5e20;
  --verde-claro: #a5d6a7;
  --amarelo: #f9a825;
  --cinza-fundo: #f4f6f4;
  --branco: #ffffff;
  --texto: #263238;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--cinza-fundo);
  color: var(--texto);
}

a {
  text-decoration: none;
}

/* HEADER */
header {
  background: linear-gradient(135deg, var(--verde-escuro), var(--verde));
  color: #fff;
  padding: 18px 20px;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.4s ease;
}

header.modo-vet {
  position: sticky;
  background:
    linear-gradient(135deg, rgba(13, 71, 161, 0.88), rgba(25, 118, 210, 0.82)),
    url("https://images.unsplash.com/photo-1628009368231-7bb7cfc7990c?w=1400&q=70") center/cover no-repeat;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6rem;
  font-weight: 800;
}

.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.wa-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tagline {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 300;
}

.whatsapp-header {
  background: #25d366;
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.whatsapp-header:hover {
  transform: scale(1.05);
}

/* HERO */
.hero {
  background: url("https://images.unsplash.com/photo-1500595046743-cd271d694d30?w=1400&q=60") center/cover no-repeat;
  position: relative;
  padding: 60px 20px;
  text-align: center;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 94, 32, 0.75);
}

.hero.modo-vet {
  background: url("https://i.ibb.co/0j4Z3tNV/banner.png") center/100% 100% no-repeat;
  padding: 0;
  min-height: 220px;
}

.hero.modo-vet::before {
  background: transparent;
}

.hero.modo-vet h1,
.hero.modo-vet p {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.95;
}

/* BUSCA */
.busca-wrapper {
  max-width: 700px;
  margin: -25px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 5;
}

#busca {
  width: 100%;
  padding: 15px 20px;
  border-radius: 30px;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  outline: none;
}

#busca:focus {
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
}

/* ABAS DE CATEGORIA */
.tabs-wrapper {
  max-width: 1200px;
  margin: 22px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab {
  background: #fff;
  border: 2px solid var(--verde-claro);
  color: var(--verde-escuro);
  padding: 9px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab:hover {
  border-color: var(--verde);
}

.tab.active {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}

/* CONTADOR */
.contador {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 20px;
  font-size: 0.95rem;
  color: #555;
}

/* GRID DE PRODUTOS */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.card {
  background: var(--branco);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-img {
  width: 100%;
  height: 180px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
}

.card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 42px;
  margin-bottom: 10px;
  color: var(--texto);
}

.card-preco {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--verde);
  margin-bottom: 12px;
  margin-top: auto;
}

.btn-comprar {
  background: var(--verde);
  color: #fff;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-comprar:hover {
  background: var(--verde-escuro);
}

.sem-resultado {
  text-align: center;
  padding: 60px 20px;
  color: #777;
  font-size: 1.1rem;
  display: none;
}

/* BOTÃO VOLTAR AO TOPO */
#topo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--amarelo);
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 90;
}

#topo.show {
  opacity: 1;
  pointer-events: auto;
}

/* FOOTER */
footer {
  background: var(--verde-escuro);
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  margin-top: 40px;
}

footer p {
  margin: 6px 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

footer .footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* RESPONSIVO */
@media (max-width: 600px) {
  .hero {
    background: url("https://images.unsplash.com/photo-1500595046743-cd271d694d30?w=1400&q=60") center/cover no-repeat;
    position: relative;
    padding: 0px 0px 30px 0px;
    text-align: center;
    color: #fff;
  }

  header.modo-vet {
    padding: 0px 20px;
  }

  .hero.modo-vet {
    background: url("https://i.ibb.co/LXjKpQLC/veterinario.png") center/100% 100% no-repeat;
    position: relative;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .logo {
    font-size: 1.3rem;
  }

  .logo-img {
    width: 38px;
    height: 38px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .card-img {
    height: 140px;
  }

  .tabs {
    gap: 8px;
  }

  .tab {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
}