/* SHOPPING CART */

#cart {
    column-gap: 50px;
    display: flex;
    padding: 50px 0;
    
    /* cart items */
    &>div:nth-child(1) {
        flex: 1;
        
        #cartItems {
            display: flex;
            flex-direction: column;
            row-gap: 2px;
            
            .cartItem {
                align-items: center;
                border-bottom: 2px solid #d6dee5;
                column-gap: 10px;
                display: flex;
                padding: 15px 20px;
                
                a {
                    color: #000;
                    font-weight: 400;
                }
                
                &>div {
                    &:nth-child(1) {
                        flex: 0 0 80px;
                        text-align: center;
                    }
                    
                    &:nth-child(2) {
                        flex: 1;
                    }
                    
                    &:nth-child(3),
                    &:nth-child(4),
                    &:nth-child(5) {
                        font-feature-settings: 'tnum';
                        text-align: center;
                    }
                    
                    &:nth-child(3),
                    &:nth-child(5) {
                        flex: 0 0 150px;
                    }
                    
                    &:nth-child(4) {
                        flex: 0 0 150px;
                    }
                    
                    &:nth-child(5) {
                        color: #275bc3;
                        font-weight: 700;
                    }            
                }
            }
        }
        
        #cartUpdate {
            padding: 30px;
            text-align: right;
        }
    }
    
    /* SIDEBAR */
    
    &>div:nth-child(2) {
        flex: 0 0 350px;
        text-align: center;
        
        #cartSidebar {
            border-radius: 10px;
            padding: 30px 0;
            
            hr {
                border-bottom-color: #fff;
            }
        
            #cartCouponHeading {
                font-size: 18px;
                font-weight: 600;
                margin-bottom: 5px;
            }
            
            #cartCouponCode {
                color: #275bc3;
                font-feature-settings: 'tnum';
                font-size: 18px;
                font-weight: 700;
                margin: 7px 0;
                text-transform: uppercase;
            }
            
            #cartCouponField {
                font-size: 17px;
                margin-bottom: 10px;
                text-align: center;
                text-transform: uppercase;
                width: 250px;
            }
            
            .cartSidebarAmount {
                column-gap: 20px;
                display: flex;
                font-feature-settings: 'tnum';
                font-size: 17px;
                margin: 15px 0;
                
                &>div:nth-child(1) {
                    flex: 1;
                    font-weight: 600;
                }
                
                &>div:nth-child(2) {
                    color: #275bc3;
                    flex: 1;
                    font-weight: 700;
                }
            }
            
            #cartSidebarCoupon {
                background: #e9f1f7;
                border-top-left-radius: 10px;
                border-top-right-radius: 10px;
                padding: 30px 0;
            }
            
            #cartSidebarCheckout {
                background: #d6dee5;
                border-bottom-left-radius: 10px;
                border-bottom-right-radius: 10px;
                padding: 30px 0;
                
                .btnCheckout:before {
                    content: "\f023";
                    font-family: 'Font Awesome 6 Free';
                    font-weight: 700;
                    margin-right: 10px;
                }
            }
        }
    }
}


/* OVERLAY BLUR */

#checkout-overlay {
    background: rgb(255 255 255 / 50%);
    backdrop-filter: blur(5px);
    color: #275bc3;
    font-size: 20px;
    font-weight: 800;
    height: 100%;
    left: 0;
    padding-top: 50px;
    position: absolute;
    text-align: center;
    top: 0;
    width: 100%;
}


/* CHECKOUT */

#checkout {
    color: #000;
    column-gap: 35px;
    display: flex;
    font-family: var(--font);
    padding: 10px 0 40px 0;
    
    /* MAIN COLUMN */
    
    #checkout-main {
        flex: 1;
        font-size: 16px;
        padding: 10px 0;
        position: relative;
        
        .checkout-title {
            border-bottom: 3px dashed #eee;
            color: #275bc3;
            font-size: 25px;
            font-style: italic;
            font-weight: 600;
            line-height: 1.3em;
            margin: 0 0 30px 0;
            padding: 15px 0;
        }
        
        .option {
            padding: 15px 0;
        }
        
        .fields {
            padding: 5px 0 5px 36px;
        }
        
        ul.options {
            list-style: none;
            margin: 0;
            padding: 0;
            
            li {
                margin: 0;
                padding: 15px 0;

                div {
                    padding: 5px 0 0 36px;
                }
            }
        }
        
        label {
            cursor: pointer;
            font-size: 17px;
            font-weight: 500;
            line-height: 1;
            
            &:hover {
                color: #275bc3;
            }
            
            &:has(input:checked) {
                color: #275bc3;
                font-weight: 600;
            }
        }
        
        input[type=checkbox],
        input[type=radio] {
            accent-color: #275bc3;
            cursor: pointer;
            height: 20px;
            margin: 0 15px 0 0;
            vertical-align: middle;
            width: 20px;
        }
        
        #checkoutItems {
            &>div {
                align-items: center;
                border-bottom: 3px dashed #eee;
                display: flex;
                margin: 10px 0;
                padding-bottom: 10px;
                
                &>div {
                    box-sizing: border-box;
                    padding: 0 15px;
                }
                
                &>div:nth-child(1) {
                    flex: 0 0 80px;
                    text-align: center;
                }
                
                &>div:nth-child(2) {
                    flex: 1;
                    font-weight: 700;
                    
                    span {
                        color: #333;
                        display: block;
                        font-feature-settings: 'tnum';
                        font-weight: 500;
                    }
                }
                
                &>div:nth-child(3),
                &>div:nth-child(4),
                &>div:nth-child(5) {
                    border-left: 1px dashed #d6dee5;
                    font-feature-settings: 'tnum';
                    text-align: center;
                }
                
                &>div:nth-child(3),
                &>div:nth-child(5) {
                    flex: 0 0 150px;
                }
                
                &>div:nth-child(4) {
                    flex: 0 0 100px;
                }
                
                &>div:nth-child(5) {
                    color: #275bc3;
                    font-weight: 700;
                }
            }
        }
        
        #checkoutTotals {
            padding-top: 20px;
            
            &>div {
                display: flex;
                gap: 20px;
                margin: 5px 0;

                &.hl {
                    color: #275bc3;
                    font-size: 16px;
                    font-weight: 700;
                }
                
                &>div:first-child {
                    flex: 1;
                    text-align: right;
                }
                
                &>div:last-child {
                    flex: 0 0 130px;
                    font-feature-settings: 'tnum';
                    text-align: right;
                }
            }
        }
        
        #checkoutFee {
            display: none;
            font-size: 18px;
            margin-top: 25px;
            text-align: center;
            
            strong {
                color: #275bc3;
            }
        }
    }
    
    /* SIDEBAR */
    
    #checkoutSidebar {
        background: #f5f5f5;
        border-radius: 10px;
        flex: 0 0 300px;
        font-size: 15px;
        font-weight: 500;
        line-height: 22px;
        text-align: center;
        
        #checkoutSidebarTitle {
            display: none;
        }
       
        .checkoutSidebarBlock {
            padding: 20px 15px;
            
            .checkoutSidebarBlockTitle {
                color: #275bc3;
                font-style: italic;
                font-weight: 600;
            }
            
            .blueBtn {
                margin-top: 10px;
            }
            
            &+.checkoutSidebarBlock {
                border-top: 2px solid #fff;
            }
        }
    }
}


