/* -------------------------------------------
	My Account Page
    - Base
    - My Account Navigation & Content
    - Reset Password
    - Dashboard
    - Orders
    - Address
    - Account Details
    - Thankyou Page
    - Login / Register Form
---------------------------------------------- */

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

// Base
.logged-in.woocommerce-account .page-wrapper .main {
    padding-top: 4.2rem;
}

// My Account Navigation & Content
.woocommerce-MyAccount-navigation>ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.woocommerce-MyAccount-navigation ul {
    position: sticky;
    top: calc(var(--alpha-top-sticky-h) + 30px);
    padding: 2.2rem 0;
    background-color: var(--alpha-change-color-light-4, #f3f4f6);
    border-radius: var(--alpha-border-radius);
}

.woocommerce-MyAccount-navigation-link {
    >a {
        display: block;
        padding: .6rem 3.4rem;
        color: var(--alpha-change-color-dark-1);

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

    &.is-active>a {
        color: var(--alpha-primary-color);
    }
}

.woocommerce-MyAccount-navigation {
    li a:#{$before} {
        font-family: $theme-font;
        font-size: 1.2em;
        vertical-align: middle;
        margin-#{$right}: 11px;
    }

    li[class*=order] a:#{$before},
    li[class*=download] a:#{$before},
    li[class*=address] a:#{$before} {
        font-size: 1.25em;
    }

    li[class*=dashboard] a:#{$before} {
        content: '\ea21';
        position: relative;
        top: -2px;
    }

    li[class*=order] a:#{$before} {
        content: '\ea22';
    }

    li[class*=download] a:#{$before} {
        content: '\ea23';
    }

    li[class*=address] a:#{$before} {
        content: '\ea24';
    }

    li[class*=account] a:#{$before} {
        content: '\ea25';
    }

    li[class*=wishlist] a:#{$before} {
        content: '\ea26';
    }

    li[class*=store-dashboard] a:#{$before} {
        content: '\ea2c';
    }

    li[class*=conversation] a:#{$before} {
        content: '\ea29';
    }

    li[class*=offer] a:#{$before} {
        content: '\ea28';
    }

    li[class*=purchase-lists] a:#{$before} {
        content: '\ea2a';
    }

    li[class*=payment] a:#{$before} {
        content: '\ea2b';
    }

    li[class*=logout] a:#{$before} {
        content: '\ea27';
    }
}

.icon-orders::before {
    content: '\e979';
}

.icon-downloads::before {
    content: '\e957';
}

.icon-addresses::before {
    content: '\e9dc';
}

.icon-account::before {
    content: '\e96f';
}

.icon-wishlist::before {
    content: '\e939';
}

.icon-vendor::before {
    content: '\ea2c';
}

.icon-logout::before {
    content: '\e931';
}

.woocommerce-MyAccount-content,
.customer-details {
    p {
        line-height: 1.8;
    }
}

.woocommerce-MyAccount-content p.form-row {
    margin-bottom: -.5rem;
}

@include mq(md) {
    .woocommerce-MyAccount-navigation {
        flex: 0 0 295px;
        max-width: 295px;
    }

    .woocommerce-MyAccount-content {
        flex-basis: calc(100% - 295px);
        max-width: calc(100% - 295px);
    }
}

@include mq(xl) {
    .woocommerce-MyAccount-content {
        padding-#{$left}: 3.5rem
    }
}

@include mq(md, max) {
    .woocommerce-MyAccount-navigation {
        margin-bottom: 2rem;
    }
}

// Reset Password
.lost_reset_password .form-row {
    width: 100%;
}

