@use "../common/utils" as *;
@use "../common/mixins" as *;

.offcanvas {
    &__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: calc-rem(1px) solid rgba(var(--color-border));
        padding-bottom: calc-rem(15px);

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: calc-rem(10px);

            li {
                > a, > button {
                    position: relative;
                    cursor: pointer;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    border: 1px solid rgba(var(--color-border));
                    background: #FFF;
                    border-radius: 9999px;
                    width: calc-rem(35px);
                    height: calc-rem(35px);
                    transition: background 0.2s ease;

                    @include media-breakpoint-up(lg) {
                        width: calc-rem(45px);
                        height: calc-rem(45px);
                    }

                    img {
                        width: calc-rem(12px);
                        object-fit: contain;

                        @include media-breakpoint-up(lg) {
                            width: calc-rem(15px);
                        }
                    }

                    &:hover {
                        transition: background 0.2s ease;
                        background: rgba(var(--color-secondary), 0.1);
                    }

                    .flag {
                        border-radius: calc-rem(999px);
                    }

                    .badge {
                        position: absolute;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        background: rgba(var(--color-primary), 1);
                        width: calc-rem(18px);
                        height: calc-rem(18px);
                        top: -6px;
                        right: -6px;
                        border-radius: calc-rem(18px);
                        border: 2px solid rgba(var(--color-border));
                        font-size: calc-rem(9px);
                        font-weight: bold;
                        color: #FFF;

                        @include media-breakpoint-up(lg) {
                            width: calc-rem(24px);
                            height: calc-rem(24px);
                            border-radius: calc-rem(24px);
                        }
                    }
                }

                > ul {
                    display: none;
                }

                &:hover > ul {
                    display: block;
                }
            }
        }
    }

    &__cta {
        flex-shrink: 0;
        position: relative;
        border-radius: calc-rem(25px);
        background-color: rgba(var(--color-secondary), 1);
        padding: calc-rem(5px 15px 5px 5px);
        align-items: center;
        gap: 10px;
        color: #FFF;
        font-weight: 500;
        font-size: calc-rem(12px);
        height: calc-rem(35px);

        @include media-breakpoint-up(lg) {
            height: calc-rem(45px);
            font-size: calc-rem(14px);
        }

        img {
            height: calc-rem(25px);
            width: calc-rem(25px);

            @include media-breakpoint-up(lg) {
                height: calc-rem(35px);
                width: calc-rem(35px);
            }
        }

        &:after {
            content: '';
            position: absolute;
            top: -2px;
            right: 5px;
            background: rgba(var(--color-primary), 1);
            width: calc-rem(12px);
            height: calc-rem(12px);
            border-radius: calc-rem(24px);
            border: 2px solid rgba(var(--color-border));
        }
    }

    &__navigation {
        > ul {
            list-style: none;
            margin: 0;
            padding: 0;

            > li {
                border-bottom: calc-rem(1px) solid rgba(var(--color-border));

                > a {
                    padding: calc-rem(15px 0);
                    display: flex;
                    align-items: center;
                    font-variation-settings: var(--font-variation-settings-bold);
                }

                > ul {
                    display: none;
                    list-style: none;
                    padding: calc-rem(0 0 15px 0);
                    margin: calc-rem(0 0 0 10px);

                    > li {

                        > a {
                            display: block;
                            padding: calc-rem(5px 0);
                            color: rgba(var(--color-secondary), .8);
                        }
                    }
                }

                &.has-children {
                    position: relative;

                    &:after {
                        transition: transform 0.2s ease;
                        content: '';
                        position: absolute;
                        right: calc-rem(10px);
                        top: calc-rem(23px);
                        width: calc-rem(8px);
                        height: calc-rem(4px);
                        background: url('../images/icons/icon-dropdown.svg') no-repeat;
                        background-size: contain;
                    }
                }

                &.is-active {
                    &:after {
                        transform: rotate(180deg);
                    }

                    > ul {
                        display: block;
                    }
                }
            }
        }

    }
}
