/*
Global
*/

* {
    margin: 0;
    padding: 0;
    border: 0;
    overflow-wrap: break-word;
}

body {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 16px;
}

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

ul, li {
    list-style: none;
}


nav {
    width: 324px;
    -webkit-box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
    -moz-box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
    box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
}

/*
Nav header
*/

#nav-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    height: 64px;
    width: 324px;
    justify-content: space-around;
    align-items: center;
    -webkit-box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
    -moz-box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
    box-shadow: 3px 0px 50px 2px rgba(196,196,196,0.45);
}

#nav-header img {
    height: 24px;
    width: 24px;
}

#nav-header > div:nth-child(2) {
    width: 60%;
}

#nav-header h1 {
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
    line-height: 18px;
}

#nav-header > div > p {
    font-family: 'Lato', sans-serif;
    color: #ffffff;
    font-size: 14px;
    line-height: 16px;
    opacity: 0.8;
}

#nav-header > div:nth-child(3) {
    color: #ffffff;
    height: 14px;
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
}

/*
Categories list
*/

#product-categories {
    margin-top: 64px;
    width: 324px;
    cursor: pointer;
}

.category {
    display: grid;
    grid-template-columns: 52px auto 52px;
    grid-template-rows: 56px auto;
    font-size: 18px;
    color: #666666;
    line-height: 21px;
}

.category span:nth-child(1) {
    height: 32px;
    width: 32px;
    margin: 12px;
}

.category span:nth-child(2) {
    width: auto;
    border-bottom: 1px solid #D5D5D5;
    padding: 12px;
}

.subcategory-toggle {
    border-bottom: 1px solid #D5D5D5;
    padding: 12px;
}

.pressed {
    background-color: rgba(79, 208, 83, 0.096);
}

/*
Subcategories
*/

.subcategories {
    grid-column: span 3;
}

.subcategories li a {
    padding: 12px 58px;
}

.subcategories li {
    height: 0;
    font-size: 0;
    opacity: 0.5;
    transform: translateY(-40%);
}

.pressed .subcategories li {
    height: 56px;
    background-color: #F5F5F5;
    font-size: inherit;
    border-bottom: 1px solid #D5D5D5;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.12s ease-in, font-size 0.02s ease, transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.pressed .subcategories li a {
    display: block;
}

.subcategories li:hover {
    background-color: rgba(238, 235, 235, 0.863);
}

.category:hover {
    background-color: #F5F5F5;
}

.pressed.category {
    background-color: #ffffff;
}

.category:active {
    background-color: rgba(79, 208, 83, 0.096);
}

/* subcategory arrow toggle up/down */
.category:hover .subcategory-toggle {
    background:url('assets/ic_show.svg') no-repeat center;
    border-top: 1px solid #D5D5D5;
    border-bottom: 0 solid #ffffff;
    transform: rotate(180deg);
}

.pressed .subcategory-toggle, .pressed.category:hover .subcategory-toggle {
    background:url('assets/ic_show.svg') no-repeat center;
    border-bottom: 1px solid #D5D5D5;
    border-top: 0 solid #ffffff;
    transform: rotate(0);
}

.selected {
    background: url(assets/ic_checked.svg) no-repeat right center;
    margin-right: 12px;
}

/*
Error modal
*/

.error-container {
    visibility: hidden;
    position: fixed;
    color: #ffffff;
    padding: 10px;
    opacity: 0;
    background: rgba(178, 34, 34, 0.527);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 20;
    animation: show-error 4s;
}

@keyframes show-error {
    0% {
        visibility: hidden;
        font-size: 0;
        opacity: 0;
        height: 0;
        width: 0;
    }
    15% {
        visibility: visible;
        font-size: 20px;
        opacity: 1;
        height: 100vh;
        width:324px;
    }
    90% {
        visibility: visible;
        font-size: 20px;
        opacity: 1;
        height: 100vh;
        width:324px;
    }
    91% {
        font-size: 0;
    }
}