#red-envelope{
    position: absolute;
    background-color: #FFFAF5 !important;
    top: 0px; 
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    min-height: 380px;
    margin: auto;
}

/* on desktop, increase top and bottom margin */
@media only screen and (min-width: 660px){
    #red-envelope{
        top: 60px;
        bottom: 80px;
        max-width: 660px;
        border-radius: 4px;
    }
}

#red-envelope .title{
    width: 100%;
    height: 50px;
    position: relative;
    background-color: #D84E43;
}

#red-envelope .title .close{
    float: left;
    width: 50px;
    height: 100%;
    background-image: url(/images/ui/close-yellow.svg);
    background-size: 14px 14px;
    top: 0; right: 0;
    cursor: pointer;
}

/* on mobile, replace X by < */
@media only screen and (max-width: 780px){
    #red-envelope .title .close{
        background-image: url(/images/ui/prev-yellow.svg);
        background-size: 16px 16px;
    }
}

#red-envelope .title .close:active{
    opacity: 0.6;
}

#red-envelope .title .bar{
    position: absolute;
    width: 1px;
    height: 45%;
    top: 0; bottom: 0; left: 51px;
    margin-top: auto;
    margin-bottom: auto;
    background-color: #FFE2B1;
}

#red-envelope .title .text{
    float: left;
    color: #FFE2B1;
    height: 100%;
    margin-left: 20px;
}

#red-envelope .title .text .big{
    font-size: 16px;
    line-height: 20px;
    height: 20px;
    margin-top: 6px;
}

#red-envelope .title .text .sub{
    font-size: 12px;
    line-height: 20px;
    height: 20px;
}

#red-envelope .main{
    position: absolute;
    top: 50px; left: 0; right: 0; bottom: 0;
    margin: auto;
}

#red-envelope .input-box{
    margin: 20px;
    margin-bottom: 0;
    background-color: white;
    height: 50px;
    line-height: 50px;
}

#red-envelope .input-box .left{
    float: left;
    margin-left: 20px;
}

#red-envelope .input-box .right{
    float: right;
    margin-right: 20px;
}

#red-envelope .input-box .input{
    border: 0;
    padding: 0;
    margin-top: 0; margin-left: 0; margin-bottom: 0;
    outline: none;
    overflow: hidden;
    resize: none;
    height: 100%;
    line-height: inherit;
    /*background-color: gray;*/
}

#red-envelope .amount .input{
    float: right;
    margin-right: 5px;
}

#red-envelope .amount-preview{
    text-align: center;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 30px;
    font-size: 34px;
}

#red-envelope .confirm-amount{
    margin-left: 30px;
    margin-right: 30px;
    color: white;
    background-color: #D84E43;
    border-radius: 3px;
    height: 50px;
    line-height: 50px;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
}

#red-envelope .confirm-amount:not([disabled]):active{
    background-color: #AD3E35;
}

#red-envelope .confirm-amount[disabled]{
    color: rgba(255,255,255,0.6);
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/* confirm payment popup */
#pay-confirm{
    position: absolute;
    top: 0; bottom: 0; 
    left: 20px; right: 20px; 
    margin: auto;
    height: 249px;
    width: 360px;
    background-color: rgba(255,255,255,0.98);
    border-radius: 3px;
}

@media only screen and (max-width: 400px){
    #pay-confirm{
        width: auto;
    }
}

#pay-confirm .title{
    width: 100%;
    line-height: 50px;
    height: 50px;
    border-bottom: 1px solid #8ad3dd; /* green: 8ce6a3 */
    text-align: center;
    font-size: 16px;
}

#pay-confirm .close{
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url(/images/ui/close-black.svg);
    background-size: 12px 12px;
    top: 0; left: 0;
    cursor: pointer;
    opacity: 0.2;
}
#pay-confirm .close:active{
    opacity: 0.12;
}

#pay-confirm .item-name{
    font-size: 11px;
    text-align: center;
    line-height: 20px;
    margin-top: 10px;
    margin-bottom: 2px;
}

#pay-confirm .item-price{
    margin-bottom: 12px;
    font-size: 26px;
    line-height: 32px;
    text-align: center;
}

#pay-confirm .pay-method{
    border-top: 1px solid #E1E6E8;
    border-bottom: 1px solid #E1E6E8;
    height: 50px;
    line-height: 50px;
    margin-left: 15px;
    margin-right: 15px;
    position: relative;
    cursor: pointer;
}

#pay-confirm .pay-method:active{
    background-color: #E1E6E8;
}

#pay-confirm .pay-method .brand{
    position: absolute;
    top: 0; bottom: 0; left: 10px;
    width: 30px;
    height: 30px;
    margin-top: auto;
    margin-bottom: auto;
}

