/* -------------------------------------------
    Compare Page
        1. Compare Table
        2. Compare Responsive
---------------------------------------------- */

@import '../../../assets/sass/config';
@import '../../assets/sass/mixins/mixins';
@import '../../assets/sass/mixins/direction';

// 1. Compare Table
.compare-page {
    .main {
        padding-top: 1rem;
    }
}
.alpha-compare-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--alpha-body-color);

    .compare-row {
        display: flex;
        flex-wrap: nowrap;
    }
    .compare-col {
        padding: 2.5rem 0;
        word-break: break-word;

        > *:last-child {
            margin-bottom: 0;
        }

        & + .compare-col {
            padding-#{$left}: 2rem;
        }
    }
    .compare-field {
        flex: 0 0 20%;
        color: var(--alpha-grey-color);
        font-size: 1.4rem;
        text-align: $right;
        padding-#{$right}: 5rem;
    }
    .compare-sku {
        text-transform: uppercase;
    }
    .compare-value {
        flex: 0 0 20%;

        .swatch {
            display: inline-block;
            width: 1.5rem;
            height: 1.5rem;
            margin-#{$right}: .8rem;
            border-radius: 50%;
            vertical-align: middle;
        }
        .label-swatch {
            width: auto;
            height: auto;
            border: 1px solid var(--alpha-light-color);
            border-radius: 0;
            padding: 0 0.8rem;
            margin-bottom: .8rem;
            font-size: 0.9286em;
        }
    }
    
    .compare-row:nth-child(even) .compare-col {
        background-color: #fbfbfb;
    }

    .compare-basic {
        font-size: 0.7143em;
        text-align: center;

        .compare-field {
            display: flex;
            align-items: center;
            justify-content: flex-end;
        }
    }

    figure:hover .product-action-vertical {
        opacity: 1;
        visibility: visible;
    }

    .btn-product-icon {
        border-color: var(--alpha-change-border-color);
    }

    .product-title {
        display: block;
        margin-top: 1.1538em;
        margin-bottom: 0.7692em;
        font-size: 1.3em;
        font-weight: 600;
    }

    .stock {
        margin: 0;
        background: transparent;
        color: inherit;
        font-weight: inherit;
        padding: 0;
    }

    .woocommerce-Price-amount {
        color: var(--alpha-primary-color);
    }

    del {
        color: var(--alpha-grey-color);
        .woocommerce-Price-amount {
            color: inherit;
        }
    }
    
    .compare-value[data-title="Availability"] {
        color: var(--alpha-alert-color);

        .stock {
            color: var(--alpha-danger-color);
        }
    }

    &.empty {
        color: inherit;
        text-align: center;
        h2 {
            font-size: inherit;
            color: inherit;
            margin: 22px 0;
        }
        .button {
            margin-top: 1rem;
            width: 20rem;
            border-radius: 2px;
        }
    }
}

.compare-basic-info .remove_from_compare {
    position: relative;
    z-index: 1;
}

.compare-basic-info .remove_from_compare:not(:hover),
.compare-basic-info .product-title:not(:hover) {
    color: var(--alpha-change-color-dark-1);
}

.compare-basic-info {
    .compare-action {
        display: inline-block;
        padding: 5px;
        margin-bottom: 2rem;
        font-size: 1.7rem;
        border: 1px solid var(--alpha-change-color-light-3);
        border-radius: var(--alpha-border-radius-form);
        color: var(--alpha-change-color-dark-1);
        &:hover {
            color: var(--alpha-primary-color);
        }   
        i {
            display: block;
            font-weight: 600;
        }
        &:not(:first-child) {
            margin-left: 1rem;
        }
        &.to-left, &.to-right {
            opacity: 0;
            transition: transform .4s, opacity .4s;
        }
        &.to-left {
            transform: translateX(40px);
        }
        &.to-right {
            transform: translateX(-40px);
        }
    }
    &:hover {
        .to-left, .to-right {
            opacity: 1;
            transform: translateX(0);
        }
    }
}
.compare-col {
    position: relative;
    &:nth-child(2) {
        .to-left {
            cursor: not-allowed;
            color: var(--alpha-light-color);
        }
    }
    &.last-col {
        .to-right {
            cursor: not-allowed;
            color: var(--alpha-light-color);
        }
    }
}

// 2. Compare Responsive
@include mq(lg, 'max') {
    .alpha-compare-table {
        .compare-value,
        .compare-field {
            flex: 0 0 33.33%;
        }
    }
}

@include mq(md, 'max') {
    .alpha-compare-table {
        .compare-value,
        .compare-field {
            flex: 0 0 50%;
        }
    }
}