/**
* Product page
*/
div.product {
    div.images {
        @include for_device(mobile) {
            order: 5;
        }
    }

    div.thumbnails {
        @include clearfix();

        a {
            float: left;
            width: 30.75%;
            margin-right: 3.8%;
            margin-bottom: 1em;
        }

        a.last {
            margin-right: 0;
        }

        a.first {
            clear: both;
        }

        &.columns-1 {
            a {
                width: 100%;
                margin-right: 0;
                float: none;
            }
        }

        &.columns-2 {
            a {
                width: 48%;
            }
        }

        &.columns-4 {
            a {
                width: 22.05%;
            }
        }

        &.columns-5 {
            a {
                width: 16.9%;
            }
        }
    }


    #reviews {
        .comment {
            @include mediaright();
        }
    }
}

.woocommerce-pagination {
    ul.page-numbers {
        @include menu();
    }
}

div.product {
    margin-bottom: 0;
    position: relative;

    .product_title {
        clear: none;
        margin-top: 0;
        padding: 0;
        font-size: 2em;
        line-height: 1.216;
        @include for_device( tablet ) {
            font-size: 1.9em;
        }
        @include for_device( mobile ) {
            font-size: 1.7em;
        }
    }

    span.price,
    p.price {
        font-size: 1.25em;
        margin-bottom: 0.875em;
        ins {
            background: inherit;
            font-weight: 500;
            display: inline-block;
        }

        del {
            opacity: 0.5;
            display: inline-block;
        }
    }

    .stock {
        color: $highlight;
    }

    .out-of-stock {
        color: red;
    }

    .woocommerce-product-rating {
        margin-bottom: 0.72em;
        .woocommerce-review-link {
            display: none;
        }
    }
    .wc-product-images {
        position: relative;
    }

    div.images {
        margin-bottom: 2em;

        img {
            display: block;
            width: 100%;
            height: auto;
            box-shadow: none;
        }

        div.thumbnails {
            padding-top: 1em;
        }

        &.woocommerce-product-gallery {
            position: relative;
        }

        .woocommerce-product-gallery__wrapper {
            transition: all cubic-bezier(0.795, -0.035, 0.000, 1.000) .5s;
            margin: 0;
            padding: 0;
        }

        .woocommerce-product-gallery__wrapper .zoomImg {
            background-color: #fff;
            opacity: 0;
        }

        .woocommerce-product-gallery__image:nth-child(n+2) {
            width: 25%;
            display: inline-block;
        }

        .woocommerce-product-gallery__trigger {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 1em;
            z-index: 9;
            width: 36px;
            height: 36px;
            background: rgba(255,255,255,0.5);
            border-radius: 100%;
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08);
            color: #888888;
            opacity: 0.6;
            display: inline-block;
            transition: all 0.3s linear;
            box-sizing: content-box;
            overflow: hidden;
            line-height: 10em;
            &:hover, &:focus {
                opacity: 1;
                box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(0, 0, 0, 0.18);
                background-color: rgba(255,255,255,0.99);
            }

            &:before {
                content: "\e035";
                font-family: "WooCommerce";
                display: flex;
                height: 100%;
                width: 100%;
                justify-content: center;
                align-items: center;
                position: absolute;
                top: 50%;
                left: 50%;
                font-size: 1em;
                line-height: 0;
                transform: translate( -50%, -50%);
                box-sizing: content-box;
            }

            img {
                display: none !important;
            }
        }

        .flex-control-thumbs {
            overflow: hidden;
            zoom: 1;
            margin: 10px -10px 0px;
            padding: 0;
            li {
                width: 25%;
                float: left;
                margin: 0;
                padding: 10px;
                list-style: none;
                &:last-child {
                    margin-right: 0px;
                }

                img {
                    cursor: pointer;
                    opacity: .5;
                    margin: 0;

                    &.flex-active,
                    &:hover {
                        opacity: 1;
                    }
                }
            }
        }
    }

    .woocommerce-product-gallery--columns-3 {
        .flex-control-thumbs li:nth-child(3n+1) {
            clear: left;
        }
    }

    .woocommerce-product-gallery--columns-4 {
        .flex-control-thumbs li:nth-child(4n+1) {
            clear: left;
        }
    }

    .woocommerce-product-gallery--columns-5 {
        .flex-control-thumbs li:nth-child(5n+1) {
            clear: left;
        }
    }

    div.summary {
        margin-bottom: 2em;
    }

    div.social {
        text-align: right;
        margin: 0 0 1em;

        span {
            margin: 0 0 0 2px;

            span {
                margin: 0;
            }

            .stButton .chicklets {
                padding-left: 16px;
                width: 0;
            }
        }

        iframe {
            float: left;
            margin-top: 3px;
        }
    }



    p.cart {
        margin-bottom: 2em;
        @include clearfix();
    }

    form.cart {
        margin-bottom: 1.41575em;
        @include clearfix();

        div.quantity {
            float: left;
            margin: 0 1em 0em 0;
        }

        table {
            border-width: 0 0 1px;

            td {
                padding-left: 0;
            }

            div.quantity {
                float: none;
                margin: 0;
            }

            small.stock {
                display: block;
                float: none;
            }
        }

        .variations {
            margin-bottom: 1.41575em;
            border: 0;
            width: 100%;

            tr {
                margin-bottom: 0.72em;
                display: block;
                &:last-child {
                    margin-bottom: 0;
                }
            }

            td,
            th {
                border: 0;
                vertical-align: top;
                line-height: 2em;
            }

            label {
                font-weight: 500;
            }

            select {
                max-width: 100%;
                min-width: 50%;
                width: 150px;
                display: inline-block;
                margin-right: 1em;
                color: #444444;
            }
            td.label {
                padding-right: 1em;
            }
        }

        .woocommerce-variation-description p {
            margin-bottom: 1em;
        }

        .reset_variations {
            visibility: hidden;
            font-size: 0.83em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .wc-no-matching-variations {
            display: none;
        }

        .button {
            vertical-align: middle;
            float: left;
        }

        .group_table {
            td.woocommerce-grouped-product-list-item__label {
                padding-right: 1em;
                padding-left: 1em;
            }

            td {
                vertical-align: top;
                //padding-bottom: 0.5em;
                border: 0;
            }

            td:first-child {
                width: 11em;
                text-align: center;
                .button.product_type_variable {
                    font-size: 0.7em;
                    min-height: auto;
                    margin-left: 1em;
                }
            }

            .wc-grouped-product-add-to-cart-checkbox {
                display: inline-block;
                width: auto;
                margin: 0 auto;
                transform:scale(1.5, 1.5);
            }
        }
    }
}

span.onsale {
    padding: 2px 8px;
    position: absolute;
    text-align: center;
    top: 1em;
    left: 1em;
    margin: 0;
    border-radius: 2px;
    background-color: $highlight;
    color: $highlightext;
    font-size: 0.72em;
    z-index: 9;
    display: flex;
    align-items: center ;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    .amount {
        color: inherit !important;
    }
}