/* -------------------------------------------
    Woocommerce Blocks
        1. Editor Style
           1-1  Base Style
           1-2  Login Form
           1-3  Woocommerce Info
           1-4  Sub Pages
           1-5  Overlay
           1-6  Rating Form
           1-7  WCML
           1-8  Yith Compare
        2. Sidebar Widget
           2-1  Base Style
           2-2  Product List
           2-3  Cart
           2-4  Product Tag Cloud
           2-5  WC Reviews
---------------------------------------------- */

// 1. Editor Style

// 1-1. Base Style
.product-category ul,
.product-nav,
.product-tabs>div ul,
.products,
.products ul,
.woocommerce-error {
    list-style-type: none;
    margin: 0;
    padding: 0
}

.form-row [type="text"],
.form-row [type="tel"],
.form-row [type="password"],
.form-row [type="email"],
.form-row textarea,
.form-row .select2-container .select2-selection,
.form-row select {
    display: block;
    width: 100%;
    min-height: 4.1rem;
    padding: .85rem 2rem;
    border: 1px solid var(--alpha-change-border-color);
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: var(--alpha-body-font-weight);
    color: var(--alpha-body-color);
    background-color: transparent;
    border-radius: 2px;
    box-shadow: none;
    outline: 0;
}

.woocommerce-form {
    font-size: 1.3rem;

    .form-row {
        margin-bottom: 1.8rem;
    }

    label {
        margin-bottom: 8px;
    }
}

.button {
    display: inline-block;
    border: 2px solid #eee;
    outline: 0;
    border-radius: 0;
    padding: 1.3rem 2.7rem;
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.2;
    text-transform: uppercase;
    text-align: center;
    transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
    white-space: nowrap;
    cursor: pointer;

    @include button-variant(var(--alpha-primary-color), var(--alpha-primary-color-hover)); // issue : duplicate

    &.loading {
        opacity: .3;
    }

    &[disabled] {
        cursor: not-allowed;
        pointer-events: none;
    }
}

// 1-2. Login Form
.form-footer label {
    margin-bottom: 0;
}

.lost_password {
    margin-bottom: 0;

    a {
        color: var(--alpha-danger-color);
    }
}

.woocommerce-privacy-policy-link {
    color: var(--alpha-primary-color);

    &:hover {
        text-decoration: underline;
    }
}

form {
    .submit-status {
        margin: 2rem 0 0;
        color: var(--alpha-danger-color);
    }
}

form.lost_reset_password {
    width: 450px;
    margin: 0 auto;
    border: 1px solid #ebebeb;
    padding: 5rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.woocommerce>.login-popup {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: var(--alpha-change-color-light-1);
}

.woocommerce-form .button,
.woocommerce-form-row .button {
    display: block;
    width: 100%;
}

.woocommerce-form-login {
    p {
        font-size: inherit;
        line-height: 1.84;

        &:empty:before {
            content: none;
        }
    }

    .form-row {
        font-size: 1.3rem;
        margin-bottom: 2.5rem;

        label {
            display: inline-block;
            margin-bottom: 8px;
        }

        span {
            vertical-align: middle;
        }

        .form-control {
            height: 3.7rem;
        }

        .input-text {
            background: var(--alpha-change-color-light-1);
        }

        input {
            margin-#{$right}: .5rem;
        }
    }

    .form-footer {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        font-size: 1.2rem;

        p {
            margin-bottom: 8px;
            line-height: inherit;
        }
    }

    .button {
        padding: 1rem;
    }

    .lost-link {
        text-align: $right;
        color: var(--alpha-danger-color);

        &:hover {
            text-decoration: underline;
        }
    }

    .social-login {
        margin-bottom: 2.5rem;
        color: var(--alpha-grey-color);

        p {
            margin-bottom: 8px;
            font-size: 1.2rem;
        }
    }

    .social-icon {
        color: var(--alpha-body-color);

        &.framed {
            border-color: var(--alpha-light-color);
        }
    }

    .custom-checkbox {
        margin-bottom: 2.5rem;
        line-height: initial;
    }

    .woocommerce-password-strength {
        margin: 10px 0;
        padding: 8px;
        color: var(--alpha-white-color);
        text-align: center;
        background: var(--alpha-primary-color);

        &.short {
            background: var(--alpha-alert-color);
        }

        &.bad {
            background: var(--alpha-danger-color);
        }

        &.good {
            background: var(--alpha-success-color);
        }
    }

    .woocommerce-password-hint {
        font-size: 1.2rem;
        line-height: 1.86;
    }

    .title {
        font-size: 1.3rem;
        font-weight: normal;
        color: var(--alpha-body-color);
        margin-bottom: 1.5rem;
    }
}


// 1-3. Woocommerce Info
.main-content>.woocommerce-info {
    padding-top: 1.8rem;
}

@include mq(lg) {
    .left-sidebar.closed~.main-content>.woocommerce-info {
        padding-#{$left}: 10rem;
    }
}

// 1-4. Sub Pages
.woocommerce .alert {
    // color: inherit;
    margin-bottom: 2rem;

    +.alert {
        margin-top: -1rem;
    }
}

.woocommerce {

    .alert-success a:not(.btn),
    .alert-success i {
        color: var(--alpha-success-color);
    }

    .alert-danger a:not(.btn),
    .alert-danger i {
        color: var(--alpha-danger-color);
    }

    .alert-info a:not(.btn),
    .alert-info i {
        color: $info-color;
    }

    .showcoupon+.btn-close,
    .showlogin+.btn-close {
        display: none;
    }
}

// 1-5. Overlay
.blockOverlay {
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--alpha-change-color-light-1) !important;
    opacity: 0.6 !important;
}

