/* Recomendado para evitar cálculos estranhos com padding */
*, *::before, *::after { box-sizing: border-box; }

/* ===== Gallery Section ===== */
.gallery-section {
  background: #ffffff;
  padding: 80px 20px;
  overflow: hidden;
  position: relative;
}

.gallery-title {
  text-align: center;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 40px;
  color: #000;
  letter-spacing: 2px;
}

/* Carrossel */
.gallery-carousel {
  --per-view: 3;      /* default desktop: 3 por vez */
  --gap: 15px;
  overflow: hidden;
  position: relative;
  max-width: 85%;     /* deixa área branca nas laterais (onde ficam as setas) */
  margin: 0 auto;
}

.gallery-track {
  display: flex;
  gap: var(--gap);    /* usamos gap no lugar de margin-right */
  transition: transform 0.6s ease;
  will-change: transform;
}

.gallery-item {
  /* Largura calculada para caber exatamente --per-view itens, descontando o gap */
  flex: 0 0 calc((100% - (var(--gap) * (var(--per-view) - 1))) / var(--per-view));
  height: 400px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}

.gallery-item:hover img { transform: scale(1.05); }

/* Responsividade: 2 por vez em telas médias */
@media (max-width: 1024px) {
  .gallery-carousel { --per-view: 2; }
}

/* Responsividade: 1 por vez no celular (fim da "meia imagem") */
@media (max-width: 768px) {
  .gallery-carousel { --per-view: 1; max-width: 92%; } /* ainda deixa uma borda branca */
  .gallery-item { height: 320px; } /* opcional: reduz altura no mobile */
}

/* Botões do carrossel */
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  color: #000;
  font-size: 3rem;
  border: none;
  cursor: pointer;
  z-index: 1000;
  padding: 0 10px;
  opacity: 0.6;
  transition: opacity 0.3s, transform 0.2s;
}

.gallery-btn:hover { opacity: 1; transform: translateY(-50%) scale(1.1); }
.gallery-btn.prev { left: 20px; }   /* ficam na área branca */
.gallery-btn.next { right: 20px; }

/* Lightbox (inalterado) */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex; justify-content: center; align-items: center;
  z-index: 2000; flex-direction: column;
}
.lightbox img {
  max-width: 85%; max-height: 80%;
  border-radius: 8px; margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.lightbox-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; color: #fff; border: none; font-size: 3rem;
  cursor: pointer; z-index: 2100; opacity: 0.7;
  transition: opacity 0.3s, transform 0.2s;
}
.lightbox-btn:hover { opacity: 1; transform: translateY(-50%) scale(1.1); }
.lightbox-btn.prev { left: 30px; }
.lightbox-btn.next { right: 30px; }
