@import '../../style/variables.scss';
$black: #000000;
$concrete: #f2f2f2;
$malibu: #639eff;
$tundora: #464646;

.c-share {
    position: relative;
    width: 3.4375em;
    height: 3.4375em;
}

.c-share__input {
    display: none;

    &:checked~ {
        .c-share__toggler .c-share__icon {
            transition: 0s;
            width: 0;
            height: 0;
            color: $malibu;

            &::before {
                transform: rotate(-45deg);
            }

            &::after {
                transform: rotate(45deg);
            }
        }
    }
}

.c-share__toggler,
.c-share_options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    background-color: $concrete;
    z-index: 1;
    @media only screen and (min-width: 640px) {
        right: unset;
        left: 0;
    }
    @media only screen and (min-width: 1600px) {
        right: 0;
        left: unset;
    }
}

.c-share__toggler {
    cursor: pointer;
    z-index: 1;

    display: flex;
    justify-content: center;
    align-items: center;
}

.c-share__icon {
    position: relative;
    left: -0.3125em;
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    color: #FD9E55;
    background-color: currentColor;
    box-shadow: 0.625em -0.625em, 0.625em 0.625em;
    transition: 0.1s 0.05s;

    &::before,
    &::after {
        content: "";
        position: absolute;
        width: 1em;
        height: 0.125em;
        background-color: #FD9E55;
        transition: 0.1s;
    }

    &::before {
        top: 0.1875em;
        left: 0.1875em;
        transform-origin: bottom left;
        transform: rotate(45deg);
    }

    &::after {
        top: -0.125em;
        left: 0.03125em;
        transform-origin: center;
        transform: rotate(-45deg);
    }
}

.c-share_options {
    list-style: none;
    margin: 0;
    padding: 1.0625em 1.25em;
    box-sizing: border-box;
    overflow: hidden;
    transition: 0.2s;
    border: 1px solid $primary;

    &::before {
        content: attr(data-title);
        display: block;
        margin-bottom: 1.25em;
        font-weight: 700;
    }

    ul {
        li {
            font-size: 0.875em;
            color: $tundora;
            cursor: pointer;

            &:not(:last-child) {
                margin-bottom: 0.75em;
            }
        }
    }


    &::before,
    ul {
        li {
            opacity: 0;
            transform: translateY(0.625em);
            transition: 0s;
        }
    }
}
.ns-share{
    width: auto;
    height: auto;
    border: none;
    width: 100%;
    @media only screen and (min-width: 640px){
        width: auto;
    }
    .primary-border-btn{
        text-transform: uppercase;   
        font-size: 14px;
        font-weight: 500;
        height: 40px;
        cursor: pointer;
        width: 100%;
        .ns-icon{
            width: 18px;
            height: 18px;
        }
        @media only screen and (min-width: 640px) {
            width: auto;
            font-size: 16px;
            padding: 8px 20px;
            .ns-icon{
                width: 24px;
                height: 24px;
            }
        }
        @media only screen and (min-width: 1601px) {
            font-size: 18px;
            height: 50px;
            padding: 14px 30px;
        }
    }
    .c-share_options{
        width: 160px;
        border-radius: 10px;
        padding: 15px;
        opacity: 0;
        pointer-events: none;
        transition: 0.3s ease-in-out;
        ul {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
            li{
                margin-bottom: 0;
                display: inline-flex;
            }
        }
    }
    .c-share__input{
        &:checked~{
            .c-share_options{
                width: 160px;
                opacity: 1;
                pointer-events: visible;
            }
        }
    }
}