@use '../helpers/variables' as vars;
@use "sass:map";
@use "sass:color";
.services-slider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;

  .slider-viewport {
    overflow-x: clip;
    width: 100%;
  }

  .slider-track {
    display: flex;
    transition: transform 0.6s ease;
    gap: 16px;
  }

  .service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 calc(25% - 12px); // 👈 4 cards visible, account for gap
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 30px rgba(0,0,0,.08);
    height: 519px;
    box-sizing: border-box;

    @media (max-width: 1180px) {
      // 3 cards visible on smaller screens
      flex: 0 0 calc(33.333% - 10.66px);
    }
    @media (max-width: 870px) {
      // 2 card visible on mobile
      flex: 0 0 calc(50% - 8px);
    }
    @media (max-width: 720px) {
      // 1 card visible on very small screens
      flex: 0 0 100%;
    }

    /* step badge (in-flow, not absolute) */
    .step {
      position: relative;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      background: #cfe3ef;
      color: #000;
      width: 66px;
      height: 66px;
      border-radius: 9000px;
      font-size: map.get(vars.$heading-sizes, xxlarge);
      text-align: center;
      line-height: 36px;
      font-weight: 500;
      box-shadow: 0 6px 18px rgba(0,0,0,0.08);
      margin-bottom: 12px;
    }

    .card-content{
      height: 100%;
      display: flex;
      flex: 1;
      gap: 10px;
      flex-direction: column;
      padding-top: 0;
      justify-content: space-between;

      .card-info{
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* image wrapper keeps image contained and scaled */
        transition: transform 420ms cubic-bezier(.2,.9,.2,1);
        will-change: transform;
        transform-origin: center center;

        .card-image{
          position: relative;
          display: flex;
          flex: 1 1 auto;
          overflow: hidden;
          margin-top: 12px;    
          
          img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            object-position: center;
          }

        }
      

        h3 {
          font-size: map.get(vars.$heading-sizes, medium);
          margin-top: 10px;
        }
      }
      /* hover effect: lift card and gently scale image */
      &:hover {
        transform: translateY(-8px);
        cursor: pointer;

        .card-image img {
          transform: scale(1.06) translateY(-4px);
        }
      }
      .btn{
        display: none;
        transition: all 0.8s ease;
      }

      &:hover{
        
        .btn{
          display: inline-block;
        }
      }
    }

    
  }

  .nav-btn {
    background: #000;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;

    &.disabled {
      opacity: 0.4;
      cursor: not-allowed;
      pointer-events: none;
    }
  }
}

