.wrapper {
    position: relative;
    height: 100vh
}

.card {
    width: 100%;
    /* height: 500px; */
    background: transparent;
    position: absolute;
    margin: 0 auto;
    top:50%;
    transform: translateY(-50%);
    left:0;
    text-align: center;
    z-index: 11;
}
.hidecard {
    display: none;
}

.gift-card {
    /* margin-left: 4vw; */
    height: auto;
    width: 100%;
    background-size: contain;
    border-radius: 20px;
    width: 15vw !important;
    /* position: absolute; */
    left:50%;
    top:50%;
    transform: translate(-50%, -50%) rotateY(180deg);
    transform-style: preserve-3d;
    display: none;
    opacity: 0;
}

.gift-card-back, .gift-card-front {
    height: 100%;
    width: 100%;;
    position: absolute;
    top:0;
    left:0;
    backface-visibility: hidden;
}
.gift-card-back {
    background: url('./img/back.webp');
    background-size: contain;
    transform: rotateY(180deg);
}

.gift-card-front {
    background: url('./img/front.webp');
    background-size: contain;
    text-align: center;
    background-repeat: no-repeat;

}

.gift-card-image-code-chung {
    width: 68.26%;
}
.gift-card-text {
    margin-top: 1rem;
    text-align: center;
    position: absolute;
    width: 100%;
}


.gift-card-text img {
    width: 60%;
}
.gift-card.active {
    display: block;
    opacity: 0;
    /* opacity: 1 ; */
    animation: opengiftcard 0.4s linear 2.1s 1 forwards;
    /* transform: translate(-50%, -50%) rotateY(180deg) scale(0); */
}

.card-item-outer {
    position: relative;
    margin-left:  0.225%;
    margin-right:  0.225%;
    display: inline-block;
    height: 0 ;
    width: 11.3%;
    padding-bottom: 17.6%;
}


/* 
.card-item-outer::before{
    display: block;
    content: '';
    background: red;
    height: 50%;
    width: 10px;
    left: -6%;
    top: -6%;
    position: absolute;
} */


.card-item {
    /* position: absolute;
    width: 100%;
    height: 100%;
    background: url('./img/back.webp');
    background-size: contain;
    border-radius: 10px; */
    position: absolute;
    width: 100%;
    height: 100%;

}
.chia-bai .card-item-1 {
    left: 300%;
    top:-100vh;
    animation: chiabai 0.5s linear 0s 1 forwards;
}
.chia-bai .card-item-2 {
    left: 200%;

    top:-100vh;
    animation: chiabai 0.5s linear 0.4s 1 forwards;
}

.chia-bai .card-item-3 {
    left: 0%;
    top:-100vh;
    animation: chiabai 0.5s linear 0.8s 1 forwards;
}

.chia-bai .card-item-4 {
    left: -200%;

    top:-100vh;
    animation: chiabai 0.5s linear 1.2s 1 forwards;
}
.chia-bai .card-item-5 {
    left: -300%;
    top:-100vh;
    animation: chiabai 0.5s linear 1.6s 1 forwards;
}


.wrapper:not(.chia-bai) .card:not(.chon-bai) .card-item-outer:hover .card-item:not(.active) {
    cursor: pointer;
    /* Start the shake animation and make the animation last for 0.5 seconds */
    animation: shake 0.5s;
    /* When the animation is finished, start again */
    animation-iteration-count: infinite;
}

.card-item.active {
    animation: selecteCard 1s linear 1.5s 1 forwards;
}

.card-item.fadeout0 {
    animation: fadecardout1 0.5s linear 1s 1 forwards;
}
.card-item.fadeout1 {
    animation: fadecardout2 0.8s linear 1s 1 forwards;
}


.card-item.fadeout2 {
    animation: fadecardout3 0.7s linear 1s 1 forwards;
}


.card-item.fadeout3 {
    animation: fadecardout4 0.6s linear 1s 1 forwards;
}


.card-item.fadeout4{
    animation: fadecardout5 0.3s linear 1s 1 forwards;
}


.gift-card-image {
    /* transform: rotateY(180deg); */
    width: 100%;
    margin-top: 50px;
    opacity: 0;
}

.gift-card.active .gift-card-image, .gift-card.fit-popup .gift-card-image  {
    display: inline-block;
}

.gift-card.active .gift-card-image, .gift-card.fit-popup .gift-card-image-code-chung  {
    animation: giftcardimage 1s linear 2.3s 1 forwards;
    width: 68.26%;
    margin-top: 20%;
}


.fit-popup {
    /* position: relative; */
    display: block;
    animation: fitInPopup 0.1s linear 0s 1 forwards;
}

/* @keyframes selecteCard{
    0% { transform: translate(1px, 1px) rotate(0deg) scale(1); }
    10% { transform: translate(-1px, -7px) rotate(-1deg); }
    20% { transform: translate(-10px, 0px) rotate(-5deg); }
    30% { transform: translate(10px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -10px) rotate(10deg); }
    50% { transform: translate(-15px, 2px) rotate(-10deg); }
    60% { transform: translate(-20px, 1px) rotate(0deg) scale(1.3);}
    70% { transform: translate(15px, 1px) rotate(-15deg)  scale(1.3); }
    80% { transform: translate(-10px, -10px) rotate(20deg)  scale(1.3); opacity: 1;  }
    90% { transform: translate(1px,20px) rotate(-30deg) scale(1.3);  }
    100% { transform: translate(1px, -2px) rotate(0deg)  scale(1.3); opacity: 0; }
}  */

