#header {
    .hamburger {
        display: none;
    }

    .mobile-icons {
        display: none;
    }
}

@media all and (max-width: 900px) {
    #wrapper > main > .wrapper {
        display: block;
    }
    
    #aside {
        display: none;
    }
}

@media all and (max-width: 650px) {
    .product-list {
        grid-template-columns: 1fr 1fr;
    }
    
    #product .details {
        display: block;
    }
    
    #product .info .prices table {
        margin: 0 auto;
    }
    
    #user-login {
        grid-template-columns: 1fr;
    }
    
    #user-login .form[name="login"] {
        order: -1;
    }
    
    #user-dashboard {
        grid-template-columns: 1fr;
    }
}

@media all and (max-width: 500px) {
    #the-box {
        padding-top: 0;
    }

    #wrapper {
        padding-top: 0;
    }

    main {
        padding-top: 15px;
    }

    #header {
        position: relative;
        top: 0;
        width: 100%;
        z-index: 1001;
        margin-bottom: 0;
        background: var(--color-link);
        padding: 10px 0;

        .wrapper {
            display: flex;
            align-content: center;
            justify-content: center;
            line-height: 1;
        }

        .hamburger {
            display: flex;
            gap: 5px 10px;

            .show-nav {
                display: block;
                font-size: 22px;
                background: none;
                border: none;
                color: white;
            }

            .search-trigger {
                display: flex;
                align-items: center;

                padding: 0 5px;

                border: none;
                background: none;
                color: white;
                font-size: 22px;
                cursor: pointer;
            }
        }

        .mobile-icons {
            display: flex;
            gap: 5px 15px;

            .user-icon {
                display: flex;
                align-items: center;
                color: white;
                padding: 0 5px;

                i {
                    font-size: 22px;
                }
            }

            .basket-icon {
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 22px;
                color: white;
                position: relative;

                i {
                    margin-right: 3px;
                    color: white;
                }

                b {
                    position: absolute;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    top: 0;
                    right: -7px;
                    color: white;
                    background: red;
                    min-width: 20px;
                    height: 20px;
                    font-size: 14px;
                    border-radius: 50%;
                }
            }
        }

        h1 {
            flex: 1;
            padding: 0;

            img {
                height: 40px;
                filter: brightness(255);
            }

            > a:not(.user-icon) {
                flex: 1;
                display: flex;
                justify-content: center;
            }
        }

        &:not(.opened) {
            .user, .nav {
                display: none;
            }
        }

        .user {
            display: none;

            .menu {
                .language {
                    menu {
                        z-index: 2;
                    }
                }
            }
        }

        .nav {
            position: absolute;
            left: 0;
            background: red;
            width: 240px;
            top: 100%;

            .pages {
                display: flex;
                flex-direction: column;
                padding: 0;

                a {
                    flex: 1;
                    border-right: none;
                    font-size: 28px;
                    padding: 8px 5px;
                    margin: 0 15px;
                    color: white;
                    outline: none;
                    border-bottom: 2px solid white;
                }

                .submenu {
                    display: flex;
                    flex-direction: column;

                    &:last-child {
                        &:not(.mobile-active) > a {
                            border-bottom: none;
                        }

                        .subpages a:last-child {
                            border-bottom: none;
                        }
                    }

                    &.mobile-languages {
                        display: flex;
                    }

                    &:hover {
                        .subpages {
                            display: none;
                        }
                    }

                    &.mobile-active {
                        .subpages {
                            display: flex;
                        }

                        > a {
                            i.fa-minus {
                                display: inline-flex;
                            }

                            i.fa-plus {
                                display: none;
                            }
                        }
                    }

                    > a {
                        display: flex;
                        align-items: stretch;
                        color: white;

                        i {
                            display: inline-flex;
                            padding: 0 5px;
                            justify-content: center;
                            align-items: center;
                            margin-left: 10px;
                            color: white;
                            font-size: 16px;

                            &.fa-minus {
                                display: none;
                            }
                        }
                    }

                    .subpages {
                        display: none;
                        flex-direction: column;
                        flex-wrap: wrap;
                        position: inherit;
                        top: auto;
                        left: auto;
                        border: none;
                        box-shadow: none;
                        animation: fade-in 0.2s ease-out;
                        background: none;
                        justify-content: center;
                        padding: 0;
                        background: var(--color-link);

                        a {
                            flex: 1;
                            display: flex;
                            align-items: center;
                            gap: 10px;
                            padding: 8px 5px;
                            margin: 0 15px;
                            font-size: 28px;
                            color: white;

                            &:last-child {
                                border-bottom: 2px solid white;
                            }

                            .fi {
                                font-size: 18px;
                            }
                        }
                    }
                }
            }

            .shopping-bag {
                display: none;
            }
        }
    }

    #product-labels {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 10px;
        padding: 0 0 5px 0;
        margin-bottom: 15px;
        justify-content: center;

        border-bottom: 1px solid var(--color-link);

        a {
            padding: 0 10px 0 0;
        }
    }

    #payments {
        ul {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 5px 10px;

            li {
                font-size: 22px;

                &:first-child {
                    width: 100%;
                    font-size: 30px;
                }
            }

            img {
                height: 30px;
            }
        }
    }

    #footer {
        .groups {
            gap: 10px;

            ul {
                display: flex;
                flex-wrap: wrap;
                gap: 0 10px;
            }
        }

        nav {
            flex-wrap: wrap;
            justify-content: center;
            gap: 5px 10px;

            a {
                display: flex;
                justify-content: center;
                align-items: center;
                margin: 0 !important;

                i {
                    font-size: 40px;
                }
            }

            a:first-child {
                width: 100%;
            }
        }
    }

    #product {
        .info {
            .name {
                padding: 10px 0;
                flex-direction: column;
                gap: 10px;
            }

            .prices {
                overflow-x: auto;

                table {
                    td {
                        padding: 5px;
                        font-size: 12px;

                        &.percent {
                            font-size: 16px;
                        }

                        del {
                            display: block;
                        }
                    }
                }
            }
        }
        .tabs {
            .nav {
                justify-content: center;
                button {
                    margin: 0 !important;
                    padding: 7px 10px;
                    font-size: 22px;
                }
            }
        }

        .gallery {
            display: flex;
            flex-wrap: nowrap;
            align-items: stretch;
            overflow-x: auto;

            a {
                margin: 0;

                img {
                    max-width: inherit;
                    height: 120px;
                }
            }
        }
    }

    #basket-info {
        display: flex;
        flex-direction: column;
    }

    #basket {
        h3 {
            margin-bottom: 10px;
        }

        table {
            display: flex;
            flex-direction: column;
            thead {
                display: none;
            }

            tbody {
                display: flex;
                flex-direction: column;
                flex: 1;

                tr {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                }

                td:last-child {
                    text-align: right;
                }
            }

            tfoot {
                display: flex;
                flex-direction: column;

                tr {
                    display: flex;

                    td:first-child {
                        flex: 1;
                    }
                }
            }
        }

        nav {
            flex-direction: column;
            gap: 15px;

            form {
                display: flex;
                flex-direction: column;
                gap: 5px 0;

                button {
                    margin: 0 !important;
                }

                label {
                    input {
                        width: 100%;
                    }
                }
            }

            .group {
                width: 100%;
                justify-content: center;
                padding-top: 10px;
                border-top: 1px solid var(--color-link);
            }
        }
    }

    #user-dashboard {
        .list-orders {
            ul {
                li {
                    display: flex;
                    flex-direction: column;
                    gap: 5px 0;

                    a {
                        display: block;
                        text-align: center;
                        padding: 5px 10px;
                        margin-top: 5px;
                        font-weight: bold;
                        border: 1px solid var(--color-link);
                    }
                }
            }
        }
    }

    #orders {
        .list {
            li {
                .quick-info {
                    display: flex;
                    flex-direction: column;
                    gap: 5px 0;
                }
            }
        }

        .basket {
            display: flex;
            flex-direction: column;

            thead {
                display: none;
            }

            tbody {
                display: flex;
                flex-direction: column;

                tr {
                    display: flex;
                    flex-direction: column;

                    td.quantity {
                        text-align: right;
                    }

                    &:not(:first-child) {
                        td:first-child {
                            border-top: 1px solid var(--color-link);
                        }
                    }
                }
            }

            tfoot {
                display: flex;
                flex-direction: column;

                .total-price {
                    display: flex;
                    justify-content: flex-end;
                }
            }
        }
    }

    .product-list {
        li {
            .add-to-basket {
                font-size: 12px;
            }

            .prices {
                padding: 0 8px;
                table {
                    tbody {
                        tr {
                            display: flex;
                            flex-direction: column;
                            padding: 5px 0;

                            td {
                                text-align: center !important;
                                padding: 5px 0 0 0 !important;
                            }
                        }

                        tr:not(:first-child) {
                            border-top: 1px solid var(--color-link);
                        }

                        .add-to-basket {
                            padding: 8px 10px;
                            font-size: 10px;
                        }
                    }
                }
            }
        }
    }

    .form {
        label {
            display: block;
            width: 100%;
            white-space: wrap;
        }

        fieldset {
            ol {
                li {
                    float: none;
                    width: 100%;
                    padding-left: 0;
                    padding-right: 0;

                    &.half {
                        width: 50%;
                    }

                    &.radio {
                        label {
                            display: block;
                            width: 100%;
                            white-space: wrap;
                        }
                    }
                }
            }
        }
    }
}