.woocommerce-cart .blockMsg,
.woocommerce-checkout .blockMsg {
    opacity: 0;
}

.woocommerce .add_to_wishlist .blockOverlay {
    background: transparent !important;
}

.woocommerce .blockUI.blockOverlay::before {
    background: none;
}

// 1-6. Rating Form
.comment-form-rating {
    color: var(--alpha-change-color-dark-1);
    margin-bottom: 2.2rem;
}

.comment-respond .comment-form-cookies-consent {
    margin-bottom: 2.2rem;
}

.stars {
    display: inline-block;
    margin: side-values(0 0 0 1rem);
    line-height: 1;

    .comment-respond & {
        margin-bottom: 0;
        vertical-align: 1px;
    }

    span {
        display: flex;
        position: relative;
        height: 1.2rem;
        font-size: 1.2rem;
    }

    a {
        color: var(--alpha-light-color);
        text-indent: if-ltr(-9999px, 9999px);
        width: 1.4rem;
    }

    a:before {
        content: '';
        position: absolute;
        #{$left}: 0;
        height: 14px;
        line-height: 1;
        font-family: $theme-font;
        text-indent: 0;
        overflow: hidden;
        white-space: nowrap;
        letter-spacing: 0.2em;
    }

    a.active:before,
    a:hover:before {
        content: "\e986" "\e986" "\e986" "\e986" "\e986";
        color: var(--alpha-secondary-color);
    }

    .star-1 {
        z-index: 10;
    }

    .star-2 {
        z-index: 9;
    }

    .star-3 {
        z-index: 8;
    }

    .star-4 {
        z-index: 7;
    }

    .start-5 {
        z-index: 6;
    }

    .star-1:before {
        width: 20%;
    }

    .star-2:before {
        width: 40%;
    }

    .star-3:before {
        width: 60%;
    }

    .star-4:before {
        width: 80%;
    }

    .star-5:before {
        content: "\e986" "\e986" "\e986" "\e986" "\e986";
    }
}

// 1-7. WCML
.wcml-spinner {
    display: none;
}

.entry-summary .product_meta .wcml_currency_switcher {
    display: none;
}

// 1-8. Yith Compare
.yith_woocompare_colorbox #cboxTopCenter,
.yith_woocompare_colorbox #cboxTopLeft,
.yith_woocompare_colorbox #cboxTopRight,
.yith_woocompare_colorbox #cboxMiddleLeft,
.yith_woocompare_colorbox #cboxMiddleRight,
.yith_woocompare_colorbox #cboxBottomLeft,
.yith_woocompare_colorbox #cboxBottomCenter,
.yith_woocompare_colorbox #cboxBottomRight {
    background: transparent;
    width: 0;
    height: 0;
}

