/* ---- Página de Portfólio ---- */

/* Banner */
.pf-banner {
  background: linear-gradient(135deg, #0077be 0%, #005a99 55%, #003d6b 100%);
  padding: 3.5rem 5vw 3rem;
  text-align: center;
  color: #fff;
}

.pf-banner h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.pf-banner p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

/* Section */
.pf-section {
  padding: 2.5rem 0 3rem;
  background: #f5f7fa;
}

.pf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.pf-count {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
  text-align: right;
}

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

/* Gallery card */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #1a2332;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  aspect-ratio: 4 / 3;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s ease, opacity 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
  opacity: 0.82;
}

/* Overlay sobe a partir do fundo */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.1rem;
  transition: background 0.3s ease;
}

.gallery-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: translateY(4px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-title {
  transform: translateY(0);
}

.gallery-count {
  display: inline-block;
  margin-top: 0.3rem;
  background: rgba(0,119,190,0.85);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 50px;
  font-weight: 500;
  align-self: flex-start;
}

/* Ícone de zoom (canto superior direito) */
.gallery-zoom {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  background: rgba(0,0,0,0.42);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
}

.gallery-item:hover .gallery-zoom {
  opacity: 1;
}

/* Estado vazio */
.pf-empty {
  text-align: center;
  padding: 4rem 0;
  color: #6c757d;
}

.pf-empty p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* CTA */
.pf-cta {
  background: linear-gradient(135deg, #0077be 0%, #003d6b 100%);
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
}

.pf-cta h2 {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.pf-cta p {
  color: rgba(255,255,255,0.88);
  font-size: 1.05rem;
  margin-bottom: 1.6rem;
}

/* ---- Modal ---- */
.popup-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  animation: fadeInModal 0.25s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.popup-modal.active {
  display: flex;
}

.popup-content {
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Header do modal */
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.service-title {
  color: #fff;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.popup-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}

.popup-close:hover {
  background: rgba(220,53,69,0.7);
  border-color: #dc3545;
}

.popup-close:focus {
  outline: none;
}

/* Slider */
.slider-container {
  position: relative;
  width: 100%;
}

.slider-image {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
  padding: 0;
}

.slider-btn:hover {
  background: rgba(0,119,190,0.7);
  border-color: #0077be;
  transform: translateY(-50%) scale(1.1);
}

.slider-btn:focus {
  outline: none;
}

.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }

.slider-counter {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  letter-spacing: 1px;
  font-family: monospace;
  backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
  }

  .slider-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .slider-btn.prev { left: 6px; }
  .slider-btn.next { right: 6px; }
}
