:root {
  --pico-primary: #234d20;
  --pico-primary-hover: #1a3818;
  --pico-primary-background: #234d20;
  --pico-primary-underline: #77ab59;
  --pico-primary-focus: rgba(119, 171, 89, 0.5);
  --lojinha-verde-escuro: #234d20;
  --lojinha-verde-claro: #77ab59;
}

body {
  background: #72ae95;
  color: #111111;
}

/* Paleta é fixa (preto/branco/verde) — não seguimos o dark mode automático do Pico */
h1, h2, h3, h4, h5, h6 {
  color: #111111;
}

header.container {
  padding-top: 2rem;
  text-align: center;
}

header.container p {
  color: #444444;
}

#subtitulo {
  white-space: pre-line;
}

main.container {
  padding-bottom: 3rem;
}

.erro {
  color: #b00020;
  border: 1px solid #b00020;
  border-radius: 0.5rem;
  padding: 1rem;
}

.lista-itens {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  display: grid;
  grid-template-columns: minmax(7rem, 30%) 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #e0e0e0;
  align-items: start;
}

.item:last-child {
  border-bottom: none;
}

.item-fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.25rem;
  aspect-ratio: 1 / 1;
}

/* Quando há só 1 foto (ou placeholder), ocupa a célula toda */
.item-fotos.fotos-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* Com 2 fotos, empilha em 2 linhas de 1 coluna (como no mockup do último item) */
.item-fotos.fotos-2 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}

.item-foto {
  position: relative;
  overflow: hidden;
  border-radius: 0.375rem;
  background: #f0f0f0;
  cursor: pointer;
  padding: 0;
  border: none;
}

.item-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-foto.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  font-size: 0.75rem;
  cursor: default;
}

.item-foto .overlay-mais {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.item-info h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.15rem;
}

.item-preco {
  color: var(--lojinha-verde-escuro);
  font-weight: bold;
  font-size: 1.05rem;
  margin: 0 0 0.5rem 0;
}

.item-descricao {
  margin: 0 0 0.5rem 0;
  color: #333333;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.lightbox-track::-webkit-scrollbar {
  display: none;
}

.lightbox-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-fechar,
.lightbox-seta {
  position: absolute;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  width: 3rem;
  height: 3rem;
  font-size: 1.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lightbox-fechar {
  top: 1rem;
  right: 1rem;
  z-index: 1001;
}

.lightbox-seta {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-anterior {
  left: 1rem;
}

.lightbox-proxima {
  right: 1rem;
}

.lightbox-seta[hidden] {
  display: none;
}

@media (max-width: 40rem) {
  /* No celular a navegação é por arraste (swipe); as setas ficam escondidas */
  .lightbox-seta {
    display: none;
  }

  .item {
    grid-template-columns: 6rem 1fr;
    gap: 0.75rem;
    padding: 1rem 0;
  }

  .item-info h2 {
    font-size: 1rem;
  }

  .item-descricao {
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
