.templates-section {
  height: 100vh;
  text-align: center;
  padding: 60px 40px;
  background-color: white;
}

.page-title {
  font-size: 38px;
  font-weight: 500;
  margin-bottom: 80px;
  letter-spacing: 1px;
  color: #550216;
}

.template-tabs {
  display: flex;
  justify-content: space-between;
  max-width: 1080px;
  margin: 50px auto;
  overflow: hidden;
}

.template-tabs span {
  font-size: 16px;
  color: #d2a2aa;
}

.template-tabs .active {
  color: #550216;
  font-weight: 500;
}

.template-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  transition: transform 0.8s ease;
}

.template-card {
  width: 180px;
  height: 360px;
  position: relative;
  transition: all 0.5s ease;
}

.template-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.template-card.active {
  width: 260px;
  height: 520px;
  opacity: 1;
  z-index: 2;
}

.template-card.active::before {
  content: "";
  position: absolute;
  inset: -5px;
  background-image: url('../images/templates/phone1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 10;
}

.template-card.faded {
  opacity: 0.3;
  transform: scale(0.9);
}

.template-card {
  cursor: pointer;
}

.templates-section {
  position: relative;
  overflow: visible;
}

.between-sections-flower1 {
  position: absolute;
  top: -140px;
  right: 20px;
  width: 200px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
  animation: flowerFloatRight 5s ease-in-out infinite;
}

@keyframes flowerFloatRight {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-8px) rotate(1.2deg);
  }

  50% {
    transform: translateY(-14px) rotate(0deg);
  }

  75% {
    transform: translateY(-8px) rotate(-1.2deg);
  }

  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@media (max-width: 1024px) {

  .template-row {
    gap: 18px;
  }
}

@media (max-width: 768px) {

  .template-card {
    height: 250px;
  }

  .template-card.active {
    width: 320px;
    height: 400px;
  }

}

@media (max-width: 480px) {

  .templates-section {
    padding: 40px 10px 60px;
    height: 85vh;
  }

  .template-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
    overflow: hidden;
  }

  .template-card {
    width: 130px;
    height: 300px;
    flex-shrink: 0;
    transition: all 0.6s ease;
    opacity: 0.4;
    transform: scale(0.85);
  }

  .template-card.active {
    width: 190px;
    height: 380px;
  }

  .template-card:nth-child(2) {
    margin-right: 0px;
  }

  .template-card:nth-child(4) {
    margin-left: 0px;
  }

  .template-card img {
    border-radius: 22px;
  }

  .between-sections-flower1 {
    top: -30px;
    right: 10px;
    width: 70px;
  }

  .template-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px;
  }

  .template-tabs::-webkit-scrollbar {
    display: none;
  }

  .template-tabs span {
    flex-shrink: 0;
    font-size: 15px;
    color: #d2a2aa;
    transition: all 0.3s ease;
  }

  .template-tabs span.active {
    color: #550216;
    font-weight: 600;
    transform: scale(1.1);
  }
}