/* ==========================================================================
   1. FUENTES Y VARIABLES GLOBALES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

:root {
  --verde-modeco: #286338;       /* Sostenibilidad y naturaleza */
  --rosa-fuerte: #E51872;        /* Identidad, compasión y apoyo juvenil */
  --rosa-claro: #E26890;         /* Sensibilidad / Variación */
  --blanco-fondo: #F9FBF9;       /* Fondo limpio con un sutil toque orgánico */
  --oscuro-texto: #1A241E;       /* Texto oscuro pero suave */
  --azul-denim: #2B4C7E;         /* Color complementario para evocar el denim */
  --fuente-titulos: 'Playfair Display', serif;
  --fuente-cuerpo: 'Plus Jakarta Sans', sans-serif;
}

/* Reset básico de márgenes */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* Permite el desplazamiento suave entre secciones */
}

body {
  font-family: var(--fuente-cuerpo);
  background-color: var(--blanco-fondo);
  color: var(--oscuro-texto);
  line-height: 1.6;
}

/* ==========================================================================
   2. ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */
header {
  background-color: #ffffff;
  padding: 20px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 15px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .logo {
  font-family: var(--fuente-titulos);
  font-size: 2rem;
  font-weight: 900;
  color: var(--verde-modeco);
  letter-spacing: -1px;
}

header nav {
  display: flex;
}

header .nav-links {
  display: flex;
  list-style: none;
  gap: 25px;
}

header .nav-links a {
  text-decoration: none;
  color: var(--oscuro-texto);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  position: relative;
}

header .nav-links a:hover {
  color: var(--verde-modeco);
}

/* Línea sutil decorativa rosa al pasar el mouse por el menú */
header .nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--rosa-fuerte);
  transition: width 0.3s ease;
}

header .nav-links a:hover::after {
  width: 100%;
}

header .marca-lema {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rosa-fuerte);
  font-weight: 700;
}

/* ==========================================================================
   3. SECCIÓN HERO (PORTADA)
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, rgba(40, 99, 56, 0.9) 0%, rgba(43, 76, 126, 0.85) 100%), 
              url('https://images.unsplash.com/photo-1542272604-787c3835535d?q=80&w=1000') no-repeat center/cover;
  color: white;
  padding: 110px 10%;
  text-align: center;
}

.hero h2 {
  font-family: var(--fuente-titulos);
  font-size: 3.2rem;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.25rem;
  max-width: 650px;
  margin: 0 auto;
  font-weight: 300;
  opacity: 0.95;
}

/* ==========================================================================
   4. MAQUETACIÓN GENERAL DE SECCIONES
   ========================================================================== */
main {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

section {
  margin-bottom: 100px; /* Separación generosa entre secciones de la Landing */
}

section h2 {
  font-family: var(--fuente-titulos);
  font-size: 2.4rem;
  color: var(--verde-modeco);
  text-align: center;
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.subtitulo-seccion {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rosa-fuerte);
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}

/* ==========================================================================
   5. SECCIÓN: NOSOTROS (DISEÑO REFINADO)
   ========================================================================== */
.seccion-nosotros {
  padding: 80px 0;
}

.nosotros-contenedor {
  display: flex;
  align-items: center;
  gap: 80px;
  flex-wrap: wrap; 
  margin-bottom: 60px;
}

.nosotros-imagen, .nosotros-texto {
  flex: 1;
  min-width: 320px;
}

.nosotros-imagen {
  position: relative;
}

.nosotros-imagen img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(40, 99, 56, 0.08);
}

.badge-autentico {
  position: absolute;
  bottom: 25px;
  left: 25px;
  background-color: var(--verde-modeco);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 8px 20px rgba(40, 99, 56, 0.25);
}

.nosotros-texto h2 {
  text-align: left;
  margin-bottom: 25px;
  font-size: 2.8rem;
  line-height: 1.15;
  color: var(--oscuro-texto);
}