#pay-confirm .pay-method .name{
    position: absolute;
    font-size: 13px;
    top: 0; bottom: 0;
    left: 51px;
}

#pay-confirm .pay-method .name .detail{
    margin-left: 5px;
}

#pay-confirm .pay-method .more{
    position: absolute;
    top: 0; bottom: 0; right: 7px;
    width: 12px;
    height: 12px;
    margin-top: auto;
    margin-bottom: auto;
    background-image: url(/images/ui/prev-black.svg);
    moz-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    transform: scaleX(-1);
    -ms-filter: fliph; /*IE*/
    filter: fliph; /*IE*/
    opacity: 0.2;
}

#pay-confirm .confirm{
    margin-top: 13px;
    margin-left: 15px;
    margin-right: 15px;
    border-radius: 3px;
    height: 46px;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    /*background-color: #06BE04;*/
    /*color: white;*/
}

#pay-confirm .confirm:active{
    /*background-color: #029300;*/
}


/* change payment popup */
#change-pay{
    position: absolute;
    top: 0; bottom: 0; 
    left: 20px; right: 20px; 
    margin: auto;
    height: 249px;
    width: 360px;
    background-color: rgba(255,255,255,0.98);
    border-radius: 3px;
}

@media only screen and (max-width: 400px){
    #change-pay{
        width: auto;
    }
}

#change-pay .title{
    width: 100%;
    line-height: 50px;
    height: 50px;
    border-bottom: 1px solid #8ad3dd; /* green: 8ce6a3 */
    text-align: center;
    font-size: 16px;
}

#change-pay .close{
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url(/images/ui/close-black.svg);
    background-size: 12px 12px;
    top: 0; left: 0;
    cursor: pointer;
    opacity: 0.2;
}
#change-pay .close:active{
    opacity: 0.12;
}

#change-pay .methods{
    margin-top: 5px;
    overflow: auto;
    padding: 0;
    max-height: 228px;
}

#change-pay .methods .block:first-child{
    border-top: 0;
}

#change-pay .block{
    border-top: 1px solid #d9dfe0;
    height: 50px;
    line-height: 50px;
    margin-left: 15px;
    margin-right: 15px;
    position: relative;
    cursor: pointer;
    overflow: hidden; /* without this, container will have a weird extra height */
}

#change-pay .block:active{
    background-color: #E1E6E8;
}

#change-pay .method .brand{
    position: absolute;
    top: 0; bottom: 0; left: 10px;
    width: 30px;
    height: 30px;
    margin-top: auto;
    margin-bottom: auto;
}

#change-pay .method .name{
    position: absolute;
    font-size: 13px;
    top: 0; bottom: 0;
    left: 51px;
}

#change-pay .method .name .detail{
    margin-left: 5px;
}

#change-pay .method .check{
    position: absolute;
    top: 0; bottom: 0; right: 10px;
    width: 16px;
    height: 16px;
    border-radius: 100px;
    margin-top: auto;
    margin-bottom: auto;
    border: 2px solid #ccd1d4;
}

#change-pay .method.checked .check{
    background-color: #06BFAC;
    background-size: 8px 8px;
    background-image: url(/images/payment/check.svg);
    border: 0;
}

#change-pay .add-method{
    text-align: center;
    margin-bottom: 5px;
}



#process-pay{
    display: none;
    background-color: rgba(0,0,0,0.60);
}

#process-pay .icon{
    background-image: url(/images/payment/secure-payment.svg);
}

#add-pay{
    top: 0px; 
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    min-height: 380px;
    margin: auto;
}

/* on desktop, increase top and bottom margin */
@media only screen and (min-width: 660px){
    #add-pay{
        top: 60px;
        bottom: 80px;
        max-width: 660px;
        border-radius: 4px;
    }
}

#add-pay .title{
    width: 100%;
    line-height: 50px;
    height: 50px;
    border-bottom: 1px solid #E1E6E8;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
}

#add-pay .close{
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url(/images/ui/close-black.svg);
    background-size: 12px 12px;
    top: 0; right: 0;
    cursor: pointer;
}

#add-pay .close:active{
    opacity: 0.5;
}

/* on mobile, replace X by < */
@media only screen and (max-width: 440px){
    #add-pay .close{
        background-image: url(/images/arrow/prev-black.svg);
        top: -1px; left: 0px;
        background-size: 14px 14px;
    }
}

#add-pay .main{
    top: 50px; left: 0; right: 0; bottom: 0;
    width: 100%;
    position: absolute;
    background-color: #f6f8f8;
    display: none;
}

#add-pay .methods{
    margin-top: 20px;
    border-top: 1px solid #E1E6E8;
    background-color: white;
}

