﻿html {
    box-sizing: border-box;
    font-family: sans-serif;
}

*,
*::after,
*::before {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

/* ----------- body element's style's */
.container {
    /*height: 100vh;*/
    background-color: #fff;
    display: flex;
    flex-wrap:wrap;
    justify-content: space-between;
    align-items: flex-start;
    /*padding-top: 80px;*/
}

.dropdown-menu {
    /*width:50%;*/
    display: grid;
    grid-template-rows: 50px max-content;
    gap: 2px;
    justify-content:center;
    margin-bottom:10px;
}

.dropdown-toggle {
    all: unset;
    background-color: #5342cb;
    color: white;
    width: 150px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
}

    .dropdown-toggle::after {
        content: " ";
        width: 6px;
        height: 6px;
        border-width: 0 2.3px 2.3px 0;
        border-style: solid;
        transform: rotate(45deg);
        transition: 0.4s;
    }

.dropdown-list {
    width:98%;
    background-color: #ccc;
    color: #444;
    list-style: none;
    display: grid;
    grid-template-rows: auto auto;
    border-radius: 5px;
    overflow: hidden;
    height: 0;
    transition: 0.4s;
}

.dropdown-list__item {
    font-size:14px;
    display: flex;
    align-items: center;
    padding:3px 0px 3px 10px;
    transition: 0.4s, transform 0.4s var(--delay);
    transform: translateX(-100%);
    user-select: none;
    cursor: pointer;
}

    .dropdown-list__item:hover {
        background-color: dodgerblue;
        color: #fff;
    }

/* ------------- function */
.dropdown-toggle:focus::after {
    transform: rotate(225deg);
}

.dropdown-toggle:focus ~ .dropdown-list {
    height: 240px;
}

    .dropdown-toggle:focus ~ .dropdown-list .dropdown-list__item {
        transform: translateX(0);
    }