.nosotros-texto p {
  color: #555;
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.nosotros-texto p.destacado {
  font-size: 1.25rem;
  color: var(--verde-modeco);
  font-weight: 600;
  line-height: 1.6;
  border-left: 4px solid var(--rosa-fuerte);
  padding-left: 20px;
  margin-bottom: 30px;
}

/* --- Tarjetas de Misión y Visión (Pilares) --- */
.pilares-contenedor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.pilar-card {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  border: 1px solid #eef2ef;
  transition: transform 0.3s ease;
}

.pilar-card:hover {
  transform: translateY(-5px);
}

.pilar-icono {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.pilar-card h3 {
  font-family: var(--fuente-titulos);
  color: var(--azul-denim);
  font-size: 1.6rem;
  margin-bottom: 15px;
}

.pilar-card p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
}

/* --- Barra de Valores Decorativa --- */
.valores-barra {
  background-color: #f0f4f1;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
}

.valores-barra h3 {
  font-family: var(--fuente-titulos);
  color: var(--verde-modeco);
  font-size: 1.4rem;
  margin-bottom: 25px;
  letter-spacing: 0.5px;
}

.valores-tags {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.valores-tags span {
  background-color: #ffffff;
  color: var(--oscuro-texto);
  padding: 10px 22px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  border: 1px solid #e2e8e4;
  transition: all 0.2s ease;
}

.valores-tags span:hover {
  border-color: var(--rosa-fuerte);
  color: var(--rosa-fuerte);
  transform: scale(1.05);
}

/* --- Adaptación para pantallas móviles --- */
@media (max-width: 768px) {
  .nosotros-contenedor {
    gap: 40px;
  }
  .nosotros-texto h2 {
    font-size: 2.2rem;
  }
  .pilares-contenedor {
    grid-template-columns: 1fr;
  }
  .pilar-card {
    padding: 30px;
  }
}

/* ==========================================================================
   6. SECCIÓN: TIENDA / CATÁLOGO (CSS GRID)
   ========================================================================== */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.producto-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.producto-img-container {
  background-color: #f0f4f1;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.producto-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.producto-info {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.producto-info h3 {
  font-family: var(--fuente-titulos);
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--oscuro-texto);
}

.producto-info p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1;
}

.producto-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 10px;
  flex-wrap: wrap;
}

.producto-precio {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--azul-denim);
}

/* Botón agregar al carrito en tarjeta */
.btn-agregar-carrito {
  background-color: var(--verde-modeco);
  color: white;
  border: none;
  padding: 10px 18px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-agregar-carrito:hover {
  background-color: #1e4a2a;
  transform: scale(1.02);
}

.btn-agregar-carrito:active {
  transform: scale(0.98);
}

.btn-agregar-carrito.agregado {
  background-color: var(--rosa-fuerte);
}

/* ==========================================================================
   7. COMPONENTES: BOTONES
   ========================================================================== */
.btn-primary {
  background-color: var(--rosa-fuerte);
  color: white;
  border: none;
  padding: 12px 24px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background-color: var(--rosa-claro);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ==========================================================================
   8. CARRITO DE COMPRAS
   ========================================================================== */

/* --- Icono flotante del carrito --- */
.carrito-flotante {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--rosa-fuerte), var(--rosa-claro));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(229, 24, 114, 0.35);
  z-index: 1100;
  transition: all 0.3s ease;
  animation: pulse-carrito 2s infinite;
}

@keyframes pulse-carrito {
  0%, 100% { box-shadow: 0 8px 25px rgba(229, 24, 114, 0.35); }
  50% { box-shadow: 0 8px 35px rgba(229, 24, 114, 0.55); }
}

.carrito-flotante:hover {
  transform: scale(1.1);
  animation: none;
}

.carrito-flotante i {
  font-size: 1.4rem;
  color: white;
}

.carrito-contador {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--verde-modeco);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  transition: transform 0.2s ease;
}

.carrito-contador.animated {
  animation: bounce-contador 0.4s ease;
}

@keyframes bounce-contador {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* --- Overlay del carrito --- */
.carrito-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1190;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.carrito-overlay.activo {
  opacity: 1;
  visibility: visible;
}

/* --- Modal del carrito --- */
.carrito-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background-color: white;
  z-index: 1200;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}

.carrito-modal.activo {
  transform: translateX(0);
}

.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1.5px solid #E0E6E2;
  background-color: #fafbfa;
}

.carrito-header h3 {
  font-family: var(--fuente-titulos);
  color: var(--verde-modeco);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carrito-header h3 i {
  color: var(--rosa-fuerte);
}

.carrito-cerrar {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #888;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.carrito-cerrar:hover {
  background-color: #f0f0f0;
  color: var(--rosa-fuerte);
}

/* --- Items del carrito --- */
.carrito-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px 25px;
}

.carrito-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #aaa;
  padding: 40px;
}

.carrito-vacio i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #ddd;
}

.carrito-vacio p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 5px;
}

.carrito-vacio span {
  font-size: 0.9rem;
}

/* Item individual en el carrito */
.carrito-item {
  display: flex;
  gap: 15px;
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
  animation: fadeInItem 0.3s ease;
}

