/*
* Gruppuppgift: E-shop
* Grupp 4 / FaceRoots
* Oscar Nilsson
* oscar.nilsson@medieinstitutet.se
*/

:root {
    --gridColGap: 2rem;
    --productCardBoxShadow: 
    rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, 
    rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
    --btnBorderRadius: var(--radius-sm);
    --btnBgColor: var(--color-brown-dark);
    --btnColor: var(--color-white);
}

nav.nav-header > div.nav-right > button {
    cursor: pointer;
}

div#shoppingCart {
    position: absolute;
    right: 0;
    display: flex;

    flex-direction: column;
    align-items: end;
    gap: .5em;
    padding: calc(var(--gridColGap) / 2);
    /* border: 1px solid; */
    background-color: #fff;
    box-shadow: var(--productCardBoxShadow);
    border-bottom-left-radius: var(--borderRadius);
    border-bottom-right-radius: var(--borderRadius);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .25s ease, visibility 0s linear .25s;

    &.open { 
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .25s ease, visibility;
    }

    & ul {
        list-style: none;

        & li {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: .5em;
            padding-left: .5em;
            white-space: nowrap;

            &:hover > span:last-child, &:hover > button.remove {
                opacity: 1;
            }

            & > span:last-child {
                margin-left: auto;
                opacity: .6;
                text-align: right;
            }
        }
    }

    & a, & button:not(.remove) {
        background-color: var(--btnBgColor);
        border-radius: var(--btnBorderRadius);
        color: var(--btnColor);
        font-size: 1rem;
        cursor: pointer;
        margin: 0;
        margin-top: .5em;
        padding: .5em .7em .5em .7em;
        text-decoration: none;
        display: block;
        font-family: 'Epiloque', sans-serif;
        font-weight: 300;
    }

    & button.remove {
        margin: 0;
        padding: 0;
        cursor: pointer;
        background-color: transparent;
        border: none;
        box-shadow: none;
        font-size: 1em;
        display: block;
        height: 1em;
        width: 1em;
        text-indent: -999px;
        overflow: hidden;
        background-color: var(--color-beige);
        -webkit-mask-image: url(/img/close.svg);
        mask-image: url(/img/close.svg);
        mask-position: center;
        mask-size: cover;
    }
}