
:root{
    --blue: #070036;
    --pink: #e76f51;
}

* {
    border: none;
}

*:not(dialog){
    margin: 0;
}

a{
    text-decoration: none;
    color: currentColor;
}

button{
    font-family: inherit;
    user-select: none;
    cursor: pointer;
}

input, button, textarea{
    outline: none;
    appearance: none;
    background: none;
}

input, textarea{
    font-size: 16px;
}


fieldset, input, ul, button, dialog, textarea{
    padding: 0;
}

textarea {
    resize: none;
}

[contenteditable]{ 
    outline: none;
}

li{
    list-style: none;
}



header{

    height: 128px;
    width: 100%;
    background-color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: white;
    position: fixed;
    z-index: 1000;
    box-sizing: border-box;

    img{
        height: 72px;
        width: auto;
    }

    &.overlay{
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    }

}


nav{

    display: flex;

    >a{

        cursor: pointer;
        font-weight: 600;
        opacity: .7;

        &:not(:last-of-type){
            border-right: 2px solid #fff;
            padding-right: 12px;
        }

        &:not(:first-of-type){
            padding-left: 12px;
        }
    }

}


.container{

    min-height: calc(100vh - 128px - 48px);
    padding: 24px;
    position: relative;
    padding-top: 128px;

    .overlay{
        position: absolute;
        background: #fff;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: grid;
        place-content: center;
        visibility: hidden;

        &.overlay-show{
            visibility: visible;
        }

    }

}


.cards{

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 48px;

}


.card{

/* Use this: */
/* https://www.linkedin.com/pulse/how-create-responsive-grid-layout-under-10-lines-css-ross-baker */
/* grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); */



    .card-details{

        width: 100%;
        border-radius: 12px;
        overflow: hidden;

        >div:first-of-type{
            height: 240px;
            background-color: #264653;
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            border: 1px solid #264653;
            border-radius: 12px 12px 0 0;
            border-bottom: 0;
        }

        >div:last-of-type{
            background: #e76f51;
            color: white;
            padding: 12px;

            .title,
            .price{
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .title{
                font-weight: bold;
                font-size: 14px;
            }

            .price{
                font-size: 21px;
            }

            >div{
                height: 36px;
                padding-top: 12px;

                >a
                {
                    height: inherit;
                    width: 100%;
                    display: grid;
                    place-content: center;
                }

                >button{
                    height: inherit;
                    width: 100%;
                    border: 1px solid #fff;
                    color: #fff;
                }

            }

        }

    }

}


.banner{
    width: 100%;
    height: 400px;
    background: url("banner.jpg") no-repeat center;
    background-size: cover;
    margin-bottom: 48px;
    margin-top: 24px;
    border-radius: 12px;
}


@keyframes spinner-anim {
    to {transform: rotate(360deg);}
}


.spinner{

    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #ccc;
    border-top-color: #264653;
    animation: spinner-anim .6s linear infinite;

}


button.pill{

    color: #fff;
    height: 48px;
    border-radius: 24px;
    padding: 0 32px;
    font-size: 14px;
    transition: all 100ms linear;
    
    &.primary{
        background: #e76f51;
    }

    &.secondary{
        background: #a1a1a1;
    }

    &:hover{
        opacity: .7;
    }

}


button.outline{

    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    height: 48px;
    padding: 0 24px 0 12px;
    transition: all 100ms linear;
    border: 1px solid #fff;

    &:hover{
        opacity: .7;
        background-color: rgba(255, 255, 255, 0.1);
    }

    span{
        white-space: nowrap;
        font-size: 14px;
    }

    svg{
        width: 18px;
        height: auto;
        fill: currentColor;
    }

}



dialog{

    box-shadow: 0 0 16px rgba(0, 0, 0, 0.75);
    width: 720px;
    height: 480px;
    border-radius: 20px;
    overflow: hidden;
    outline: none;

    >header{
        height: 72px;
        padding: 0 12px;

        h3{
            font-size: 14px;
        }

        >a{
            width: 36px;
            height: 36px;
            display: grid;
            place-content: center;
            overflow: hidden;
            border-radius: 50%;
            transition: all 100ms linear;
            cursor: pointer;

            &:hover{
                opacity: .7;
                background-color: rgba(255, 255, 255, 0.1);
            }

            >svg{
                width: 20px;
                height: auto;
                fill: currentColor;
            }
        }

    }


    >form{
        height: calc(100% - 144px);
        box-sizing: border-box;
        padding: 12px;
        padding-bottom: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 72px 1fr;
        gap: 32px;

        .upload{
            grid-column: 1 / 3;
            color: #264653;
            position: relative;

            >div{

                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                position: absolute;
                z-index: 1000;
                visibility: hidden;

                &.show{
                    visibility: visible;
                }

                &.upload--dropzone{
                    opacity: .5;
                    display: grid;
                    place-content: center;
                    border: 2px dashed #264653;
                    border-radius: 12px;
                    user-select: none;
                    cursor: pointer;

                    &.drag-over{
                        opacity: 1;
                    }

                }

                &.upload--complete{
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    gap: 24px;
                }

            }

        }

        .field{

            display: flex;
            flex-direction: column;
            align-items: stretch;
            border-bottom: 1px solid #264653;

            >label{
                font-size: 13px;
                font-weight: bold;
            }

            >input{
                height: 100%;
                font-size: 19px;
            }

        }

    }


    footer{
        height: 72px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;

        >p{
            color: red;
            display: flex;
            align-items: center;
            gap: 8px;
            visibility: hidden;
            
            svg{
                width: 18px;
                height: auto;
                fill: currentColor;
            }
            
            >span{
                font-size: 14px;
                white-space: nowrap;
            }

        }


        >nav{
            display: flex;
            align-items: center;
            gap: 12px;

            .secondary{
                visibility: hidden;
            }

            .show{
                visibility: visible;
            }

        }

    }


    &::backdrop{
        background-color: rgba(0, 0, 0, 0.5);
    }

}


footer{

    height: 96px;
    margin: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid black;

    >span{
        display: flex;
        align-items: center;
        gap: 9px;

        >svg{
            width: 20px;
            height: auto;
            fill: black;
        }

        >a{
            font-weight: 600;
            font-size: 13px;
            border-bottom: 2px dotted black;
        }

    }


}
