/* Customer My Account > Manage Payments
 * Overrides the theme's narrow shop_table width and Braintree's cramped columns.
 */

.woocommerce-account .selectel-manage-payments {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.woocommerce-account .selectel-manage-payments__header {
    margin: 0 0 22px;
}

.woocommerce-account .selectel-manage-payments__header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    color: #303030;
    text-transform: none;
    letter-spacing: 0;
}

.woocommerce-account .selectel-manage-payments__header p {
    margin: 0;
    max-width: 42em;
    font-size: 14px;
    line-height: 1.55;
    color: #666;
}

.woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods,
.woocommerce-account table.shop_table.account-payment-methods-table,
.woocommerce-account .selectel-manage-payments table.shop_table {
    width: 100% !important;
    max-width: 100%;
    margin: 0 0 24px;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.woocommerce-account table.account-payment-methods-table thead tr,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods thead tr {
    border: 1px solid #e6e6e6;
    background: #fafafa;
}

.woocommerce-account table.account-payment-methods-table th,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods th {
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #303030;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.woocommerce-account table.account-payment-methods-table td,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods td {
    padding: 16px 14px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    border-top: 1px solid #eee;
    color: #303030;
}

.woocommerce-account table.account-payment-methods-table tbody tr.payment-method,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods tbody tr.payment-method {
    background: #fff;
}

.woocommerce-account table.account-payment-methods-table tbody tr.payment-method:hover,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods tbody tr.payment-method:hover {
    background: #fbfbfb;
}

/* Braintree title column is merged into Method by JS; keep it out of the layout. */
.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--title,
.woocommerce-account table.account-payment-methods-table .payment-method-title {
    display: none !important;
}

/* Restore Braintree-hidden header labels so the table is readable. */
.woocommerce-account table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--details span,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--default span,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods th.woocommerce-PaymentMethod--actions span {
    display: inline !important;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--method,
.woocommerce-account table.account-payment-methods-table .payment-method-method {
    min-width: 140px;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--details,
.woocommerce-account table.account-payment-methods-table .payment-method-details {
    min-width: 120px;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--expires,
.woocommerce-account table.account-payment-methods-table .payment-method-expires {
    width: 1%;
    text-align: left !important;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--default,
.woocommerce-account table.account-payment-methods-table .payment-method-default {
    width: 1%;
    text-align: left !important;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--subscriptions,
.woocommerce-account table.account-payment-methods-table .payment-method-subscriptions {
    min-width: 90px;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--actions,
.woocommerce-account table.account-payment-methods-table .payment-method-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--details img,
.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--method img,
.woocommerce-account table.account-payment-methods-table .payment-method-details img,
.woocommerce-account table.account-payment-methods-table .payment-method-method img,
.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--details svg,
.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--method svg {
    display: inline-block !important;
    width: 40px;
    max-width: 40px;
    height: auto;
    margin: 0 8px 0 0;
    vertical-align: middle;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--default mark,
.woocommerce-account table.account-payment-methods-table .payment-method-default mark,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods td.woocommerce-PaymentMethod--default mark {
    display: inline-block !important;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e8f4fb;
    color: #0b5f8a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--subscriptions a,
.woocommerce-account table.account-payment-methods-table .payment-method-subscriptions a {
    color: #076cf0;
    text-decoration: none;
}

.woocommerce-account table.account-payment-methods-table .woocommerce-PaymentMethod--subscriptions a:hover,
.woocommerce-account table.account-payment-methods-table .payment-method-subscriptions a:hover {
    text-decoration: underline;
}

.woocommerce-account .selectel-manage-payments .button,
.woocommerce-account table.account-payment-methods-table .button,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .button,
.woocommerce-account .selectel-manage-payments__actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: none;
    width: auto;
    min-width: 88px;
    margin: 0 0 0 8px !important;
    padding: 6px 16px;
    height: auto;
    line-height: 1.4;
    box-sizing: border-box;
    background: #00437a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: Raleway, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: capitalize;
    text-decoration: none;
    white-space: nowrap;
}

.woocommerce-account table.account-payment-methods-table .button:first-child,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .button:first-child,
.woocommerce-account .selectel-manage-payments__actions .button:first-child {
    margin-left: 0;
}

.woocommerce-account .selectel-manage-payments .button:hover,
.woocommerce-account table.account-payment-methods-table .button:hover,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .button:hover {
    background: #000;
    color: #fff;
}

.woocommerce-account table.account-payment-methods-table .button.delete,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .button.delete {
    background: #fff;
    color: #8a1f1f;
    border: 1px solid #d7d7d7;
}

.woocommerce-account table.account-payment-methods-table .button.delete:hover,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .button.delete:hover {
    background: #8a1f1f;
    color: #fff;
    border-color: #8a1f1f;
}

.woocommerce-account table.account-payment-methods-table .cancel-edit,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods .cancel-edit {
    margin-left: 8px;
    color: #076cf0;
    background: none;
    border: 0;
    padding: 0;
    min-width: 0;
    font-size: 14px;
    cursor: pointer;
}

.woocommerce-account .selectel-manage-payments input.nickname,
.woocommerce-account .selectel-manage-payments input.expires,
.woocommerce-account table.account-payment-methods-table input,
.woocommerce-account table.woocommerce-MyAccount-paymentMethods input {
    width: auto !important;
    max-width: 160px;
    height: 34px;
    padding: 0 10px;
    display: inline-block;
    box-sizing: border-box;
}

.woocommerce-account .selectel-manage-payments__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.woocommerce-account .selectel-manage-payments__actions .button,
.woocommerce-account .woocommerce-MyAccount-content > a.button[href*="add-payment-method"] {
    float: none !important;
    margin: 0;
}

.woocommerce-account .selectel-manage-payments .woocommerce-info,
.woocommerce-account .selectel-manage-payments .woocommerce-message {
    margin-bottom: 20px;
}

/* Add payment method form */
.woocommerce-account form#add_payment_method {
    width: 100%;
    max-width: 560px;
}

.woocommerce-account form#add_payment_method .woocommerce-PaymentMethods {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.woocommerce-account form#add_payment_method .woocommerce-PaymentMethod {
    padding: 14px 16px;
    border: 1px solid #e6e6e6;
    background: #fff;
}

.woocommerce-account form#add_payment_method .woocommerce-Button {
    float: none;
    background: #00437a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 15px;
    text-transform: capitalize;
}

.woocommerce-account form#add_payment_method .woocommerce-Button:hover {
    background: #000;
}

@media (max-width: 900px) {
    .woocommerce-account table.shop_table.account-payment-methods-table,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods,
    .woocommerce-account table.shop_table.account-payment-methods-table thead,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods thead,
    .woocommerce-account table.shop_table.account-payment-methods-table tbody,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody,
    .woocommerce-account table.shop_table.account-payment-methods-table tfoot,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tfoot {
        display: block;
        width: 100% !important;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table thead,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods thead {
        display: none;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr.payment-method,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr.payment-method {
        display: block;
        width: 100%;
        margin: 0 0 14px;
        padding: 14px 16px;
        border: 1px solid #e6e6e6;
        box-sizing: border-box;
        background: #fff;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr td {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100% !important;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid #f2f2f2;
        white-space: normal;
        text-align: right !important;
        background: transparent !important;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td:last-child,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td::before,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr td::before {
        content: attr(data-title);
        float: none;
        flex: 0 0 auto;
        color: #888;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        text-align: left;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td.woocommerce-PaymentMethod--actions::before,
    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td.payment-method-actions::before,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr td.woocommerce-PaymentMethod--actions::before {
        display: none !important;
        content: none;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td.woocommerce-PaymentMethod--actions,
    .woocommerce-account table.shop_table.account-payment-methods-table tbody tr td.payment-method-actions,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods tbody tr td.woocommerce-PaymentMethod--actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        padding-top: 12px;
    }

    .woocommerce-account table.shop_table.account-payment-methods-table .button,
    .woocommerce-account table.shop_table.woocommerce-MyAccount-paymentMethods .button {
        margin: 4px 0 4px 8px;
    }
}