@include mq('320px', 'max') {
    .page-content .woocommerce-form-login .lost_password {
        margin-#{$left}: 0;
    }
}

.woocommerce-store-notice.demo_store {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 10;
    width: 300px;
    padding: 15px 10px;
    margin: 0;
    border: 1px solid #e1e1e1;
    border-radius: 2px;
    background: var(--alpha-change-color-light-1);
    font-size: 13px;
    text-align: center;
}


// 2. Sidebar Widgets

// 2-1. Base Style
.sidebar .widget .wc-layered-nav-term,
.sidebar .widget .with-checkbox li,
.sidebar .widget .yith-wcan-list li {
    padding: 0;

    >a,
    &.empty span {
        position: relative;
        display: block;
        padding: side-values(1rem 0 1rem 28px);

        &:hover {
            color: var(--alpha-primary-color);
        }

        &::before {
            content: '';
            position: absolute;
            border: 1px solid;
            border-radius: var(--alpha-border-radius);
            width: 18px;
            height: 18px;
            top: 50%;
            transform: translateY(-50%);
            #{$left}: 2px;
            color: var(--alpha-grey-color);
            font-size: .7em;
            font-weight: 900;
            font-family: 'Font Awesome 5 Free';
            text-align: center;
            line-height: 16px;

            @include only-for-retina(1.5) {
                text-indent: 0;
            }
        }
    }
}

.sidebar .widget .wc-layered-nav-term.chosen>a::before,
.sidebar .widget .with-checkbox li.chosen>a::before,
.sidebar .widget .yith-wcan-list li.chosen>a::before {
    content: "\f00c";
    color: var(--alpha-white-color);
    background-color: var(--alpha-primary-color);
    border-color: var(--alpha-primary-color);
}

.woocommerce-message {
    .button {
        width: auto;
    }
}

.woocommerce-product-gallery .woocommerce-product-gallery__trigger {
    display: none;
}

// 2-2. Product List
.product-list-sm {
    display: flex;
    align-items: center;

    .product-media {
        line-height: 1.6;
        flex: 0 0 10rem;
        max-width: 10rem;
        margin-#{$right}: 1rem;
    }

    .product-details {
        padding: 0;
        flex: 1;
        max-width: calc(100% - 11rem);
    }

    .woocommerce-loop-product__title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        margin-bottom: 0.6rem;
        font-size: 1.3rem;
        white-space: normal;
    }

    .woocommerce-product-rating {
        margin-bottom: 0.6rem;
    }

    .price {
        font-size: 1.6rem;
    }
}

// 2-3. Cart
.sidebar {
    .cart-header {
        display: none;
    }

    .cart_list {
        >li {
            position: relative;
            display: flex;
            align-items: center;
        }

        .cart-item-meta {
            order: 1;
            margin-#{$left}: 2rem;
        }

        img {
            width: 9.8rem;
        }

        .quantity {
            border: 0;
        }

        .remove {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            position: absolute;
            top: 10px;
            left: 87px;
            z-index: 3;
            background: var(--alpha-change-color-light-1);
            color: var(--alpha-change-color-dark-1);
            font-size: 1.2rem;
            line-height: 12px;
            text-align: center;
            border-radius: 50%;
            box-shadow: 0 2px 6px 0 rgb(0 0 0 / 40%);
        }
    }

    .widget_shopping_cart a.button {
        color: var(--alpha-change-color-light-1);
        margin-#{$right}: 1rem;
    }
}

// 2-4. Product Tag Cloud
.sidebar .tagcloud {
    margin: .5rem 0;
}

// 2-5 WC Reviews
.wc-block-review-sort-select {
    display: flex;
    align-items: center;
}

.wc-block-review-list li {
    margin-bottom: 1rem;
}

.wc-block-all-reviews .wp-block-button__link {
    border: 0;
}