/* Base styling */
.how-it-works-section {
  padding: 2rem 1rem;
  text-align: center;
}

.section-title {
  font-size: 2rem;
  color: #d41616;
  margin-bottom: 2rem;
}

@media screen and (max-width: 768px) {
  .how-section-title {
    margin-bottom: 1.5rem;
    color: #d41616;
    font-size: 44px !important;
  }
  .how-it-works-section {
    margin-top: 2rem;
    margin-bottom: -150px;
  }
  .carousel-wrapper {
    position: relative;
    height: 400px;
  }

  .how-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 70%;
    height: 100%;
    left: 15%;
    transform: translate(-50%, 100%);
    padding: 1.5rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.8s ease-in-out;
  }

  .how-card.active {
    opacity: 1;
    transform: translateY(0%);
    z-index: 2;
  }

  .how-card.exit-up {
    transform: translateY(-100%);
    opacity: 0;
    z-index: 1;
  }

  .how-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
    color: #d41616;
  }

  .how-card p {
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
  }

  .how-card .icon {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (min-width: 769px) {
  .how-it-works-section {
    margin-top: 2rem;
    margin-bottom: 50px;
  }

  .how-section-title {
    font-size: 48px;
    margin-bottom: 3rem;
    color: #d41616;
  }

  .carousel-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: nowrap;
  }

  .how-slider-container {
    display: contents;
  }

  .how-card {
    flex: 1;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 400px;
  }

  .how-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .how-card img.icon {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1.2rem;
  }

  .how-card h3 {
    color: #d41616;
    font-size: 1.2rem;
    font-family: "Playfair Display", serif;
    margin-bottom: 0.8rem;
  }

  .how-card p {
    color: #333;
    font-size: 0.95rem;
    font-family: "Playfair Display", serif;
    line-height: 1.4;
  }
}
