.type-width{
    flex: auto;
    width: 27.8%;
}

.kartu-type{
    border-radius: 15px;
    background: linear-gradient(to top, rgba(27, 27, 34, 1) 0%, rgba(21, 21, 25, 1) 100%);
    display: flex;
    flex-direction: column;
}

.kartu-type .card-header {
    display: flex;
    justify-content: center;
    border: none;
    position: relative; /* untuk posisi pseudo-element */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    aspect-ratio: 3 / 2;
    width: 100%;
    overflow: hidden;
}

.kartu-type .card-body{
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.kartu-type img{
    width: 40%;
    max-width: 184px;
    height: auto;
    margin: auto;
    color: #F2CD5C;
    transition: all .2s ease-in;
}

.kartu-type .img-card{
    width: 100%;
    display: flex;
    overflow: hidden;
    margin: auto;
    height: 100%;
    position: relative;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background: transparent;
}

.lihat-button {
    color: white;
    text-decoration: none;
    border-radius: 10px;
    display: flex;
    width: 89%;
    justify-content: center;
    padding: 10px 0;
    border: 1px solid #ACACAC;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    box-sizing: border-box;
    margin-top: auto; /* supaya tombol selalu di bawah */
    transition: all 0.4s ease-in;
}

.lihat-button:hover {
    background: linear-gradient(to top, rgba(242, 205, 92, 0.45) 0%, rgba(242, 205, 92, 0) 100%);
    border: 1px solid #F2CD5C;
}

@media(min-width: 992px){
    .kartu-type .card-header {
        height: 360px;
        max-height: 360px;
        flex: 0 0 auto;
    }

    .kartu-type:hover img{
        transform: translateY(23px) scale(1.20);
    }

    .kartu-type:hover{
        border: 1px solid #F2CD5C;
        transition: all .4s ease-in;
    }

    .kartu-type .card-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 78%;
        z-index: 2;
        transition: transform 0.4s ease;
        display: flex;
        justify-content: center;
        align-items: center;
        background: transparent;

        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .kartu-type .img-card img {
        width: 40%;
        max-width: 184px;
        height: auto;
        transition: transform 0.4s ease;
    }

    .kartu-type {
        position: relative;
        overflow: hidden;
        transition: border 0.4s ease;
        border: 1px solid transparent;
        z-index: 1;
        padding-top: 280px; /* kasih ruang agar content tidak tertutup header */
        display: flex;
        flex-direction: column;
        transition: transform 0.4s ease;
    }

    .kartu-type::after{
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        background: linear-gradient(180deg,  #151519 0%, #1B1B22 60%, rgba(242, 205, 92, .40) 100%);
        bottom: 0;
        z-index: -1;
        transition: opacity 0.4s ease;
    }

    .kartu-type:hover::after {
        opacity: 1;
    }

    .kartu-type .card-body h4,
    .kartu-type .card-body p{
        transform: translateY(60px);
    }

    .kartu-type .card-body h4,
    .kartu-type .card-body p,
    .kartu-type .lihat-button {
        transition: transform 0.4s ease, opacity 0.4s ease;
    }

    .kartu-type .lihat-button {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
        margin-top: auto;
    }

    .kartu-type:hover {
        border: 1px solid #F2CD5C;
    }

    .kartu-type:hover .card-header {
        transform: translateY(-70px); /* naik dan kasih ruang */
    }

    .kartu-type:hover .card-body h4,
    .kartu-type:hover .card-body p {
        transform: translateY(0px);
    }

    .kartu-type:hover .lihat-button {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

}

/* Tablet (≤ 992px) */
@media (max-width: 992px) {
  .type-width {
    flex: 1 1 45%;
    margin-bottom: 1rem;
  }

  .kartu-type .card-header {
    height: 240px;
    width: 100%;
  }

  .kartu-type img {
    width: 110px;
    height: auto;
  }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
  .type-width {
    width: 100%; /* 1 kartu per baris */
  }

  .kartu-type .card-header {
    height: 200px;
    width: 100%;
  }

  .kartu-type img {
    width: 100px;
    height: auto;
  }
}

@media (max-width: 512px) {
    #type{
        margin-top: 3rem;
    }
}

/* Extra Small Devices (≤ 400px) */
@media (max-width: 400px) {

  .kartu-type img {
    width: 90px;
    height: auto;
  }

  .kartu-type .card-header {
    height: 180px;
  }
}

/* Extra Extra Small Devices (≤ 320px) */
@media (max-width: 320px) {
  .kartu-type img {
    width: 80px;
  }

  .kartu-type .card-header {
    height: 160px;
  }

  .type-width {
    padding: 0 0.5rem;
  }
}
