/*
 * Devices
 * min 1200
 * min 1024
 * max 1024
 * max 768
 * max 640
 * max 480
 * max 320
 */

@import "variables";
@import "funcs";

#responsive-utils {
    .hide-element {
        display: none !important;
        visibility: hidden !important;
    }

    .show-element {
        display: block !important;
        visibility: visible !important;
    }

    .full-size {
        float: none !important;
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .half-size {
        width: 50% !important;
    }

    .container-desktop {width: @containerDesktopSize !important;}
    .container-phone {width: @containerPhoneSize !important;}
    .container-phone2 {width: @containerPhoneSize2 !important;}
    .container-phone3 {width: @containerPhoneSize3 !important;}
    .container-phone4 {width: @containerPhoneSize4 !important;}
    .container-tablet {width: @containerTabletSize !important;}
    .container-large {width: @containerLargeSize !important;}

    .container-phone {
        padding: 0 10px;
    }
}

.no-phone, .no-tablet, .no-desktop, .no-large {}
.on-phone, .on-tablet, .on-desktop, .on-large {}


/* Desktop */
@media screen and (min-width: 800px) {
    .no-desktop {
        #responsive-utils > .hide-element;
    }
}

@media screen and (min-width: 1024px) {
    .no-desktop {
        #responsive-utils > .hide-element;
    }
    .on-desktop {
        #responsive-utils > .show-element;
    }
    .container {
        #responsive-utils > .container-desktop;
    }
}

/* Large desktop */
@media screen and (min-width: 1200px) {
    html {font-size: 70%;}
    .no-large {
        #responsive-utils > .hide-element;
    }
    .on-large {
        #responsive-utils > .show-element;
    }
    .container {
        #responsive-utils > .container-large;
    }
}

/* tablet landscape*/
@media only screen and (max-width: 1024px) {
    .no-tablet-landscape, .no-tablet {
        #responsive-utils > .hide-element;
    }
    .on-tablet {
        #responsive-utils > .show-element;
    }
    .container {
        #responsive-utils > .container-desktop;
    }
}

/* tablet portrait */
@media only screen and (max-width: 800px) {
    html {font-size: 60%;}
    .no-tablet-portrait, .no-tablet {
        #responsive-utils > .hide-element;
    }
    .on-tablet {
        #responsive-utils > .show-element;
    }
    .container {
        #responsive-utils > .container-tablet;
    }

    // Grid
    @gridSize:              @containerTabletSize;
    @gridColumnSize:        (@gridSize - 20) / 2;
    @gridGutterSize:        @unitSize;

    .grid:not(.fluid) > .row {
        margin: 0;
        & > [class*="span"] {
            width: @gridColumnSize !important;
            margin-left: 0 !important;
            margin-bottom: @gridGutterSize;
            &:nth-child(even) {
                margin-left: @gridGutterSize !important;
            }
        }
        .span12, .span7, .span8, .span9, .span10, .span11 {
            width: @gridSize !important;
            &:nth-child(even) {
                margin-left: 0 !important;
            }
        }

        .row {
            margin: 0;
            [class*="span"] {
                width: @gridColumnSize !important;
                margin-left: 0 !important;
                margin-bottom: @gridGutterSize;
                &:nth-child(even) {
                    margin-left: @gridGutterSize !important;
                }
            }
            .span12, .span7, .span8, .span9, .span10, .span11 {
                width: @gridSize !important;
                &:nth-child(even) {
                    margin-left: 0 !important;
                }
            }
        }
    }

    .navigation-bar, .navbar {
        .pull-menu {
            display: block !important;
        }

        position: relative !important;

        .element {
            //display: inline-block !important;
            float: none !important;
            //width: 90%;
        }

        .element-divider {
            display: none !important;
        }

        .element-menu {
            position: relative;
            float: none;
            display: none;
            width: 100% !important;
            background-color: inherit;
            z-index: @zindexDropdown;

            li {
                display: block !important;
                float: none !important;
                width: 100%;

                a {
                    display: block !important;
                    float: none !important;
                    width: 100%;
                }

                .dropdown-menu {
                    position: relative !important;
                    left: 0;
                }
            }
            .dropdown-toggle {
                color: inherit;
                position: relative;
                &:after {
                    position: absolute;
                    left: 100% !important;
                    margin-left: -15px;
                    //content: "";
                }
            }

            .dropdown-menu {
                .dropdown-toggle {
                    &:after {
                        //.rotate(90deg);
                    }
                }
            }
        }
    }
}

@media only screen and (max-width: 800px) {
    .navigation-bar, .navbar {
        .pull-menu {
            display: block !important;
        }
    }
}

/* Phones landscape*/
@media only screen and (max-width: 640px) {
    html {font-size: 60%;}
    .no-phone-landscape, .no-phone {
        #responsive-utils > .hide-element;
    }
    .on-phone {
        #responsive-utils > .show-element;
    }
    .container {
        #responsive-utils > .container-phone;
    }

    // Grid
    .grid:not(.fluid) > .row {
        margin: 0;
        & > [class*="span"] {
            width: 100% !important;
            margin: 0 !important;
            margin-bottom: 5px !important;
            &:nth-child(even) {
                margin-left: 0 !important;
            }
        }
        .span12 {
            width: 100% !important;
        }
        .row {
            margin: 0;
            & > [class*="span"] {
                width: 100% !important;
                margin: 0 !important;
                margin-bottom: 5px !important;
                &:nth-child(even) {
                    margin-left: 0 !important;
                }
            }
            .span12 {
                width: 100% !important;
            }
        }
    }
}

/* Phones portrait*/
@media only screen and (max-width: 480px) {
    html {font-size: 45%;}
    .no-phone-landscape, .no-phone {
        #responsive-utils > .hide-element;
    }
    .container {
        #responsive-utils > .container-phone2;
    }
}

@media only screen and (max-width: 360px) {
    html {font-size: 40%;}
    .no-phone-portrait, .no-phone {
        #responsive-utils > .hide-element;
    }
    .container {
        #responsive-utils > .container-phone3;
    }
}

@media only screen and (max-width: 320px) {
    html {font-size: 40%;}
    .no-phone-portrait, .no-phone {
        #responsive-utils > .hide-element;
    }
    .container {
        #responsive-utils > .container-phone4;
    }
}

