/*  -----------------------------------------------------------------------------------------------
    Helpers
    @package v.1.0.0
--------------------------------------------------------------------------------------------------- */

@import "~include-media/dist/include-media";

@mixin left-right-distance($width: 'auto') {
    $distance: 20px;
    padding-left: $distance;
    padding-right: $distance;

    @if $width == 'auto' {
    } @else {
        max-width: calc(#{$width} + (2 * #{$distance}));
    }

    @include media('>=tablet') {
        $distance: 24px;
        padding-left: $distance;
        padding-right: $distance;

        @if $width == 'auto' {
        } @else {
            max-width: calc(#{$width} + (2 * #{$distance}));
        }
    }

    @include media('>=desktop') {
        $distance: 40px;
        padding-left: $distance;
        padding-right: $distance;

        @if $width == 'auto' {
        } @else {
            max-width: calc(#{$width} + (2 * #{$distance}));
        }
    }
}


$breakpoints: (
    'phone-small':390px,
    'phone': 480px,
    'ads' : 640px,
    'tablet': 768px,
    'desktop': 1024px,
    'semi-huge': 1200px,
    'huge': 1280px,
    'hd': 1366px,
    'bighd': 1440px,
);

$wrapper_gutter: 24px;

.wrapper
{
    position: relative;
    margin-right: auto;
    margin-left: auto;
    max-width: 1600px;
    width: 100%;

    &.admin-bar
    {
        margin-top: 32px;
    }
}

.flex-item
{
	display: flex;
	align-items: center;
}

.inline-list
{
	list-style-type: none;
	padding: 0;
	margin: 0;
}



@mixin input-placeholder {
    &::-webkit-input-placeholder {
        @content
    }
    &:-moz-placeholder {
        @content
    }
    &::-moz-placeholder {
        @content
    }
    &:-ms-input-placeholder {
        @content
    }
}


@mixin button
{
    @extend .bgblack;
    color: $white;
    padding: 12px 24px;
    text-transform: uppercase;
    font-family: $headings_font;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2.5px;
    transition: background-color .25s;
    border: 0;
    
    &:hover,
    &:focus
    {
        @extend .bgaccent;
    }
}


@mixin loader
{
    .spinner,
    .spinner:before,
    .spinner:after 
    {
      border-radius: 50%;
      width: 10px !important;
      height: 10px;
      animation-fill-mode: both;
      animation: loader 1.8s infinite ease-in-out;
    }

    .spinner
    {
        @extend .accent;
        font-size: 10px;
        margin: 80px auto;
        position: relative;
        text-indent: -9999em;
        transform: translateZ(0);
        animation-delay: -0.16s;
        
        > div
        {
            display: none;
        }
        
        &:before,
        &:after
        {
            content: '';
            position: absolute;
            top: 0;
        }

        &:before
        {
            left: -15px;
            animation-delay: -0.32s;
        }

        &:after
        {
            left: 15px;
        }
    }
  
}

@keyframes loader 
{
    0%,
    80%,
    100% 
    {
        box-shadow: 0 2.5em 0 -1.3em;
    }
    40% 
    {
        box-shadow: 0 2.5em 0 0;
    }
}

@mixin elements_padding_on_sides($large: 48px, $desktop: 32px, $tablet: 24px)
{
    padding-left: $large;
    padding-right: $large;
    
    @include media('<=desktop')
    {
        padding-left: $desktop;
        padding-right: $desktop;
    }

    @include media('<=tablet')
    {
        padding-left: $tablet;
        padding-right: $tablet;
    }
}

@keyframes drop_down
{
    0% {
        opacity: 0;
        transform: translateX(0) translateY(-3px) scale(0.85);
    }

    100% {
        opacity: 1;
        transform: translateX(0) translateY(-3px) scale(1);
    }
}

@keyframes drop
{
    0%      { top: -350px; }
    100%    { top: 0; }
}

@mixin bgcolor($color)
{
    background-color: $color;
}

@mixin color($color)
{
    color: $color;
}

@mixin fill($color)
{
    fill: $color;
}

//Colors
.black
{
    color: $black;
}

.white
{
    color: $white;
}

.accent
{
    color: $accent_color;
}

.grey
{
    color: $grey;
}

.transparent
{
    color: transparent;
}

// Fill
.fillwhite
{
    fill: $white;
}

.fillblack
{
    fill: $black;
}

.fillaccent
{
    fill: $accent_color;
}


// Backgrounds
.bgwhite
{
    background-color: $white;
}

.bgblack
{
    background-color: $black;
}

.bgaccent
{
    background-color: $accent_color;
}


@keyframes add_to_cart_animation {
  0% {
    transform: rotate(0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }
  50% {
    transform: rotate(900deg);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  100% {
    transform: rotate(1800deg);
  }
}

@mixin relative()
{
  position: relative;
  z-index: 1;
}

@mixin image_hover() 
{
    .entry-image
    {
        width: 100%;
        height: auto;
        position: relative;
        display: block;
        
        &:after
        {
            content: "";
            display: block;
            position: absolute;
            top: 0;
            bottom: 0;
            right: 0;
            left: 0;
            width: 100%;
            height: 0;
            background: rgba($black, .4);
            opacity: 0;
            visibility: hidden;
            z-index: -1;
            transition: all .25s;
        }

        .entry-image-wrapper
        {
            display: flex;
            height: 100%;
        }

        .hover 
        {
            position: absolute;
            top: 0%;
            left: 50%;
            transform: translate(-50%, 0);
            z-index: 100;
            text-transform: uppercase;
            text-align: center;
            color: $white;
            opacity: 0;
            transition: all 0.3s;
            backface-visibility: hidden;
        }
    }

    &:hover,
    &:focus
    {
        .entry-image 
        {
            .entry-image-wrapper 
            {
                backface-visibility: hidden;
            }
            .hover 
            {
                opacity: 1;
                top: 50%;
                transform: translate(-50%, -50%);
            }
            &:after
            {
                opacity: 1;
                z-index: 1;
                visibility: visible;
                height: 100%;
            }
        }
    }
}


@mixin image_size($pb) {
    .entry-image
    {
        > .entry-image-wrapper
        {
            position: relative;
            
            &:after
            {
                content: '';
                display: block;
                padding-bottom: $pb;
            }

            img
            {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                width: 100%;
                height: 100%;
                object-position: center;
                object-fit: cover;
                transition: filter .25s ease-in-out;
            }
        }
    }
}

@mixin content_with_overlay()
{
    .entry-content-inner
    {
        padding: 24px;
        background: rgba($black, .5);

        .title-header
        {
            margin-bottom: 0 !important;
            
            .entry-title
            {
                max-width: 100%;
            }
        }
    }
}


@mixin grid_content_font_sizes($title: 16px, $content: 15px, $meta: 11px)
{
    article
    {
         .entry-content-inner
         {
            .title-header 
            {
                .entry-title
                {
                    font-size: $title;
                    line-height: 1.1;
                    margin-top: 12px;
                }
            }

            .entry-content
            {
                font-size: $content;
            }

            .entry-posted-on
            {
                font-size: $meta;
            }
         }
    }
}