#homepage {
  position: relative;
  padding: 10px;
}

#homepage h2 {
  text-align: center;
  width: 100%;
  font-family: 'Jojoba', sans-serif;
  border-radius: 15px;
  color: #fff;
  font-size: 20px;
  padding: 3px;
}

.shop-by-age,
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.shop-by-age div,
.categories div {
  text-align: center;
  position: relative;
  margin-bottom: 28px;
  border-radius: 15px;
}

.shop-by-age div {
  width: 32%;
}

.shop-by-age div.full {
  width: 100%;
}

.categories div {
  width: 23%;
  margin-bottom: 37px;
  border-radius: 15%;
}

.shop-by-age div img,
.categories div img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shop-by-age div:hover img,
.categories div:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.shop-by-age div:hover img.prezzie {
  box-shadow: none;
}

.shop-by-age a span,
.categories a span {
  position: absolute;
  bottom: 20px;
  width: 50%;
  margin: 0 25%;
  background: #fff;
  padding: 14px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 185%;
  line-height: 100%;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
  display: block;
  opacity: 0.95;
}

.shop-by-age .full a span {
  width: 20%;
  margin: 0 40%;
}

.categories a span {
  width: 70%;
  margin: 0 15%;
  font-size: 132%;
  padding: 10px;
  border-radius: 5% / 30%;
  opacity: 0.9;
}

.shop-by-age a span strong,
.categories a span strong {
  font-size: 70%;
  display: block;
}

/* Special label styling */
.shop-by-age a span.gift-finder-label {
  background: #78bab9;
  color: #fff;
  border: 3px solid #efeeea;
}

/* Bouncing and swaying animations */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes sway {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(6px);
  }
}

.shop-by-age div img.prezzie {
  position: absolute;
  left: 40%;
  bottom: 90px;
  width: 84px;
  animation: bounce 1s ease-in-out infinite;
  will-change: transform;
  z-index: 1;
}

.gift-finder .child {
  position: absolute;
  right: 6%;
  top: -46px;
  width: 200px;
  animation: sway 2.5s ease-in-out infinite;
  will-change: transform;
}

.gift-finder .child.two {
  right: 0%;
  top: 0px;
  animation: sway 1.5s ease-in-out infinite;
}

/* Responsive styles */
@media only screen and (max-width: 479px) {
  .shop-by-age div,
  .categories div {
    width: 48%;
    margin-bottom: 15px;
  }

  .shop-by-age a span,
  .categories a span {
    width: 70%;
    margin: 0 15%;
    font-size: 130%;
    bottom: 10px;
    padding: 8px;
  }

  .shop-by-age div.full {
    width: 48%;
  }

  .shop-by-age .full a span {
    width: 70%;
    margin: 0 15%;
  }

  .shop-by-age div img.prezzie {
    left: 41%;
    width: 33px;
    bottom: 48px;
  }

  .gift-finder div p {
    font-size: 85%;
  }

  .gift-finder div a {
    margin-top: 17px;
    font-size: 120%;
  }
}