// Dashboard
.myaccount-content {
    .greeting {
        font-size: 1.6rem;

        strong {
            color: var(--alpha-change-color-dark-1);
            font-weight: 600;
        }
    }

    .icon-boxes-wrapper {
        margin-top: 3.5rem;
    }

    .icon-box {
        border: 1px solid var(--alpha-change-border-color);
        border-radius: var(--alpha-border-radius);
        transition: all .4s;

        a {
            display: block;
            padding: 4rem 2rem;
            color: var(--alpha-change-color-dark-1);

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

        .icon-box-icon {
            display: inline-block;
            font-size: 5rem;
            font-weight: normal;
            color: inherit;
            margin-bottom: 1rem;
            line-height: 1;

            &::before {
                font-family: $theme-font;
            }
        }

        .icon-orders,
        .icon-downloads,
        .icon-logout {
            &:before {
                font-family: $framework-font;
            }
        }

        .icon-orders,
        .icon-downloads {
            font-size: 5.5rem;
            margin-top: -.2rem;
            margin-bottom: .7rem;
        }


        p {
            text-transform: capitalize;
            color: inherit;
        }
    }
}

// Orders
.woocommerce-orders-table {
    border-bottom: 1px solid var(--alpha-change-border-color);

    thead th {
        padding: .7rem 1rem;
    }

    th.woocommerce-orders-table__header-order-number {
        width: 20.86%;
    }

    th.woocommerce-orders-table__header-order-date {
        width: 20.21%;
    }

    th.woocommerce-orders-table__header-order-status {
        width: 20%;
    }

    th.woocommerce-orders-table__header-order-total {
        width: 25.48%;
    }

    .woocommerce-orders-table__cell-order-number,
    td {
        padding: 2.1rem 1rem;

        a:not(.btn) {
            font-weight: var(--alpha-body-font-weight);
            color: var(--alpha-body-color);

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

    .woocommerce-button {
        border-width: 1px;

        &.pay {
            margin-bottom: 1rem;
        }

        &.cancel {
            margin-top: 1rem;
        }
    }

    @include mq(lg, max) {
        td {
            display: flex;
            align-items: center;
            border-top: none;
            padding: 5px 0;

            &:before {
                content: attr(data-title);
                margin-#{$right}: auto;
                color: var(--alpha-change-color-dark-1);
                font-size: 1.4rem;
                font-weight: 500;
                line-height: 1.875;
            }

            .btn {
                width: auto;
            }
        }

        tr {
            display: block;
            position: relative;
            margin-bottom: 1.5rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px solid var(--alpha-change-border-color);

            &:last-child {
                border: none;
                padding-bottom: 0;
            }
        }

        thead {
            display: none;
        }
    }
}

.woocommerce-order-details__title {
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    line-height: .73;
    text-transform: uppercase;
}

.status {
    display: inline-block;
    padding: 1px 5px;
    background: var(--alpha-change-color-light-3);
    color: var(--alpha-change-color-dark-1);
    font-size: 1.2rem;
}

.status-pending,
.status-processing {
    color: var(--alpha-change-color-light-1);
    background: var(--alpha-secondary-color);
}

.status-completed {
    color: var(--alpha-change-color-light-1);
    background: $success-color;
}

.status-cancelled,
.status-refunded {
    color: var(--alpha-change-color-light-1);
    background: var(--alpha-change-color-dark-1);
}

.status-failed {
    color: var(--alpha-change-color-light-1);
    background: $danger-color;
}

.order_details td {
    vertical-align: top;
}

.wc-item-meta {
    padding-#{$left}: 2rem;
    margin: 1rem 0 0;
    border-left: 1px solid var(--alpha-change-border-color);
    text-transform: lowercase;
    list-style: none;

    p {
        margin: 0;
        line-height: 1;
        display: inline-block;
    }
}

.wc-item-meta-label {
    color: var(--alpha-change-color-dark-1);
    font-weight: 400;
}

.woocommerce-order-details {
    padding-top: 2rem;

    h2 {
        margin-bottom: 3rem;
        font-size: 2rem;
        line-height: .7;
    }

    .order_details {
        padding: 2.7rem 3rem .4rem;
        border: 1px solid var(--alpha-change-border-color);
    }

    .button {
        padding: 1rem 1.8rem;
        color: var(--alpha-change-color-light-1);
        border-color: var(--alpha-change-color-dark-1);
        background-color: var(--alpha-change-color-dark-1);

        &:hover {
            color: var(--alpha-change-color-light-1);
            border-color: var(--alpha-change-color-dark-1-hover);
            background-color: var(--alpha-change-color-dark-1-hover);
        }
    }

    .order-actions .button {
        border-color: var(--alpha-change-border-color);
        background-color: var(--alpha-change-border-color);
        color: var(--alpha-change-color-dark-1);
        border-width: 1px;

        &:hover {
            border-color: var(--alpha-change-color-dark-1);
            background-color: var(--alpha-change-color-dark-1);
            color: var(--alpha-change-color-light-1);
        }
    }

    header {
        padding: 2rem 0 0;
    }

    // Dokan compatibility
    .dokan-info {
        margin-bottom: 3rem;
    }

    thead th {
        padding: 0 0 2.2rem;
        border-bottom: 1px solid var(--alpha-change-border-color);
        font-size: 1.8rem;
        line-height: 1;

        &.product-total {
            text-indent: -9999px;
        }
    }

    tbody {
        padding: 2rem 0 .4rem;

        tr:first-child {
            td {
                padding-top: 3.5rem;
            }
        }

        td {
            border-top: 0;
            padding: 1rem 0;
            font-size: 1.4rem;
            line-height: 1.43;
        }

        .product-name {
            color: var(--alpha-grey-color);

            a {
                color: inherit;

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

    tfoot {
        tr {
            font-weight: 600;

            &:first-child {

                td,
                th {
                    border-top: 0;
                }
            }

            &:last-child {

                td,
                th {
                    padding: 2.25rem 0;
                }

                td {
                    font-size: 2rem;
                    font-weight: 600;
                    line-height: 1;
                    color: var(--alpha-change-color-dark-1);
                }
            }
        }

        td,
        th {
            padding: 2rem 0;
            line-height: 1.25;
        }

        th {
            font-weight: 600;
            font-size: 1.6rem;
            color: var(--alpha-change-color-dark-1);
        }
    }

    .order-again {
        margin-top: 3rem;
    }
}

@include mq(xs, max) {
    .woocommerce-order-details {
        .order_details {
            padding-left: 2rem;
            padding-right: 2rem;
        }
    }
}

.woocommerce-order-details {
    margin-bottom: 5.5rem;
}

.woocommerce-customer-details {
    .addresses {
        position: relative;

        &>* {
            margin-bottom: 2rem;
        }
    }
}

// Address
.woocommerce-Address,
.woocommerce-customer-details {

    .woocommerce-column__title,
    h2,
    h3 {
        margin-bottom: 1.8rem;
        padding-bottom: 1.8rem;
        font-size: 1.07em;
        font-weight: 600;
        line-height: 1;
        text-transform: capitalize;
        border-bottom: 1px solid var(--alpha-change-border-color);
    }
}

.woocommerce-customer-details {
    address {
        .woocommerce-customer-details--phone {
            margin-bottom: 2rem;
        }

        p {
            font-family: inherit;
        }
    }

    >address {
        margin-bottom: 3rem;
    }
}

.address-table {

    th,
    td {
        padding: .4rem 0;
        font-size: .93em;
        font-weight: normal;
        line-height: 1.6;
        border: 0;
    }

    th {
        width: 10rem;
        color: var(--alpha-grey-color);
    }

    td {
        color: var(--alpha-change-color-dark-1);
    }
}

.woocommerce-edit_address-form h2,
.woocommerce-edit_address-form h3 {
    font-size: 2rem;
}

.woocommerce-address-fields__field-wrapper {
    margin-bottom: 1.5rem;
}

.woocommerce-address-fields>p:last-child {
    margin-top: 2.5rem;
    margin-bottom: 0;
}

// Account Details
.edit-account {

    fieldset {
        margin: 3rem 0 -2rem;
        padding: var(--alpha-gap);

        p.form-row {
            margin-bottom: 2.5rem;
        }
    }

    legend {
        color: var(--alpha-change-color-dark-1);
        font-size: 1.8rem;
        font-weight: 600;
    }

    .wp-editor-wrap {
        border: 0;
    }

    .woocommerce-form-row-biography {
        padding-bottom: 0;
    }

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

// Thankyou Page
.back-to-list {
    &:#{$after} {
        position: relative;
        top: .05em;
        content: if-ltr("\e92c", "\e92b");
        font-family: $framework-font;
        margin-#{$left}: var(--alpha-btn-icon-spacing);
    }
}

.order-failed {
    font-size: 1.5rem;
}

.order-failed-actions {
    .button {
        &+.button {
            margin-#{$left}: .5rem;
        }
    }
}

.order-success {
    text-align: center;
    padding: 3.6rem 1.5rem;
    border: 2px solid var(--alpha-primary-color);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--alpha-change-color-dark-1);

    i {
        margin-#{$right}: 1.4rem;
        font-size: 1.167em;
        vertical-align: middle;
        color: var(--alpha-primary-color);
    }
}

.woocommerce-order-overview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 3.2rem;
    margin-bottom: 3rem;
    list-style: none;
    padding-#{$left}: 0;

    .overview-item {
        padding: 1rem;
        flex-grow: 1;
        font-size: 1.8rem;
        line-height: 1.67;
        text-align: center;

        strong {
            display: block;
            color: var(--alpha-change-color-dark-1);
        }
    }
}

@include mq(lg, max) {
    .woocommerce-order-overview {
        .overview-item {
            font-size: 1.6rem;
        }
    }

    .product-add-to-cart {
        .yith-product-actions .btn {
            margin: 0 0 1rem;
        }
    }
}

@include mq(md, max) {
    .woocommerce-order-overview {
        display: block;

        .overview-item {
            padding: 1rem 0;
            text-align: left;

            >span {
                display: inline-block;
                min-width: 50%;
            }

            strong {
                display: inline-block;
            }
        }
    }

    .order-success {
        padding: 1rem 2rem;
        font-size: 1.8rem;
    }
}

@include mq(xs, max) {
    .woocommerce-order-overview {
        .overview-item {
            font-size: 1.4rem;
        }
    }
}

.woocommerce-thankyou-order-received.alert {
    margin-top: 0;
}

// Login / Register Form
.woocommerce-form-login.register {
    .woocommerce-privacy-policy-text p {
        padding-top: 0;
    }
}