/* ========================================================
   PORTFOLIO PAGE STYLES - GGRL GENERAL SERVICES
   (Optimizado con Rendimiento Driveways - Cero Lag)
   ======================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.portfolio-section {
  padding: 6rem 5%;
  background: #f8f9fa;
  text-align: center;
}

.portfolio-section h2 {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3rem;
}

/* Cuadrícula principal */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.portfolio-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  cursor: pointer;
  height: 380px; 
  background: #fff;
  /* Aceleración de hardware básica y limpia (Estilo Driveways) */
  transform: translateZ(0); 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* ========================================================
   MARCO FACEBOOK (Ultra rápido, sin filtros extra)
   ======================================================== */
.fb-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  width: 100%;
  height: 100%;
  background-color: #fff; 
}

.fb-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Animación simple (Estilo Driveways) */
  transition: transform 0.4s ease;
}

.portfolio-item:hover .fb-collage img {
  transform: scale(1.03); /* Zoom muy ligero y rápido */
}

.fb-collage img:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.fb-collage img:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
.fb-collage img:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }

/* ========================================================
   OVERLAY DE TEXTO (Motor Driveways)
   ======================================================== */
.portfolio-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.5rem;
  background: linear-gradient(transparent, rgba(19, 72, 102, 0.95));
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.portfolio-item:hover .portfolio-overlay {
  transform: translateY(0);
}

/* Textos estáticos para evitar saturación de frames */
.portfolio-overlay h3 { 
  font-size: 1.4rem; 
  margin-bottom: 0.5rem; 
}

.view-photos { 
  font-size: 1rem; 
  opacity: 0.9; 
}

/* ========================================================
   MODAL / LIGHTBOX
   ======================================================== */
.portfolio-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 9999; align-items: center; justify-content: center; padding: 2rem; }
.portfolio-modal.active { display: flex; }
#modalImage { max-width: 95%; max-height: 85vh; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal-close { position: absolute; top: 30px; right: 40px; background: none; border: none; color: white; font-size: 3rem; cursor: pointer; z-index: 10; }
.modal-prev, .modal-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); color: white; border: none; width: 60px; height: 60px; font-size: 2.5rem; border-radius: 50%; cursor: pointer; backdrop-filter: blur(10px); transition: all 0.3s; }
.modal-prev { left: 30px; }
.modal-next { right: 30px; }
.modal-prev:hover, .modal-next:hover { background: var(--accent); transform: scale(1.1); }
.modal-counter { position: absolute; bottom: 30px; background: rgba(0,0,0,0.6); color: white; padding: 0.6rem 1.2rem; border-radius: 30px; font-weight: 600; }

/* ========================================================
   RESPONSIVE MÓVIL
   ======================================================== */
@media (max-width: 768px) {
  .portfolio-item { height: 320px; }
  .portfolio-overlay { transform: translateY(0); padding: 1.5rem 1rem; background: linear-gradient(transparent, rgba(19,72,102,0.9)); }
  .portfolio-overlay h3 { font-size: 1.35rem; }
  .portfolio-modal #modalImage { max-height: 78vh; }
}

/* ========================================================
   SISTEMA DE PAGINACIÓN - GGRL GENERAL SERVICES
   ======================================================== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 5rem;
}

.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.3, 1);
  /* Aceleración de hardware limpia */
  transform: translateZ(0); 
}

.page-num:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  color: var(--primary);
}

.page-num.active {
  background: var(--accent);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(255, 79, 90, 0.3);
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 1.8rem;
  height: 45px;
  border-radius: 30px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.3, 1);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.page-btn:hover {
  background: #0d324a;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  color: #fff;
}

.page-btn.disabled {
  background: #e0e0e0;
  color: #999;
  pointer-events: none;
  box-shadow: none;
}

/* Ajustes para pantallas pequeñas (Celulares) */
@media (max-width: 480px) {
  .pagination-container {
    gap: 8px;
  }
  .page-num {
    width: 40px;
    height: 40px;
  }
  .page-btn {
    padding: 0 1.2rem;
    font-size: 0.85rem;
  }
}