@keyframes fadeInItem {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.carrito-item-img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.carrito-item-info {
  flex: 1;
  min-width: 0;
}

.carrito-item-nombre {
  font-family: var(--fuente-titulos);
  font-size: 1rem;
  color: var(--oscuro-texto);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrito-item-precio {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--azul-denim);
  margin-bottom: 8px;
}

.carrito-item-cantidad {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carrito-btn-cantidad {
  width: 28px;
  height: 28px;
  border: 1.5px solid #E0E6E2;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #555;
  transition: all 0.2s ease;
}

.carrito-btn-cantidad:hover {
  border-color: var(--verde-modeco);
  color: var(--verde-modeco);
}

.carrito-cantidad-valor {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 20px;
  text-align: center;
}

.carrito-item-eliminar {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.carrito-item-eliminar:hover {
  color: #d9534f;
}

/* --- Footer del carrito --- */
.carrito-footer {
  padding: 25px 30px;
  border-top: 1.5px solid #E0E6E2;
  background-color: #fafbfa;
}

.carrito-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #666;
}

.carrito-total-final {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--oscuro-texto);
  margin-bottom: 20px;
  padding-top: 8px;
  border-top: 1px dashed #ddd;
}

.btn-ordenar-wa {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--fuente-cuerpo);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.btn-ordenar-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.btn-ordenar-wa:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-vaciar-carrito {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #888;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-vaciar-carrito:hover {
  border-color: #d9534f;
  color: #d9534f;
  background-color: rgba(217, 83, 79, 0.05);
}

/* Notificación toast */
.toast-notificacion {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: var(--verde-modeco);
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 25px rgba(40, 99, 56, 0.3);
  z-index: 1300;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-notificacion.mostrar {
  transform: translateX(0);
}

.toast-notificacion i {
  font-size: 1.1rem;
}

/* ==========================================================================
   9. SECCIÓN: DONACIONES / FUNDACIÓN (FORMULARIO)
   ========================================================================== */
.seccion-donacion {
  background: linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)),
              url('https://images.unsplash.com/photo-1512436991641-6745cdb1723f?q=80&w=1000') no-repeat center/cover;
  padding: 60px 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.02);
}

.formulario-box {
  max-width: 550px;
  margin: 0 auto;
}

.formulario-box h2 {
  color: var(--azul-denim);
  margin-bottom: 15px;
}

#form-donacion {
  margin-top: 30px;
}

.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--oscuro-texto);
}

.input-group input, 
.input-group select {
  padding: 14px;
  border: 1.5px solid #E0E6E2;
  border-radius: 8px;
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.2s ease;
}

.input-group input:focus, 
.input-group select:focus {
  outline: none;
  border-color: var(--verde-modeco);
}

#form-donacion .btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  margin-top: 10px;
  background-color: var(--verde-modeco);
}

#form-donacion .btn-primary:hover {
  background-color: #357a48;
}

/* ==========================================================================
   10. ELEMENTOS DE ESTADO Y PIE DE PÁGINA
   ========================================================================== */
.cargando {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #888;
  font-style: italic;
}

footer {
  background-color: var(--oscuro-texto);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 300;
}

/* ==========================================================================
   11. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 900px) {
  .hero h2 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    padding: 15px;
  }

  header .nav-links {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nosotros-contenedor {
    gap: 30px;
  }

  .nosotros-imagen img {
    height: 380px;
  }

  .nosotros-texto h2 {
    font-size: 2rem;
  }

  .seccion-donacion {
    padding: 40px 20px;
  }

  .carrito-modal {
    width: 100%;
  }

  .carrito-flotante {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .producto-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-agregar-carrito {
    width: 100%;
    justify-content: center;
  }
}

/* --- ESTILOS DE FILTROS EN LA TIENDA --- */
.productos-filtros {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn-filtro {
  background-color: transparent;
  color: #555;
  border: 1.5px solid #E0E6E2;
  padding: 10px 22px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 50px;
  transition: all 0.2s ease;
}

.btn-filtro:hover {
  border-color: var(--verde-modeco);
  color: var(--verde-modeco);
}

.btn-filtro.active {
  background-color: var(--verde-modeco);
  border-color: var(--verde-modeco);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 99, 56, 0.2);
}

/* ==========================================================================
   ESTILOS EXTRAS PARA PÁGINA DE DONACIONES
   ========================================================================== */
#form-donante .input-group textarea {
  width: 100%;
  transition: border-color 0.2s ease;
}

#form-donante .input-group textarea:focus {
  outline: none;
  border-color: var(--verde-modeco);
}

#form-donante button[type="submit"] {
  background-color: var(--rosa-fuerte);
  transition: all 0.2s ease;
}

#form-donante button[type="submit"]:hover {
  background-color: var(--rosa-claro);
  transform: translateY(-1px);
}

#form-donante button[type="submit"]:active {
  transform: scale(0.98);
}

/* Responsive del grid de formulario de donaciones */
@media (max-width: 600px) {
  #form-donante > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}