/* MOBILE DEVICES */

@media only screen and (max-width: 1000px) 
{
    #cart {
        flex-direction: column;
        
        &>div:nth-child(1) {
            #cartItems {
                .cartItem {
                    flex-wrap: wrap;
                    padding-left: 0;
                    padding-right: 0;
                    row-gap: 10px;
                    
                    &>div {
                        &:nth-child(1) {
                            flex: 0 0 100%;
                            text-align: center;
                        }
                        
                        &:nth-child(2) {
                            flex: 0 0 100%;
                            text-align: center;
                        }
                        
                        &:nth-child(3) {
                            border-left-width: 0;
                        }
                        
                        &:nth-child(3),
                        &:nth-child(4),
                        &:nth-child(5) {
                            flex: 1;    
                        }
                    }
                }
            }
            
            #cartUpdate {
                text-align: center;
            }
        }
        
        &>div:nth-child(2) {
            flex: 1;
        }
    }
    
    #checkout {
        flex-direction: column-reverse;
        flex-wrap: wrap;
        
        #checkoutSidebar {
            #checkoutSidebarTitle {
                color: #275bc3;
                cursor: pointer;
                display: block;
                font-size: 18px;
                font-weight: 700;
                text-decoration: none;
                
                &:after {
                    content: "\f054";
                    display: inline-block;
                    font-family: 'Font Awesome 5 Free';
                    margin-left: 8px;
                    width: 15px;
                }
                
                &.active:after {
                    content: "\f078";
                }
            }
            
            #checkoutSidebarContent {
                display: none;
            }
        }
    }
}

@media only screen and (max-width: 850px) 
{
    #checkout {
        padding: 10px;
        row-gap: 30px;
        
        #checkout-main {
            box-sizing: border-box;
            padding: 10px;
            
            .columns {
                flex-direction: column;
                gap: 0;
            }
            
            .fields {
                padding-left: 5px;;
            }
            
            .field-row {
                &>span:first-child {
                    display: block;
                    padding-bottom: 5px;
                    width: 100%;
                }
            }
            
            .field {
                row-gap: 10px;
                flex-direction: column;
                padding: 10px 0;
                
                &>div:first-child,
                &>div:last-child {
                    align-self: flex-start;
                    flex: 1;
                    line-height: 1;
                    width: 100%;
                }
            }
            
            input[type=text],
            input[type=number],
            select {
                font-size: 16px;
                height: 45px;
            }
            
            input[type=text],
            input[type=number] {
                padding: 0 10px;
                width: 100%;
            }
            
            select {
                padding: 0 10px;
                max-width: 100%;
            }
            
            #checkoutItems {
                &>div {
                    flex-wrap: wrap;
                    row-gap: 10px;
                    
                    &>div {
                        padding: 0;
                    
                        &:nth-child(1) {
                            flex: 0 0 100%;
                            text-align: center;
                        }
                        
                        &:nth-child(2) {
                            border-left: none;
                            flex: 0 0 100%;
                            font-size: 16px;
                            text-align: center;
                        }
                        
                        &:nth-child(3),
                        &:nth-child(4),
                        &:nth-child(5) {
                            border-left: 0;
                            flex: 1;
                        }
                        
                        &:nth-child(3),
                        &:nth-child(4) {
                            border-right: 1px dashed #d6dee5;
                        }
                    }
                }
            }
            
            #checkoutTotals {
                padding: 10px;
                
                &>div {
                    gap: 10px;
                
                    &>div:last-child {
                        flex: 0 0 110px;
                    }
                }
            }
        }
        
        #checkoutSidebar {
            flex: 0;
            padding: 10px;
            
            #checkout-summary-content {
                display: none;
            }
        }
    }
}