.services-slider-btns{
  display: flex;
  justify-content: end;
  gap: 20px;
  .nav-btn{
    background-color: var(--black);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9000px;
    width: 42px;
    height: 42px;

    svg{
      width: 20px;
      height: 20px;
      color: var(--text-muted-color);
    }

    &.disabled{
      opacity: 0.5;
      cursor: not-allowed;
      background-color: transparent;
      border: 1px solid var(--light-gray);
    }

    &:hover{
      background-color: color.adjust(#000, $lightness: -10%);
    }
  }
}

.who-we-are-cards{
  display: flex;
  gap: 20px;
  margin-top: 20px;
  @media (max-width: 950px) {
    flex-direction: column;
  }

  .who-we-are-card{
    &.image-card{
      flex: 1;
      img{
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    &.d-flex{
      flex: 1;
      padding: 0px 20px;
      display: flex;
      flex-direction: column;
      justify-content: center;

      @media (max-width: 950px) {
        padding: 0;
      }

      p{
        font-size: map.get(vars.$font-sizes, xlarge);
        color: var(--text-color);
        line-height: 1.6;
      }
    }
  }
}

.section-subsection{
  .who-we-are-grid {
    margin-top: 20px;
    display: grid;
    .who-we-are-item{
      .display-icon{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 50px;
        height: 50px;
        border-radius: 9000px;
        background-color: var(--icon-gray);
        svg{
          font-size: map.get(vars.$heading-sizes, xlarge);
          color: vars.$primary-color;
        }
      }
      h4{
        margin-top: 10px;
        font-size: map.get(vars.$font-sizes, xlarge);
        color: var(--text-color);
      }
    }
  } 
}

.partners-section{
  .partners-logos{
    gap: 40px;
    flex-wrap: wrap;

    .partner-logo{
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
    }

    img{
      max-width: 150px;
      max-height: 80px;
      object-fit: contain;
      opacity: 0.8;
      transition: opacity 0.3s ease;
      @media (max-width: 600px) {
        max-width: 100px;
        max-height: 60px;
      }

      &:hover{
        opacity: 1;
      }
    }
  }
}

// 
.why-choose-use-section{
  gap: 100px;
  @media (max-width: 1180px) {
    gap: 50px;
  }
  @media (max-width: 1080px) {
    flex-direction: column;
    gap: 30px;
  }
  .why-choose-use-left{
    max-width: 600px;
    // max 1370px
    @media (max-width: 1370px) {
      max-width: 500px;
    }
    // 1210px
    @media (max-width: 1210px) {
      max-width: 450px;
    }
  }
  .why-choose-use-right{
    @media (max-width: 1370px) {
      
    }
    .why-choose-us-item{
      padding: 20px;
      background-color: var(--white);
      border-radius: 16px;
      .display-icon{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 50px;
        height: 50px;
        border-radius: 9000px;
        background-color: var(--icon-gray);
        svg{
          font-size: map.get(vars.$heading-sizes, xlarge);
          color: vars.$primary-color;
        }
      }
      .item-content{
        h4{
          font-size: map.get(vars.$heading-sizes, large);
          color: var(--text-color);
        }
        p{
          font-size: map.get(vars.$font-sizes, medium);
          color: var(--text-color);
          line-height: 1.6;}
      }
    }
  }
}

  .product-section{
  .product-display{
    display: flex;
    align-items: stretch;

    .product-info{
      flex: 0 0 45%;
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      @media (max-width: 1180px) {
        flex: 1 1 100%;
      }
    }

    &:nth-child(2){
      .product-info{
        flex: 1 1 55%;
      }
      @media (max-width: 1090px) {
        flex-direction: column;
      }
    }

    .product-image{
      flex: 1 1 55%;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 0; /* allow flex children to size correctly */
      @media (max-width: 1180px) {
        display: none;
      }

      img{
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: left;
      }
    }

    .sub-product-image{
      flex: 0 0 45%;
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: left;
      img{
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center;
      }
    }
  }

  /* mini 3-image grid for product showcase */
  .product-images-grid {
    display: flex;
    gap: 12px;
    margin: 20px 0;

    .product-image-small {
      
      overflow: hidden;
      background-color: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      transition: all 0.3s ease;
      cursor: pointer;

      img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center;
        transition: transform 0.3s ease;
      }

      &:hover {
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.02);

        img {
          transform: scale(1.05);
        }
      }
    }
  }

  .product-item-grid{
    @media (max-width: 600px) {
      grid-template-columns: 1fr !important;
    }
    .product-item{
      padding: 0px;
      border-radius: 16px;
      display: flex;
      gap: 10px;
      align-items: center;
      .display-icon{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 50px;
        height: 50px;
        border-radius: 9000px;
        background-color: var(--primary-color);
        svg{
          font-size: map.get(vars.$heading-sizes, xlarge);
          color: var(--white);
        }
      }
        h4{
          font-size: map.get(vars.$heading-sizes, large);

      /* prevent action buttons inside product display from shrinking */
      .btn {
        flex-shrink: 0;
        min-width: 140px;
        white-space: nowrap;
      }
          font-weight: map.get(vars.$font-weights, normal);
          color: var(--white);
        }
      
    }
  }

  .call-to-action{
      @media (max-width: 600px) {
        justify-content: center;
        flex-direction: column;
        .d-flex{
          padding: 20px;
        }
        button{
          align-self: flex-end;
        }
      }
    }
}

.testimonial-section{
  display: flex;
  gap: 40px;
  justify-content: space-between;
  @media (max-width: 1200px) {
    align-items: center;
  }
  @media (max-width: 1075px) {
    flex-direction: column-reverse;
    gap: 30px;
  }

  .testimonial-content{
    flex: 1 1 400px;
    // max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 30px;

    .testimonial-wrapper{
      display: flex;
      gap: 20px;
      align-items: center;

      .testimonial-slider-viewport {
        height: 220px; // adjust to fit ONE testimonial
        overflow: hidden;
        position: relative;
        border-radius: 16px;
        @media (max-width: 522px) {
          height: 320px; // adjust to fit ONE testimonial
        }

        .testimonial-slider-track {
          display: flex;
          flex-direction: column;
          transition: transform 0.4s ease;

          .testimonial-item {
            min-height: 220px; // same as viewport height
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 30px;
            background: var(--glass-bg);
            border-radius: 16px;
            gap: 12px;

            @media (max-width: 522px) {
              padding: 20px;
              min-height: 320px; // same as viewport height
            }

            .testimonial-rating {
              display: flex;
              align-items: center;
              gap: 6px;

              .iconify {
                font-size: map.get(vars.$heading-sizes, large);
                color: var(--gold); // or brand gold
                transition: transform 0.2s ease, color 0.2s ease;
              }
            }

            .testimonial-text {
              font-size: map.get(vars.$font-sizes, medium);
              color: var(--text-color);
              line-height: 1.6;
            }

          }
        }
      }


      .testimonial-slider-control{
        display: flex;
        flex-direction: column;
        gap: 20px;

        .nav-btn{
          background-color: var(--black);
          display: flex;
          justify-content: center;
          align-items: center;
          border-radius: 9000px;
          width: 42px;
          height: 42px;
          // rotate button for next
          
            transform: rotate(90deg);
          

          svg{
            width: 20px;
            height: 20px;
            color: var(--text-muted-color);
          }

          &.disabled{
            opacity: 0.5;
            cursor: not-allowed;
            background-color: transparent;
            border: 1px solid var(--light-gray);
          }

          &:hover{
            background-color: color.adjust(#000, $lightness: -10%);
          }
        }
      }
    }
  }

  .section-image{
    flex: 1 1 400px;
    @media (max-width: 1075px) {
      flex: 1 1 100%;
    }

    img{
      width: 100%;
      height: auto;
      display: block;
      object-fit: cover;
      object-position: center;
    }
  }
}

.newsletter-section{
  margin: auto;
  max-width: 1200px;
  position: relative;
  .newsletter-content{
    position: relative;
    overflow: hidden;
    // background-color: primary 24% opacity
    background-color: rgba(0, 101, 156, 0.24);
    padding: 40px;
    border-radius: 16px;
    @media (max-width: 768px) {
      padding: 20px;
    }
    

    .newsletter-form{
      position: relative;
      z-index: 1;
      @media (max-width: 600px) {
        flex-direction: column;
        button{
          padding: 10px;
        }
      }
      input{
        flex: 1;
        padding: 12px 16px;
        font-size: map.get(vars.$font-sizes, medium);
        border: none;
        outline: none;
        color: var(--black);
      }
    }

    .absolute-bg{
      position: absolute;
      bottom: -350px;
      right: -100px;
      width: 650px;
      opacity: 0.4;
      z-index: 0;
    }
  }
}