/**
 * woocommerce.scss
 * Governs the general look and feel of WooCommerce sections of stores using themes that do not
 * integrate with WooCommerce specifically.
 */


/**
 * Global styles
 */

p.demo_store,
.woocommerce-store-notice {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    font-size: 1em;
    padding: 1em 0;
    text-align: center;
    background-color: $primary;
    color: $primarytext;
    z-index: 99998;
    box-shadow: 0 1px 1em rgba(0, 0, 0, 0.2);
    display: none;

    a {
        color: $primarytext;
        text-decoration: underline;
    }
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.admin-bar p.demo_store {
    top: 32px;
}

/**
 * Utility classes
 */
.clear {
    clear: both;
}

/**
 * Main WooCommerce styles
 */

/**
* Quantity input
 */
.input-qty-pm {
    border-radius: 1px;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #E5E5E5;
    background: #f2f2f2;
    color: inherit;
    input, input[type="text"] {
        box-shadow: none !important;
        border-radius: 0px;
        border-top: none;
        border-bottom: none;
    }
    .input-pm-act {
        text-align: center;
        line-height: 2.2em;
        min-height: 2.6em;
        padding: 0px 0.2em;
        min-width: 1.5em;
        cursor: pointer;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        box-shadow: none;
        font-weight: 400;
        background: #f9f9f9;
        &:hover {
            background: #f0f0f0;
            color: inherit;
        }
    }
}


.woocommerce {
    .blockUI.blockOverlay {
        position: relative;
        z-index: 35 !important;
        @include loader();
    }

    .loader {
        @include loader();
    }

    small.note {
        display: block;
        color: $subtext;
        font-size: 0.857em;
        margin-top: 10px;
    }

    .woocommerce-breadcrumb {
        @include clearfix();
        margin: 0 0 1.5em;
        padding: 0;
        color: $subtext;
        a {
            color: $subtext;
        }
    }

    .quantity .qty {
        width: 3em;
        text-align: center;
    }


    nav.woocommerce-pagination {
        text-align: center;

        ul {
            display: inline-block;
            white-space: nowrap;
            padding: 0;
            clear: both;
            border: 1px solid darken( $secondary, 10% );
            border-right: 0;
            margin: 1px;

            li {
                border-right: 1px solid darken( $secondary, 10% );
                padding: 0;
                margin: 0;
                float: left;
                display: inline;
                overflow: hidden;

                a,
                span {
                    margin: 0;
                    text-decoration: none;
                    padding: 0;
                    line-height: 1;
                    font-size: 1em;
                    font-weight: normal;
                    padding: 0.5em;
                    min-width: 1em;
                    display: block;
                }

                span.current,
                a:hover,
                a:focus {
                    background: $secondary;
                    color: darken( $secondary, 40% );
                }
            }
        }
    }


    p.woocommerce-shipping-contents {
        margin: 0;
    }

}

.woocommerce-no-js {
    form.woocommerce-form-login,
    form.woocommerce-form-coupon {
        display: block !important;
    }
    .woocommerce-form-login-toggle,
    .woocommerce-form-coupon-toggle,
    .showcoupon {
        display: none !important;
    }
}

.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 1em 2em 1em 3.5em;
    margin: 0 auto 2em;
    position: relative;
    background-color: lighten($secondary, 5%);
    border-top: 3px solid $primary;
    color: $secondarytext;
    list-style: none outside;
    @include clearfix();
    width: auto;
    word-wrap: break-word;

    &::before {
        font-family: 'WooCommerce';
        content: '\e028';
        display: inline-block;
        position: absolute;
        top: 1em;
        left: 1.5em;
    }

    .button {
        float: right;
    }

    li {
        list-style: none outside !important; // Required for default theme compatibility
        padding-left: 0 !important; // Required for default theme compatibility
        margin-left: 0 !important; // Required for default theme compatibility
    }

}

.woocommerce-message {
    border-top-color: #8fae1b;
    &::before {
        content: '\e015';
        color: #8fae1b;
    }
}

.woocommerce-info {
    border-top-color: #1e85be;
    &::before {
        color: #1e85be;
    }
}

.woocommerce-error {
    border-top-color: #b81c23;
    &::before {
        content: '\e016';
        color: #b81c23;
    }
}




/**
 * Tables
 */
