// micro css reset for everything orejime related
[class^="orejime-"] {
    font-family: $orejime-font;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.3;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
    float: none;

    button {
        transition: 0.3s ease-in-out;

        &:focus {
            outline: none;
        }
    }
}

.orejime {
    $orejime: &;

    &-Main,
    &-Modal {
        font-size: 12px;
        line-height: 1.3;
    }

    &-Button {
        font-size: 11px;
        line-height: 1;
        display: flex;
        min-height: 35px;
        padding: 0 12px;
        color: $orejime-theme-color;
        cursor: pointer;
        text-transform: uppercase;
        text-align: center;
        border: 0;
        border-radius: $orejime-border-radius;

        align-items: center;
        justify-content: center;

        &[disabled] {
            opacity: 0.57;
            cursor: default;
        }
    }

    &-Link {
        margin: 0;
        padding: 0 12px;
        background: transparent;
        min-height: auto;
        cursor: pointer;

        &[disabled] {
            cursor: default;
        }
    }

    &-CloseIcon {
        width: 12px;
        cursor: pointer;
    }

    &-Notice {
        position: fixed;
        z-index: 1000;
        max-width: 100%;
        bottom: 0;

        @media (max-width: 989px) {
            border: none;
        }

        @media (min-width: 768px) {
            bottom: 20px;
            right: 20px;
        }


        &--hidden {
            display: none !important;
        }

        &-purposes {
            color: $orejime-theme-color;
        }

        &-changes {
            color: $orejime-theme-color;
            margin-bottom: 0.5em;
            font-weight: bold;
        }

        &-actions {
            display: flex;
            flex-wrap: wrap;

            justify-content: center;

            &--space-between {
                justify-content: space-between;
            }
        }

        &-actionItem {
            display: inline-block;
            width: auto;
            text-align: center;

            &--half {
                width: calc(50% - 4px);
            }

            &--full {
                width: 100%;
                margin-bottom: 10px;
            }

            button {
                width: 100%;
            }
        }

        &-learnMoreButton {
            display: inline-block;
        }
    }

    .orejimeHtml-WithModalOpen {
        height: 100%;

        body {
            position: fixed;
            overflow: hidden;
            height: 100%;
            width: 100%;
        }
    }

    &-ModalOverlay {
        z-index: 1000;
        background: rgba(0,0,0,0.5);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    &-ModalWrapper {
        z-index: 1001;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        max-width: 100%;
        max-height: 100%;
        overflow: auto;
    }

    &-Modal {
        &-title {
            display: block;
            margin: 0 0 10px 0;
            font-weight: bold;
        }

        &-closeButton {
            border: none;
            background: none;
            color: inherit;
            position: absolute;
        }

        &-body {
            // padding: 1em;

            > div {
                display: flex;

                flex-wrap: wrap;

                > * {
                    width: 100%;
                }
            }
        }

        &-privacyPolicyLink,
        &-cookiePolicyLink,
        &-poweredByLink {
            cursor: pointer;
            text-decoration: underline;

            &:hover {
                text-decoration: none;
            }
        }

        &-poweredByLink {
            display: none;
            position: absolute;
            right: 1em;
            color: $orejime-theme-color-light;
            font-size: 0.8em;
            padding: 6px 0;

            &:hover,
            &:focus,
            &:active {
                color: $orejime-theme-color-light;
            }
        }
    }

    &-AppList {
        display: block;

        &-item {
            line-height: 1.25;
            position: relative;
            display: block;
            min-height: 40px;
            padding-left: 70px;
            vertical-align: middle;

            &:not(:first-child) {
                margin-top: 15px;
            }
        }
    }

    &-AppItem {
        $appItem: '.orejime-AppItem';

        &-title {
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        &-description {
            font-size: 1.3rem;
        }

        &-purposes {
            font-size: 11px;
            color: $orejime-theme-color-light;
        }

        &-optOut,
        &-required {
            padding-left: 2px;
            font-size: 11px;
            color: $orejime-highlight-txt-color;
        }

        &-input {
            position: absolute;
            top: 5px;
            left: 0;
            opacity: 0;
            appearance: none;

            &:checked {
                + #{$appItem}-label{
                    #{$appItem}-slider {
                        opacity: 1;
                        // background-color: $orejime-slider-bg;
                        border-color: $orejime-slider-bgActive;
                        background-color: $orejime-slider-bgActive;

                        &:before {
                            background: $orejime-slider-bgUnactive;
                            // transform: translate(100%, -50%);
                        }
                    }
                }
            }

            &[disabled] {
                + #{$appItem}-label {
                    #{$appItem}-title {
                        cursor: default;
                    }

                    #{$appItem}-switch--disabled {
                        #{$appItem}-slider {
                            opacity: 0.8;
                            background-color: $orejime-slider-bgDisabled;
                            border-color: $orejime-slider-bgDisabled;
                        }
                    }
                }
            }
        }

        &-switch {
            position: absolute;
            top: 5px;
            left: 0;
            display: inline-block;
        }

        &-switchLabel {
            font-size: 10px;
            position: absolute;
            top: 34px;
            left: 50%;
            display: none;
            width: auto;
            overflow: ellipsis;
            text-align: center;
            transform: translateX(-50%);
        }

        &-switch--disabled {
            #{$appItem}-slider {
                cursor: default;
                // opacity: 0.67;
                // background: $orejime-slider-bg;
            }

            #{$appItem}-switchLabel {
                color: #aaa;
            }
        }

        &-slider {
            // box-shadow: $orejime-box-shadow;
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: inline-block;
            border: solid $orejime-slider-bgActive 1px;
            background: transparent;
            // opacity: 0.5;
            opacity: 1;
            -webkit-transition: .4s;
            transition: .4s;
            border-radius: 30px;
            // border: 2px solid transparent;

            &::before {
                position: absolute;
                content: "";
                top: 50%;
                // bottom: 3px;
                border-radius: 50%;
                background-color: $orejime-slider-bgActive;
                -webkit-transition: .4s;
                transition: .4s;
                transform: translate(0, -50%);
                // border: $orejime-theme-border;
            }
        }
    }

    &-AppToggles {
        display: flex;

        &-item {
            display: inline;
        }

        &-button {
            padding: 0;
        }
    }
}
