*,
*::before,
*::after {
  box-sizing: border-box;
}

main p {
  line-height: 1.5;
  font-size: var(--fs-regular);
  font-weight: 350;
}

main {
  background-color: var(--color-bg-lighter);
}

.hero {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  gap: 2rem;
}

.hero.first {
  background-image: url(/assets/img/hero-oficina.webp);
}

.hero.second {
  background-image: url(/assets/img/hero-piscina.webp);
  background-position: 50% 50%;
}

.hero.third {
  background-image: url(/assets/img/hero-termits.webp);
  background-position: 50% 70%;
}

.hero h1, .hero p {
  max-width: 700px;
  text-align: center;
  color: var(--color-text-light);
}

.hero h1 {
  padding-top: 4.5rem;
}

.intro {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background-color: var(--color-bg-dark);
  text-align: left;
}

.intro.first {
  padding-bottom: 1rem;
}

.intro.third {
  padding-bottom: 1rem;
}

.divider {
  width: 100%;
}

.divider.first {
  height: 50px;
  background-image: url(/assets/img/separador-seccio-QAI.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.divider.second {
  height: 30px;
  background-image: url(/assets/img/separador-seccio-aigua.svg);
  background-repeat: repeat-x;
  background-position: center;
  background-size: cover;
}

.divider.third {
  height: 60px;
  background-image: url(/assets/img/separador-seccio-plagues.svg);
  background-repeat: repeat-x;
  background-position: center;
  background-size: cover;
}

.about {
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background-color: var(--color-bg-darker);
  text-align: center;
}

.about-list {
  padding-top: 0.5rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: 600px;
  gap: 1rem;
}

.first .about-item {
  flex: 1 1 auto;
  font-size: 1rem;
}

.first .about-item:last-of-type {
  flex: 0 1 auto;
}

.about-item {
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  background: var(--color-details);
  box-shadow: var(--shadow-item-green);
  color: var(--color-text-light);

  transition: transform 0.2s ease;
}

.third .about-list {
  column-gap: 3rem;
  row-gap: 0.15rem;
  justify-self: center;
}

.third .about-item {
  width: 65px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  background: none;
  box-shadow: none;
  color: var(--color-text);
}

.third .about-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 40px;
  background: var(--color-secondary);
  box-shadow: var(--shadow-item-purple);
  color: var(--color-text-light);

  transition: transform 0.2s ease;
}

.third .about-item img {
  display: block;
  width: 50px;
  height: 50px;
}

.methodology {
  padding: 4rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  background-color: var(--color-primary);
  color: var(--color-text-light);
  text-align: center;
}

.cards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
  max-width: 1800px;
}

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 600px;
}

.card span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 100%;
  border: solid 2px var(--color-text-light);
  font-size: 0.75rem;
}

.details {
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-lighter);
  max-width: 1800px;
  margin-inline: auto;
  gap: 2rem;
}

.about h2, .details h2, .sectors h2, .services h2 {
  color: var(--color-primary);
  font-size: 1.75rem;
}

.details-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.details-info h2 {
  margin-bottom: 1rem;
}

.details-info p {
  text-align: left;
}

.details-img {
  width: 100%;
  height: 100%;
}

.details-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sectors {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background-color: var(--color-bg-dark);
  text-align: center;
}

.sectors-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: stretch;
  gap: 0.5rem;
  max-width: 1000px;
}

.sectors-item {
  display: flex;
  padding: 0.75rem 1rem;
  border-radius: 40px;
  background: none;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  border: solid 2px var(--color-primary);
  text-align: center;
}

.services {
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  background-color: var(--color-bg-darker);
  text-align: center;
}

.services-cards {
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.services .card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: var(--color-bg-light);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  border-bottom: solid 8px var(--color-primary);
}

.services .card h3 {
  color: var(--color-primary);
  text-align: center;
}




