/*
* Creado por: D4niel
* Estilos mejorados: Variables, resets, tipografía, layout, animaciones y transiciones
*/

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-base);
  background: var(--clr-bg);
  color: var(--clr-dark);
  line-height: 1.6;
  scroll-behavior: smooth;
}
/* Scroll progress bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--color-secondary);
  width: 0;
  z-index: 2000;
}
/* Header / Nav */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateY(-100%);
  animation: slideDown 0.6s forwards 0.5s;
}
@keyframes slideDown {
  to {
    transform: translateY(0);
  }
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Hero con parallax y animación de texto */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
  padding-top: 5rem;
  background: url("https://source.unsplash.com/1600x900/?sales,statistics")
    center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 253, 247, 0.7);
}
.hero .content {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s forwards 0.8s;
}
.hero h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-style: italic;
  max-width: 1600px;
  margin-bottom: 2rem;
  font-size: 2rem;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(63, 90, 60, 0.3);
  transition: var(--transition);
}
.btn-primary:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 25px rgba(63, 90, 60, 0.4);
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sección de fade-in al scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Sección 4 Pasos */
.steps {
  padding: 6rem 0;
  background: var(--clr-accent);
}
.steps h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}
.step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* 2) Cada paso: imagen grande a la izquierda, texto a la derecha */
.step-list .step {
  display: flex;
  align-items: center;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

/* 3) Tamaño de la imagen */
.step-list .step img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

/* 4) Contenedor de texto ocupa el resto */
.step-list .step > div {
  flex: 1;
}

.step {
  display: flex;
  align-items: flex-start;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}
.step:hover {
  transform: translateY(-5px);
}
.step img {
  width: 60px;
  height: 60px;
  margin-right: 1rem;
}
.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}
.step p {
  font-size: 1rem;
}

/* Acordeones Servicios con transiciones */
.services-accordion {
  padding: 6rem 0;
}
.services-accordion h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}
.services-accordion h3 {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
  color: #555;
}
.accordion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}
details.accordion-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: var(--transition);
}
details.accordion-item summary {
  padding: 1.5rem 2rem;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  list-style: none;
  transition: var(--transition);
}
details.accordion-item summary:hover {
  background: #f0f9f7;
}
details.accordion-item summary::after {
  content: "+";
  position: absolute;
  right: 2rem;
  font-size: 1.5rem;
  transform: rotate(0);
  transition: var(--transition);
}
details.accordion-item[open] summary::after {
  content: "–";
}
details.accordion-item div {
  max-height: 0;
  padding: 0 2rem;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.5s ease;
}
details.accordion-item[open] div {
  max-height: 200px;
  padding: 1rem 2rem;
}

/* Otros bloques / Sobre nosotros / Casos */
section:not(.hero):not(.steps):not(.services-accordion) {
  padding: 1rem 0;
}
#about h2,
#cases p,
#tech h2,
#target h2,
#final-faq h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
#about p,
#tech p,
#target p,
#final-faq p {
  max-width: 800px;
  margin: 0 auto 1rem;
  text-align: center;
  line-height: 1.6;
  color: #444;
}
#cases {
  background: var(--color-primary);
  color: white;
}
#cases img {
  width: 60% !important;
  border-radius: 8px;
  transition: transform 0.3s;
}
#cases img:hover {
  transform: scale(1.05);
}

/* Creado por D4niel, modificado el 23-06-2025 */
/* Contenedor y tamaño cuadrado para todas las imágenes */
.case-item {
  width: 350px;
  text-align: center;
}
.case-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s;
}

/* Efecto hover sobre la imagen */
.case-item img:hover {
  transform: scale(1.05);
}

/* Texto debajo oculto y preparado para fade-in con ligero delay */
.case-item .overlay-text {
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease 0.2s;
  color: #fff;
  font-weight: 600;
}

/* Al hacer hover en todo el bloque, aparece el texto tras un pequeño retraso */
.case-item:hover .overlay-text {
  opacity: 1;
}

#tech {
  padding: 2.5rem 0; /* Mantiene la misma separación que otras secciones */
  background: var(--clr-bg);
}

#tech h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

#tech p {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--clr-dark);
}

#tech ul {
  list-style: disc inside;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding-left: 1rem;
}

#tech li {
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 1rem;
  color: #444;
}

#tech .btn-primary {
  margin-top: 2rem;
  /* Hereda estilos de .btn-primary para mantener consistencia */
}

/* Al final de styles/index.css */

@media (min-width: 992px) {
  .step-list {
    /* Fuerza dos columnas de igual ancho */
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

#about {
  max-width: 1200px;
  font-size: 1.5rem;
}

.overlay-text {
  font-size: 1.5rem !important;
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .services-accordion h3 {
    font-size: 1rem;
  }

  #about h2, .services-accordion h2, #tech h2, #target h2, .steps h2 {
    font-size: 2rem;
  }
}

#about p a {
  display: inline-block;
  background-color: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-family: var(--ff-sans);
  font-weight: 500;
  transition: var(--transition-fast);
}

#about p a:hover {
  background-color: var(--color-secondary);
}
/* Responsive: acordeones uno debajo del otro hasta 480px */
@media screen and (max-width: 480px) {
  .accordion-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
