/* ==========================================================================
   Variables y Configuración Global
   ========================================================================== */
:root {
  --color-primary: #0B3D91;      /* Azul Profundo */
  --color-primary-light: #1A54BD;
  --color-success: #2E8B57;      /* Verde Esperanza */
  --color-success-hover: #246B43;
  --color-accent: #E67E22;       /* Acento cálido */
  --color-whatsapp: #25D366;     /* Verde Oficial WhatsApp */
  --color-whatsapp-hover: #1EBE5D;
  
  --bg-white: #FFFFFF;
  --bg-light: #F8FAFC;          /* Gris muy claro */
  --bg-card: #FFFFFF;
  
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --text-light: #F1F5F9;

  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(11, 61, 145, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Tipografía y Utilidades */
h1, h2, h3 {
  color: var(--color-primary);
  line-height: 1.25;
  font-weight: 700;
}

p { margin-bottom: 1rem; }
a { color: inherit; text-decoration: none; }

.container {
  width: 90%;
  max-width: 1180px;
  margin: 0 auto;
}

.section { padding: 5rem 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.w-100 { width: 100%; }

.section-tag {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-success);
  margin-bottom: 0.5rem;
}

.section-header {
  max-width: 680px;
  margin: 0 auto 3rem auto;
}

.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.items-center { align-items: center; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46, 139, 87, 0.35);
}

.btn-primary:hover {
  background-color: var(--color-success-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 139, 87, 0.45);
}

.btn-secondary {
  background-color: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--bg-light);
  transform: translateY(-2px);
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.03);
  transition: var(--transition-smooth);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-links a:hover { color: var(--color-primary); }

.btn-nav {
  background-color: var(--color-primary);
  color: #fff !important;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
}

/* Hero */
.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  background-image: url('imagenes/foto1.jpeg'); /* <-- PON EL NOMBRE DE TU FOTO AQUÍ */
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.9) 0%, rgba(0, 0, 0, 0.75) 100%);
}

.hero-content {
  position: relative;
  max-width: 750px;
  padding: 4rem 0;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  backdrop-filter: blur(4px);
}

.hero-section h1 {
  font-size: 3.2rem;
  color: #fff;
  margin-bottom: 1.2rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  font-weight: 300;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Historia */
.historia-texto h2 { font-size: 2.2rem; margin-bottom: 1.2rem; }
.quote-card {
  border-left: 4px solid var(--color-accent);
  padding-left: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

.img-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.img-frame img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Galería Masonry Dinámica
   ========================================================================== */
.masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  background: #E2E8F0;
}

.masonry-item img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  transition: transform 0.4s ease;
}

.masonry-item:hover img {
  transform: scale(1.05);
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition-smooth);
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
  color: #fff;
  font-size: 0.9rem;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

/* Transparencia */
.card-transparencia { text-align: center; }
.card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.info-banner {
  background-color: #EBF3FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 1.2rem 2rem;
  margin-top: 3rem;
  color: var(--color-primary);
  text-align: center;
}

/* Donaciones */
.donaciones-section { background-color: #F1F5F9; }
.progress-box { margin-bottom: 3rem; }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.progress-amount { font-size: 1.3rem; color: var(--color-primary); }
.progress-track {
  width: 100%;
  height: 18px;
  background-color: #E2E8F0;
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-success) 0%, #34D399 100%);
  border-radius: 50px;
  transition: width 1.2s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.progress-percentage {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.card-pago { display: flex; flex-direction: column; }
.pago-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.pago-icon { font-size: 1.8rem; }
.pago-type { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.copy-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-light);
  border: 1px dashed #CBD5E1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.copy-text { font-weight: 600; color: var(--color-primary); }
.btn-copy {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy.copied { background-color: var(--color-success); }
.titular { font-size: 0.8rem; color: var(--text-muted); margin-top: auto; }

/* Mensajes */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 0.4rem; font-weight: 500; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.mensajes-feed {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mensaje-item {
  background: #fff;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary);
}

.mensaje-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* CTA Final y Footer */
.cta-final { background-color: var(--color-primary); color: #fff; padding: 5rem 0; }
.cta-final h2 { color: #fff; font-size: 2.2rem; max-width: 800px; margin: 0 auto 1.5rem auto; }
.cta-final p { color: var(--text-light); margin-bottom: 2rem; }
.btn-share {
  background-color: var(--color-success);
  color: #fff;
  font-size: 1.1rem;
  padding: 1rem 2.2rem;
  border-radius: 50px;
}

.footer { background-color: #051B42; color: #94A3B8; padding: 2.5rem 0; font-size: 0.85rem; }

/* ==========================================================================
   Lightbox con Zoom y Navegación
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  user-select: none;
}

.lightbox.active { display: flex; }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 75vh;
}

.lightbox-content img {
  max-height: 70vh;
  max-width: 85vw;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.lightbox-content img.zoomed {
  transform: scale(1.6);
  cursor: zoom-out;
}

.lightbox-caption {
  color: #fff;
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

.lightbox-hint {
  color: #94A3B8;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lightbox-btn:hover { background: rgba(255, 255, 255, 0.35); }
.lightbox-close { top: 1.5rem; right: 1.5rem; font-size: 2rem; }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ==========================================================================
   Botón Flotante de WhatsApp
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: var(--color-whatsapp);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45);
  z-index: 1500;
  cursor: pointer;
  transition: var(--transition-smooth);
  animation: pulse-whatsapp 3s infinite ease-in-out;
}

.whatsapp-float:hover {
  background-color: var(--color-whatsapp-hover);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

.whatsapp-icon {
  width: 34px;
  height: 34px;
}

/* Tooltip emergente que invita a escribir */
.whatsapp-tooltip {
  position: absolute;
  right: 72px;
  background-color: #1E293B;
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #1E293B;
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ==========================================================================
   Animaciones Reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 992px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .masonry-grid { column-count: 2; }
  .hero-section h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .masonry-grid { column-count: 1; }
  .hero-section { min-height: 75vh; }
  .hero-section h1 { font-size: 2rem; }
  .nav-links { display: none; }
  .section { padding: 3.5rem 0; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  
  /* Ajuste en móvil para el botón de WhatsApp */
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
  .whatsapp-icon {
    width: 30px;
    height: 30px;
  }
  .whatsapp-tooltip {
    display: none; /* En pantallas táctiles no se muestra tooltip para evitar bloqueos */
  }
}