@media (min-width: 768px) {

  main p {
    font-size: var(--fs-regular);
    font-weight: 350;
  }

  .hero {
    height: 350px;
  }

  h1 {
    font-size: 3.5rem;
  }

  .intro {
    padding: 5rem clamp(2rem, 8vw, 8rem) 2.25rem;
    text-align: justify;
  }

  .intro p {
    max-width: 800px;
  }

  .divider.first {
    height: 140px;
    background-size: cover;
  }

  .divider.second {
    height: 80px
  }

  .divider.third {
    height: 100px;
    background-size: auto 100%;
  }

  .about {
    padding: 4rem clamp(2rem, 8vw, 8rem) 6rem;
    gap: 3.5rem;
  }

  .third.about, .first.about {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8rem;
  }

  .about h2 {
    font-size: 2.75rem;
    line-height: 1.25;
  }

  .third.about h2, .first.about h2 {
    align-self: flex-start;
    font-size: 3.25rem;
    max-width: 400px;
    text-align: left;
  }

  .first.about h2 {
    max-width: 450px;
  }

  .about-list {
    padding-top: 0;
    gap: 1rem;
  }

  .third .about-list {
    row-gap: 0.75rem;
  }

  .third .about-item {
    width: 70px;
  }

  .about-item:hover {
    transform: scale(1.07);
  }

  .methodology {
    padding: 4rem clamp(2rem, 4vw, 4rem);
  }

  .methodology h2 {
    font-size: 2.75rem;
  }

  .card {
    position: relative;
  }

  .methodology .card:not(:first-child)::before {
    position: absolute;
    content: "";
    left: -2rem;
    top: 20px;
    bottom: 20px;
    border-right: solid 2px var(--color-text-light);
    height: 100px;
    background-color: var(--color-text-light);
  }

  .cards-container {
    flex-direction: row;
    align-items: baseline;
    gap: 4rem;
  }

  .details {
    padding: 6rem clamp(2rem, 8vw, 8rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    row-gap: 5rem;
    column-gap: clamp(2rem, 5vw, 5rem);
  }

  .second.details {
    grid-template-rows: 1fr;
  }

  .details-info h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
  }

  .details p {
    text-align: justify;
  }

  .details-info:first-of-type {
    grid-area: 1 / 1 / 2 / 2;
  }

  .details-info:last-of-type {
    grid-area: 2 / 2 / 3 / 3;
  }

  .details-img:first-of-type {
    grid-area: 1 / 2 / 2 / 3;
  }

  .details-img:last-of-type {
    grid-area: 2 / 1 / 3 / 2;
  }

  .second .details-info {
    grid-area: 1 / 1 / 2 / 2;
  }

  .second .details-img {
    grid-area: 1 / 2 / 2 / 3;
  }

  .sectors {
    padding: 4rem clamp(2rem, 4vw, 8rem) 4.5rem;
    gap: 3.5rem;
    border-radius: 50px 50px 0 0;
  }

  .sectors h2 {
    font-size: 2.75rem;
  }

  .sectors-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
    gap: 1rem;
  }

  .sectors-item {
    padding: 0.75rem 1.5rem;
    transition: transform 0.2s ease;
  }

  .sectors-item:hover {
    transform: scale(1.07);
  }

  .services {
    padding: 4rem 3rem 6rem 3rem;
    justify-content: center;
    align-items: center;
    gap: 5rem;
  }

  .services h2 {
    font-size: 2.75rem;
    color: var(--color-primary);
  }

  .services-cards {
    max-width: 1100px;
    flex-direction: row;
    justify-content: center;
    gap: min(3rem, 3.2vw);
  }

  .services .card {
    padding: 1.5rem;
    flex: 1;
    transition: transform 0.2s ease;
  }

  .services .card h3 {
    font-size: 1.3rem;
  }

  .services .card:hover {
    transform: scale(1.025);
  }
  
}




@media (min-width: 768px) and (max-width: 1000px) {

  .sectors-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .third.about, .first.about {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4rem;
  }

  .third.about h2, .first.about h2 {
    align-self: center;
    text-align: center;
  }

  .services-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .services-cards .card {
    flex: 0 0 350px;
  }

}