.card-row {
    width: 100%;
}

.card-col {
    width: 20%;
    float: left;
}

.ghost-hover:before, .ghost-hover:after{ 
    transform: rotate(40deg);
}

.ghost-hover:before{
    content: '';
    position: absolute;
    width: 100%;
    height: 50%;
    background: url(./img/ghost-card-hover.webp) no-repeat;
    background-size: contain;
    top: -10%;
    left: -50%;
    transition: 2s;
}

.ghost-hover:after{
    content: '';
    position: absolute;
    width: 100%;
    height: 50%;
    background: url(./img/ghost-card-hover.webp) no-repeat;
    background-size: contain;
    bottom: -10%;
    right: -50%;
    transform: scaleX(-1) scaleY(-1) rotate(40deg);
    transition: 2s;
    z-index: 11;
}

.ghost-hover {
    z-index: 11;
    position: absolute;
    height: 70%;
    width: 50%;
    top:50%;
    left:50%;
    transform: translate(-50%,-50%);
    opacity: 0;
    transition: 0.5;
    /* margin-right: -15%;
    margin-top: -15%; */
}
.ghost-hover:hover {
    cursor: pointer;
}

.card-item.active ~ .ghost-hover {
    opacity: 0;
    animation: ghostHoverAndFadeOut 2s linear 0.2s 1 forwards;
}
.card-item-outer:hover .card-item:not(.active) ~ .ghost-hover {
    animation: ghostHover 2s linear 0s infinite;
}

.card-item-outer:hover .card-item:not(.active) ~ .ghost-hover::before {
    animation: ghostTop 1s linear 0s infinite;
}

.card-item-outer:hover .card-item:not(.active) ~ .ghost-hover::after {
    animation: ghostBottom 1s linear 0s infinite;
}

.card-item-outer:hover .card-item::before, .card-item.active::before{
    animation: cardBackgroundBriness 1s linear 0s infinite;
}

.card-item-outer:hover .card-item::after, .card-item.active::after {
    animation: cardBackgroundBriness1 1s linear 0s infinite;
}
.card-item-logo {
    transform: translate(-50%,-50%);
    position: ABSOLUTE;
    top: 50%;
    left: 50%;
    width: 51.3%;
    transition: 0.5s;
    opacity: 0.2;
}

.card-item-outer:hover .card-item-logo{
    opacity: 0.6;
}

.card-item::before {
    display: block;
    content: '';
    position: absolute;
    background: #ffd96f;
    height: 83%;
    width: 98%;
    top: 9.6%;
    z-index: 1;
    border-radius: 10%;
}

.card-item::after {
    display: block;
    content: '';
    position: absolute;
    background:#ffd96f;
    height: 55%;
    width: 45%;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    border-radius: 30%;
}

.card-item-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url(./img/back.webp) no-repeat;
    background-size: contain;
    border-radius: 10px;
    z-index: 3;
}


.lighting-hover {
    height: 95%;
    width: 95%;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    background: yellow;
    position: absolute;
    border-radius: 12%;
}


@media only screen and (max-width: 720px) {

    .gift-card {
        overflow-y: unset;
        margin-left: 0vw;
        width: 97% !important;
    }

    .content-detail-card {
        font-size: 3vw;
        height: 92%;
        margin-left: 5%;
        overflow-y: auto;
    }
/* 
    .card-item-1::before{
        animation: cardBackgroundBriness 1s linear 0s infinite;
    }

    .card-item-1::after {
        animation: cardBackgroundBriness1 1s linear 0s infinite;
    }

    .card-item-2::before{
        animation: cardBackgroundBriness 1s linear 0s infinite;
    }

    .card-item-2::after {
        animation: cardBackgroundBriness1 1s linear 0s infinite;
    }

    .card-item-3::before{
        animation: cardBackgroundBriness 1s linear 0s infinite;
    }

    .card-item-3::after {
        animation: cardBackgroundBriness1 1s linear 0s infinite;
    }

    .card-item-4::before{
        animation: cardBackgroundBriness 1s linear 0s infinite; */
    /* }

    .card-item-4::after {
        animation: cardBackgroundBriness1 1s linear 0s infinite;
    }

    .card-item-5::before{
        animation: cardBackgroundBriness 1s linear 0s infinite;
    }

    .card-item-5::after {
        animation: cardBackgroundBriness1 1s linear 0s infinite;
    } */

    .card-item::before {
        display: block;
        content: '';
        position: absolute;
        height: 84%;
        width: 98%;
        top: 9%;
        z-index: 1;
        border-radius: 10%;
    }
    /* .card {
        padding-top: 65%;
    } */
    .card-item-outer {
        margin-top: 0;
        margin-bottom:  2.12%;
        margin-left: 1.106770833%;
        margin-right: 1.106770833%;
        width: 26.5625%;
        height:0;
        padding-bottom: 40.88541667%;
    }
 }
 