#add-pay .method{
    overflow: hidden;
    border-bottom: 1px solid #E1E6E8;
    cursor: pointer;
    position: relative;
}

#add-pay .method:active{
    background-color: #fafafa;
}

#add-pay .method .left{
    float: left;
    width: 70px;
    height: 66px;
    position: relative;
}

#add-pay .method .left .icon{
    position: absolute;
    top: 0; right: 0; left: 0; bottom: 0;
    margin: auto;
    width: 32px;
    height: 32px;
}

#add-pay .method[data-method='card'] .left .icon{ background-image: url(/images/payment/card2.svg); }
#add-pay .method[data-method='paypal'] .left .icon{ background-image: url(/images/payment/paypal2.png); width: 32px; height: 32px; }

#add-pay .method .right{
    margin-left: 60px;
    padding-right: 50px;
    padding-bottom: 10px;
}

#add-pay .method .right .name{
    margin-top: 11px;
    margin-bottom: 3px;
    font-size: 15px;
    line-height: 24px;
}

#add-pay .method .right .info{
    overflow: hidden;
    color: #919599;
    font-size: 11px;
}

#add-pay .method .check{
    position: absolute;
    top: 0; bottom: 0; right: 15px;
    margin-top: auto;
    margin-bottom: auto;
    width: 20px;
    height: 20px;
    border-radius: 100px;
    border: 1px solid #ccd1d4;
}

#add-pay .method.checked .check{
    background-color: #06BFAC;
    background-size: 10px 10px;
    background-image: url(/images/payment/check.svg);
    border: 0;
}

#add-pay .confirm-method{
    margin-top: 35px;
}

#add-pay  .black-btn{
    margin-left: 20px; 
    margin-right: 20px;
}

#add-pay .black-btn-notice{
    margin-left: 20px;
    margin-right: 20px;
    height: 40px;
    margin-top: 10px;
}

#add-pay .select-method{
    display: block;
}

#add-pay .card-detail{

}

#add-pay .card-error{
    padding: 10px;
    display: none; 
    color: #ed0000;
    font-weight: 600;
    text-align: center;
    background-color: #ffcece;
}

#add-pay .fields{
    padding: 20px;
    overflow: hidden;
}

#add-pay .field{
    overflow: hidden;
}

#add-pay .field .field-name{
    margin-bottom: 6px;
    margin-left: 5px;
    font-size: 12px;
    font-weight: 600;
}

#add-pay .card-number{
    margin-bottom: 15px;
}

#add-pay .exp-month, #add-pay .exp-year, #add-pay .cvv{
    width: -ms-calc(33.33% - 10px);
    width: -moz-calc(33.33% - 10px);
    width: -webkit-calc(33.33% - 10px);
    width: -o-calc(33.33% - 10px);
    width: calc(33.33% - 10px);
    margin-right: 10px;
    float: left;
}
#add-pay .cvv{
    margin-right: 0;
}

#add-pay .triple-fields{
    overflow: hidden;
    margin-right: -10px;
}


#add-pay .add-card{
    margin-top: 2px;
}

#pay-detail{
    top: 0px; 
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    min-height: 380px;
    margin: auto;
    display: none;
}

/* on desktop, increase top and bottom margin */
@media only screen and (min-width: 660px){
    #pay-detail{
        top: 60px;
        bottom: 80px;
        max-width: 660px;
        border-radius: 4px;
    }
}

#pay-detail .title{
    width: 100%;
    line-height: 50px;
    height: 50px;
    border-bottom: 1px solid #E1E6E8;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
}

#pay-detail .close{
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url(/images/ui/close-black.svg);
    background-size: 12px 12px;
    top: 0; right: 0;
    cursor: pointer;
}

#pay-detail .close:active{
    opacity: 0.5;
}

/* on mobile, replace X by < */
@media only screen and (max-width: 440px){
    #pay-detail .close{
        background-image: url(/images/arrow/prev-black.svg);
        top: -1px; left: 0px;
        background-size: 14px 14px;
    }
}

#pay-detail .success-icon{
    background-image: url(/images/payment/success.svg);
    background-color: #3FB838;
    background-size: 60% 60%;
    border-radius: 100px;
    width: 94px;
    height: 94px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 30px;
}

#pay-detail .main-text{
    text-align: center;
    margin-top: 22px;
    font-size: 18px;
    margin-left: 20px;
    margin-right: 20px;
}

#pay-detail .amount{
    margin-top: 12px;
    text-align: center;
    font-size: 40px;
}

#pay-detail .bottom{
    color: #919599;
    font-size: 12px;
    text-align: center;
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    overflow: hidden;
}

#pay-detail .bottom > div{
    margin-top: 8px;
}


