/* ===========================
   COMPONENTE PARALLAX - ECO VERDE A&M
   =========================== */

/* Base: Secciones de altura completa */
.ev-parallax {
  height: 100vh;
  min-height: 600px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout style paint;
}

/* Modificadores de sección */
.ev-parallax--hero,
.ev-parallax--secondary,
.ev-parallax--tertiary {
  position: relative;
  z-index: 1;
}

/* Espaciador para flujo de contenido */
.parallax-spacer {
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 0;
}

/* ===========================
   CAPAS DE FONDO
   =========================== */
.ev-parallax__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Background base común para todas las secciones */
.ev-parallax {
  background-image: url('./images/Capa_1_Parallax.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Capa 1 - Hero principal con efectos de zoom */
.ev-parallax__layer--bg {
  background-image: url('./images/Capa_1_Parallax.webp');
  z-index: 0;
  transform: scale(1.1);
  transition: transform 2s ease-out;
}

/* Zoom inicial cuando se carga la página */
.ev-ready .ev-parallax__layer--bg {
  transform: scale(1.2);
}

/* Hover en toda la sección hero para activar el zoom */
.ev-parallax--hero:hover .ev-parallax__layer--bg {
  transform: scale(1.3);
  /* Aseguramos que el efecto de zoom tenga prioridad */
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Capa 2 - Overlay sobre background base con mayor transparencia */
.ev-parallax__layer--secondary {
  background-image: linear-gradient(rgba(46, 125, 50, 0.3), rgba(46, 125, 50, 0.3)), 
                    url('./images/Capa_2_Parallax.webp');
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.8;
}

/* Capa 3 - Overlay sobre background base con mayor transparencia */
.ev-parallax__layer--tertiary {
  background-image: linear-gradient(rgba(21, 101, 192, 0.25), rgba(21, 101, 192, 0.25)), 
                    url('./images/Capa_3_Parallax.webp');
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.75;
}

/* Sección terciaria - comportamiento normal */
.ev-parallax--tertiary {
  position: relative;
  z-index: 1;
}

/* ==========================
   Estilos específicos para Hero (Capa_1)
   ========================== */
.ev-parallax--hero .ev-parallax__content-title {
  color: var(--azul-profundo, #5ba7ff);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.ev-parallax__hero-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.ev-hero-service {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 12px);
  padding: 1.5rem 1rem;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: all 0.3s ease;
}

.ev-hero-service:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.ev-hero-service h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--azul-profundo, #5ba7ff);
}

.ev-hero-service p {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
  color: #e8e8e8;
}

/* El hero ahora se comporta igual que las otras secciones - sin animación automática */

/* Estado cuando el CTA se oculta por scroll hacia atrás - solo para hero fijo */
.ev-parallax__content--hidden .ev-parallax__content-inner {
  transform: translateY(-150%);
  opacity: 0;
  /* Aseguramos que esta animación tenga prioridad */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ctaSlideUp {
  from {
    opacity: 0;
    transform: translateY(150%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   CONTENIDO SOBRE CAPAS
   ========================== */
.ev-parallax__content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 2; /* Por encima de las capas overlay */
}

.ev-parallax__content-inner {
  max-width: min(1000px, 90vw);
  width: 100%;
  text-align: center;
  color: var(--blanco-puro);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: clamp(1rem, 1.5vw, 1.5rem);
  border-radius: var(--border-radius, 16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ev-parallax__content-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin: 0 0 0.3em 0;
  font-weight: 700;
  color: var(--amarillo-sol, #F9A825);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Título verde específico para la sección de compromiso */
.ev-parallax--tertiary .ev-parallax__content-title {
  color: var(--verde-bosque, #2E7D32);
}

.ev-parallax__content-subtitle {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.4;
  margin: 0 0 2rem 0;
  color: #f5f5f5;
  opacity: 0.95;
}

/* Grid de servicios */
.ev-parallax__services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.ev-service-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius, 12px);
  padding: 1.5rem;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.ev-service-card:hover {
  transform: translateY(-4px);
  background: rgba(102, 187, 106, 0.70);
}

.ev-service-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--amarillo-sol, #F9A825);
}

.ev-service-card p {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
  color: #e8e8e8;
}

/* Botón secundario */
.ev-parallax__content .btn.btn-secondary {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  font-weight: 600;
  border-radius: var(--border-radius, 10px);
  background: var(--verde-bosque, #2E7D32);
  color: var(--blanco-puro);
  border: 1px solid var(--verde-hover, #66BB6A);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  text-decoration: none;
  margin-top: 1rem;
}

.ev-parallax__content .btn.btn-secondary:hover,
.ev-parallax__content .btn.btn-secondary:focus-visible {
  background: var(--verde-hover, #66BB6A);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
  .ev-parallax__services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .ev-service-card {
    padding: 1.2rem;
  }
  
  .ev-parallax__content-inner {
    padding: clamp(1rem, 2.5vw, 2rem);
  }
}

/* Optimización para imágenes 16:9 (1920x1080) */
@media (max-aspect-ratio: 16/9) {
  .ev-parallax__layer {
    background-size: cover;
    background-position: center center;
  }
}

@media (min-aspect-ratio: 16/9) {
  .ev-parallax__layer {
    background-size: cover;
    background-position: center center;
  }
}

/* Ajustes específicos para pantallas muy anchas */
@media (min-aspect-ratio: 21/9) {
  .ev-parallax__layer {
    background-size: cover;
    background-position: center center;
  }
}

/* Ajustes para móviles en orientación vertical */
@media (max-width: 768px) and (orientation: portrait) {
  .ev-parallax__layer {
    background-attachment: scroll; /* Mejor rendimiento en móviles */
    background-size: cover;
    background-position: center center;
  }
}

/* ==========================
   Estilos para Capa_3 (Compromiso Ambiental)
   ========================== */
.ev-parallax__commitment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.2rem 0;
}

.ev-commitment-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 16px);
  padding: 2rem 1.5rem;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: all 0.4s ease;
}

.ev-commitment-item:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.ev-commitment-item h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.8rem 0;
  color: var(--verde-bosque, #2E7D32);
}

.ev-commitment-item p {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  color: #e0e0e0;
  opacity: 0.9;
}

/* Grupo de botones CTA */
.ev-parallax__cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.ev-parallax__content .btn.btn-primary {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  font-weight: 600;
  border-radius: var(--border-radius, 10px);
  background: var(--azul-profundo, #5ba7ff);
  color: var(--blanco-puro);
  border: 1px solid var(--azul-profundo, #5ba7ff);
  box-shadow: 0 4px 16px rgba(91, 167, 255, 0.3);
  transition: all 0.3s ease;
  text-decoration: none;
}

.ev-parallax__content .btn.btn-primary:hover,
.ev-parallax__content .btn.btn-primary:focus-visible {
  background: color-mix(in srgb, var(--azul-profundo, #5ba7ff) 85%, var(--blanco-puro) 15%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 167, 255, 0.4);
}

/* Botón amarillo específico para "Ver todos los servicios" */
.ev-parallax--secondary .btn.btn-primary {
  background: var(--amarillo-sol, #F9A825);
  border: 1px solid var(--amarillo-sol, #F9A825);
  box-shadow: 0 4px 16px rgba(249, 168, 37, 0.3);
  color: var(--blanco-puro);
}

.ev-parallax--secondary .btn.btn-primary:hover,
.ev-parallax--secondary .btn.btn-primary:focus-visible {
  background: color-mix(in srgb, var(--amarillo-sol, #F9A825) 85%, var(--blanco-puro) 15%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 168, 37, 0.4);
}

/* Botón verde específico para "Contáctanos ahora" */
.ev-parallax--tertiary .btn.btn-primary {
  background: var(--verde-bosque, #2E7D32);
  border: 1px solid var(--verde-bosque, #2E7D32);
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
  color: #fff;
}

.ev-parallax--tertiary .btn.btn-primary:hover,
.ev-parallax--tertiary .btn.btn-primary:focus-visible {
  background: var(--verde-hover, #66BB6A);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.4);
}

.ev-parallax__content .btn.btn-outline {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  font-weight: 600;
  border-radius: var(--border-radius, 10px);
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
}

.ev-parallax__content .btn.btn-outline:hover,
.ev-parallax__content .btn.btn-outline:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--blanco-puro);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Responsive para Hero */
@media (max-width: 768px) {
  .ev-parallax__hero-services {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }
  
  .ev-hero-service {
    padding: 1.2rem 0.8rem;
  }
}

/* Responsive para Capa_3 */
@media (max-width: 768px) {
  .ev-parallax__commitment-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
  }
  
  .ev-commitment-item {
    padding: 1.5rem 1rem;
  }
  
  .ev-parallax__cta-group {
    flex-direction: column;
    align-items: center;
  }
  
  .ev-parallax__cta-group .btn {
    width: 100%;
    max-width: 280px;
  }
}

