/* ===================== */
/* GALERÍA               */
/* ===================== */

.gallery-section {
  padding: 4rem 0 6rem;
  background: #f6f5ef;
}

.gallery-filters {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(192,57,43,0.25);
  background: white;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
  background: #c0392b;
  border-color: #c0392b;
  color: white;
}

/* Grupos */
.gallery-group {
  margin-bottom: 4rem;
}

.gallery-group-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.gallery-group-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #c0392b;
  margin: 0;
  white-space: nowrap;
}

.group-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, rgba(192,57,43,0.3), transparent);
  border-radius: 999px;
}

/* Grid fotos */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}

.gallery-item:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,39,68,0.85) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gallery-title {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.gallery-zoom {
  background: rgba(200,169,107,0.95);
  color: #1a2744;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: 'Inter', sans-serif;
}

.gallery-zoom:hover { transform: scale(1.05); }

/* CTA */
.gallery-cta {
  background: linear-gradient(135deg, #1a2744, #c0392b);
  color: white;
  padding: 5rem 0;
}

.gallery-cta h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  color: white;
  margin: 0 0 1rem;
}

.gallery-cta p {
  color: rgba(255,255,255,0.75);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-box img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.modal-box p {
  padding: 1rem 1.5rem;
  margin: 0;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: rgba(0,0,0,0.8); }

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