table.shop_attributes {
    border: 0;
    border-top: 1px dotted rgba(0, 0, 0, 0.1);
    margin-bottom: 1.618em;
    width: 100%;

    th {
        width: 150px;
        font-weight: 600;
        padding: 1em;
        border-top: 0;
        border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
        margin: 0;
        line-height: 1.5;
    }

    td {
        font-style: italic;
        padding: 1em;
        border-top: 0;
        border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
        margin: 0;
        line-height: 1.5;

        p {
            margin: 0;
            padding: 0px 0 10px 0px;
            &:last-child {
                padding-bottom: 0;
            }
        }
    }

    //tr:nth-child(even) td,
    //tr:nth-child(even) th {
    //    background: rgba(0, 0, 0, 0.025);
    //}

    tbody tr:nth-child(2n) td {
        background: #fafafa;
    }
}

table.shop_table {
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
    border-collapse: separate;
    border-collapse: collapse;

    thead {
        tr {
            th {
                border-bottom: 2px solid $color_border;
                color: #252525;
            }
        }
    }

    tfoot {
        tr {
            th {
                color: #252525;
            }
        }
    }

    th {
        font-weight: 600;
        padding: 9px 12px;
        background: transparent;
    }

    td {
        border-top: 1px solid $color_border;
        padding: 10px 10px;
        vertical-align: middle;
        background: transparent;
        small {
            font-weight: normal;
        }
    }

    tr:nth-child(2n) {
        td {
            background: transparent;
        }
    }

    tbody:first-child tr:first-child {
        th,
        td {
            border-top: 0;
        }
    }

    tfoot {

        td,th {
            border-top: 1px solid $color_border;
            vertical-align: middle;
        }
        tr:first-of-type {
            td, th {
                border-width: 2px;
            }
        }
    }
}

table.my_account_orders {
    font-size: 0.85em;

    th,
    td {
        padding: 4px 8px;
        vertical-align: middle;
    }

    .button {
        white-space: nowrap;
    }

    .order-actions {
        text-align: right;

        .button {
            margin: 0.125em 0 0.125em 0.25em;
        }
    }
}

table.woocommerce-MyAccount-downloads {
    td,
    th {
        vertical-align: top;
        text-align: center;

        &:first-child {
            text-align: left;
        }
        &:last-child {
            text-align: left;
        }
        .woocommerce-MyAccount-downloads-file::before {
            content: '\2193';
            display: inline-block;
        }
    }
}

td.product-name {
    dl.variation, .wc-item-meta {
        list-style: none outside;

        dt, .wc-item-meta-label {
            float: left;
            clear: both;
            margin-right: .25em;
            display: inline-block;
            list-style: none outside;
        }

        dd {
            margin: 0;
        }

        p,
        &:last-child {
            margin-bottom: 0;
        }
    }

    p.backorder_notification {
        font-size: 0.83em;
    }
}

td.product-quantity {
    min-width: 80px;
}

/**
 * Right to left styles
 */
.rtl.woocommerce .price_label,
.rtl.woocommerce .price_label span {
    /* rtl:ignore */
    direction: ltr;
    unicode-bidi: embed;
}

/**
 * Account page
 */
.woocommerce-account {
    .woocommerce {
        @include clearfix();
    }

    .addresses .title {
        @include clearfix();

        h3 {
            float: left;
        }

        .edit {
            float: right;
        }
    }

    ol.commentlist.notes li.note {
        p.meta {
            font-weight: 600;
            margin-bottom: 0;
        }

        .description p:last-child {
            margin-bottom: 0;
        }
    }
    ul.digital-downloads {
        margin-left: 0;
        padding-left: 0;

        li {
            list-style: none;
            margin-left: 0;
            padding-left: 0;

            &::before {
                @include iconbefore( '\e00a' );
            }

            .count {
                float: right;
            }
        }
    }
}


.woocommerce-terms-and-conditions {
    border: 1px solid rgba(0,0,0,.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
    background: rgba(0,0,0,.05);
}

.woocommerce-invalid {
    #terms {
        outline: 2px solid red;
        outline-offset: 2px;
    }
}

/**
 * Password strength meter
 */
.woocommerce-password-strength {
    text-align: center;
    font-weight: 600;
    padding: 3px 0.5em;
    font-size: 1em;

    &.strong {
        background-color: #c1e1b9;
        border-color: #83c373;
    }

    &.short {
        background-color: #f1adad;
        border-color: #e35b5b;
    }

    &.bad {
        background-color: #fbc5a9;
        border-color: #f78b53;
    }

    &.good {
        background-color: #ffe399;
        border-color: #ffc733;
    }
}

.woocommerce-password-hint {
    margin: 0.5em 0 0;
    display: block;
}


