/* ============================================================================
   MSJ — Cart, Checkout, My Account, Order Received Page Branding
   Loaded only on: is_cart() || is_checkout() || is_account_page() ||
   is_wc_endpoint_url() (covers /my-account/orders/, /order-pay/,
   /order-received/, /edit-address/, /downloads/, /lost-password/, etc.)

   This file restyles WooCommerce's OWN core form/table markup rather than
   replacing it with custom templates — cart/checkout/account pages rely on
   WooCommerce's structural CSS for input widths, table layout, AJAX update
   states, etc., so we keep woocommerce-general.css loaded and skin on top
   of it (unlike the archive/single-product pages, which use fully custom
   templates and have WC's default CSS removed entirely).

   Uses the same design tokens as the rest of the theme (--gold, --msj-black,
   --font-display, --font-body, --font-sans etc., defined in style.css).
============================================================================ */

/* ────────────────────────────────────────────────────────────────────────
   SHARED — Page wrapper, headings, breadcrumb
──────────────────────────────────────────────────────────────────────── */
body.msj-wc-account-page {
    background: var(--msj-black);
}
body.msj-wc-account-page #content,
body.msj-wc-account-page .ast-container,
body.msj-wc-account-page .site-content {
    background: var(--msj-black);
}
body.msj-wc-account-page .entry-content,
body.msj-wc-account-page .ast-page-builder-template .ast-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

body.msj-wc-account-page .page-title,
body.msj-wc-account-page h1.entry-title,
body.msj-wc-account-page .woocommerce-cart h1,
body.msj-wc-account-page .woocommerce-checkout h1 {
    font-family: var(--font-display) !important;
    font-size: clamp(1.8rem, 3vw, 2.6rem) !important;
    font-weight: 400 !important;
    color: var(--msj-white) !important;
    text-align: center;
    margin-bottom: 2.5rem !important;
    letter-spacing: .02em;
}

body.msj-wc-account-page .woocommerce-breadcrumb {
    font-family: var(--font-sans);
    font-size: .68rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(250,247,240,.4);
    margin-bottom: 2rem;
    text-align: center;
}
body.msj-wc-account-page .woocommerce-breadcrumb a {
    color: rgba(201,168,76,.75);
    text-decoration: none;
}
body.msj-wc-account-page .woocommerce-breadcrumb a:hover { color: var(--gold-light); }

/* Generic text inside these pages */
body.msj-wc-account-page p,
body.msj-wc-account-page label,
body.msj-wc-account-page span:not(.msj-keep-default) {
    color: rgba(250,247,240,.75);
    font-family: var(--font-body);
}
body.msj-wc-account-page a {
    color: var(--gold);
}
body.msj-wc-account-page a:hover {
    color: var(--gold-light);
}

/* ────────────────────────────────────────────────────────────────────────
   SHARED — Buttons (Update Cart, Proceed to Checkout, Place Order, etc.)
──────────────────────────────────────────────────────────────────────── */
body.msj-wc-account-page .button,
body.msj-wc-account-page button.button,
body.msj-wc-account-page input.button,
body.msj-wc-account-page #place_order,
body.msj-wc-account-page .checkout-button,
body.msj-wc-account-page .wc-proceed-to-checkout .checkout-button {
    background: var(--gold) !important;
    color: var(--msj-black) !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: var(--font-sans) !important;
    font-size: .68rem !important;
    font-weight: 600 !important;
    letter-spacing: .18em !important;
    text-transform: uppercase !important;
    padding: 1rem 2rem !important;
    box-shadow: none !important;
    transition: all .3s ease !important;
    cursor: pointer;
}
body.msj-wc-account-page .button:hover,
body.msj-wc-account-page button.button:hover,
body.msj-wc-account-page input.button:hover,
body.msj-wc-account-page #place_order:hover,
body.msj-wc-account-page .checkout-button:hover {
    background: var(--gold-light) !important;
    color: var(--msj-black) !important;
    transform: translateY(-2px);
}
body.msj-wc-account-page .button.alt {
    background: var(--gold) !important;
}
/* Disabled / loading state */
body.msj-wc-account-page .button.disabled,
body.msj-wc-account-page .button:disabled {
    background: rgba(201,168,76,.3) !important;
    color: rgba(6,6,6,.6) !important;
    cursor: not-allowed;
}
/* Secondary / outline-style buttons (e.g. "Return to Shop", "Cancel order") */
body.msj-wc-account-page a.button.wc-backward,
body.msj-wc-account-page a.woocommerce-button.button.cancel {
    background: transparent !important;
    color: var(--gold) !important;
    border: 1px solid rgba(201,168,76,.4) !important;
}
body.msj-wc-account-page a.button.wc-backward:hover {
    background: rgba(201,168,76,.08) !important;
    border-color: var(--gold) !important;
}

/* ────────────────────────────────────────────────────────────────────────
   SHARED — Form fields (inputs, selects, textareas)
──────────────────────────────────────────────────────────────────────── */
body.msj-wc-account-page input[type="text"],
body.msj-wc-account-page input[type="email"],
body.msj-wc-account-page input[type="tel"],
body.msj-wc-account-page input[type="password"],
body.msj-wc-account-page input[type="number"],
body.msj-wc-account-page input[type="search"],
body.msj-wc-account-page textarea,
body.msj-wc-account-page select,
body.msj-wc-account-page .select2-container .select2-selection--single {
    background: var(--msj-dark2) !important;
    border: 1px solid rgba(201,168,76,.25) !important;
    color: var(--msj-white) !important;
    font-family: var(--font-sans) !important;
    font-size: .85rem !important;
    padding: .85rem 1rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    width: 100%;
}
body.msj-wc-account-page input:focus,
body.msj-wc-account-page textarea:focus,
body.msj-wc-account-page select:focus {
    border-color: var(--gold) !important;
    outline: none !important;
    box-shadow: 0 0 0 1px rgba(201,168,76,.3) !important;
}
body.msj-wc-account-page ::placeholder {
    color: rgba(250,247,240,.3) !important;
}
body.msj-wc-account-page .select2-container .select2-selection--single .select2-selection__rendered {
    color: var(--msj-white) !important;
    line-height: 2.4 !important;
}
body.msj-wc-account-page .select2-dropdown {
    background: var(--msj-dark2) !important;
    border: 1px solid rgba(201,168,76,.25) !important;
}
body.msj-wc-account-page .select2-results__option {
    color: var(--msj-white) !important;
    font-family: var(--font-sans) !important;
}
body.msj-wc-account-page .select2-results__option--highlighted {
    background: var(--gold) !important;
    color: var(--msj-black) !important;
}
body.msj-wc-account-page label {
    font-family: var(--font-sans) !important;
    font-size: .68rem !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    color: rgba(250,247,240,.5) !important;
    margin-bottom: .5rem !important;
    display: inline-block;
}
body.msj-wc-account-page .required {
    color: var(--gold) !important;
    text-decoration: none !important;
}

/* ────────────────────────────────────────────────────────────────────────
   CART PAGE
──────────────────────────────────────────────────────────────────────── */
.woocommerce-cart table.shop_table,
.woocommerce-cart table.cart {
    width: 100%;
    border-collapse: collapse;
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.1);
    margin-bottom: 2.5rem;
}
.woocommerce-cart table.shop_table thead th {
    font-family: var(--font-sans);
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    text-align: left;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(201,168,76,.18);
    background: var(--msj-dark3);
}
.woocommerce-cart table.shop_table td {
    padding: 1.4rem 1.2rem;
    border-bottom: 1px solid rgba(201,168,76,.08);
    color: rgba(250,247,240,.75);
    font-family: var(--font-body);
    vertical-align: middle;
}
.woocommerce-cart table.shop_table tr:last-child td {
    border-bottom: none;
}
.woocommerce-cart .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid rgba(201,168,76,.15);
}
.woocommerce-cart .product-name a {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--msj-white) !important;
    text-decoration: none;
}
.woocommerce-cart .product-name a:hover { color: var(--gold) !important; }
.woocommerce-cart .product-price,
.woocommerce-cart .product-subtotal {
    font-family: var(--font-display);
    color: var(--gold) !important;
    font-size: 1rem;
}
.woocommerce-cart .quantity .qty {
    width: 70px !important;
    text-align: center;
}
.woocommerce-cart .product-remove a.remove {
    color: rgba(250,247,240,.4) !important;
    background: transparent !important;
    font-size: 1.2rem;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(250,247,240,.15);
    border-radius: 50%;
    transition: all .3s;
}
.woocommerce-cart .product-remove a.remove:hover {
    color: var(--msj-black) !important;
    background: #d9534f !important;
    border-color: #d9534f !important;
}

/* Cart totals box */
.cart-collaterals .cart_totals,
.woocommerce-cart-form + .cart-collaterals .cart_totals {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
    padding: 2rem;
    float: none !important;
    width: 100% !important;
    max-width: 420px;
    margin-left: auto;
}
.cart_totals h2 {
    font-family: var(--font-display) !important;
    font-size: 1.3rem !important;
    color: var(--msj-white) !important;
    margin-bottom: 1.2rem !important;
    font-weight: 400 !important;
}
.cart_totals table.shop_table {
    background: none;
    border: none;
}
.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
    border-bottom: 1px solid rgba(201,168,76,.1);
    background: none;
    padding: .9rem 0;
    font-family: var(--font-sans);
    font-size: .8rem;
}
.cart_totals .order-total td {
    font-family: var(--font-display) !important;
    font-size: 1.3rem !important;
    color: var(--gold) !important;
}
.cart_totals .woocommerce-shipping-totals select {
    margin-top: .5rem;
}

/* Coupon form on cart page */
.woocommerce-cart .coupon {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    align-items: center;
}
.woocommerce-cart .coupon input#coupon_code {
    width: auto;
    flex: 1;
    min-width: 180px;
}
.woocommerce-cart .coupon button {
    flex-shrink: 0;
}

/* Cross-sells on cart page — reuse our product card grid styling */
.cart-collaterals + .cross-sells,
.cross-sells {
    margin-top: 4rem;
}
.cross-sells h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--msj-white);
    font-weight: 400;
    text-align: center;
    margin-bottom: 2rem;
}
.cross-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem;
    list-style: none !important;
    padding: 0 !important;
}
@media (max-width: 900px) {
    .cross-sells ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ────────────────────────────────────────────────────────────────────────
   CHECKOUT PAGE
──────────────────────────────────────────────────────────────────────── */
.woocommerce-checkout .col2-set,
.woocommerce-checkout #customer_details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.woocommerce-checkout h3#order_review_heading,
.woocommerce-checkout h3 {
    font-family: var(--font-display) !important;
    font-size: 1.3rem !important;
    color: var(--msj-white) !important;
    font-weight: 400 !important;
    margin: 2rem 0 1.2rem !important;
    padding-bottom: .8rem;
    border-bottom: 1px solid rgba(201,168,76,.15);
}
.woocommerce-checkout .form-row {
    margin-bottom: 1.2rem;
}
.woocommerce-checkout-review-order-table {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
    border-collapse: collapse;
    width: 100%;
}
.woocommerce-checkout-review-order-table thead th {
    font-family: var(--font-sans);
    font-size: .62rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(201,168,76,.18);
    text-align: left;
}
.woocommerce-checkout-review-order-table td,
.woocommerce-checkout-review-order-table th {
    padding: .9rem 1.2rem;
    border-bottom: 1px solid rgba(201,168,76,.08);
    color: rgba(250,247,240,.7);
    font-family: var(--font-body);
}
.woocommerce-checkout-review-order-table .product-name {
    font-family: var(--font-body);
}
.woocommerce-checkout-review-order-table .order-total td,
.woocommerce-checkout-review-order-table .order-total th {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
    border-top: 1px solid rgba(201,168,76,.2);
    border-bottom: none;
}

/* Payment methods box */
#payment {
    background: var(--msj-dark2) !important;
    border: 1px solid rgba(201,168,76,.15) !important;
    border-radius: 0 !important;
}
#payment ul.payment_methods {
    border-bottom: 1px solid rgba(201,168,76,.12) !important;
}
#payment ul.payment_methods li {
    font-family: var(--font-sans);
    font-size: .85rem;
    color: rgba(250,247,240,.75);
    padding: .9rem 1.2rem;
}
#payment ul.payment_methods li input {
    accent-color: var(--gold);
}
#payment div.payment_box {
    background: var(--msj-dark3) !important;
    color: rgba(250,247,240,.65) !important;
    font-family: var(--font-body);
    border-radius: 0 !important;
}
#payment div.payment_box::before {
    border-bottom-color: var(--msj-dark3) !important;
}
#place_order {
    width: 100%;
    margin-top: 1.5rem !important;
    padding: 1.1rem 2rem !important;
    font-size: .72rem !important;
}

/* Checkout notices/login prompt */
.woocommerce-form-login,
.woocommerce-form-coupon {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
    padding: 1.6rem;
    margin-bottom: 1.5rem;
}
.woocommerce-info {
    border-radius: 0 !important;
}

/* Order review accordion arrow / shipping calc */
.shipping-calculator-button {
    color: var(--gold) !important;
    font-family: var(--font-sans);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ────────────────────────────────────────────────────────────────────────
   ORDER RECEIVED / THANK YOU PAGE
──────────────────────────────────────────────────────────────────────── */
.woocommerce-order {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.woocommerce-order .woocommerce-notice--success,
.woocommerce-order p.woocommerce-thankyou-order-received {
    font-family: var(--font-display) !important;
    font-size: 1.4rem !important;
    color: var(--gold) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 2.5rem !important;
    display: block !important;
    text-align: center;
}
.woocommerce-order .woocommerce-notice--success::before {
    display: none;
}
ul.woocommerce-order-overview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0 0 3rem;
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
}
ul.woocommerce-order-overview li {
    flex: 1;
    min-width: 150px;
    padding: 1.5rem 1.2rem;
    text-align: center;
    border-right: 1px solid rgba(201,168,76,.1);
}
ul.woocommerce-order-overview li:last-child { border-right: none; }
ul.woocommerce-order-overview li strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    margin-top: .4rem;
}
ul.woocommerce-order-overview li::before {
    content: attr(class);
}
.woocommerce-order-overview__order,
.woocommerce-order-overview__date,
.woocommerce-order-overview__total,
.woocommerce-order-overview__payment-method {
    font-family: var(--font-sans);
    font-size: .6rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(250,247,240,.4);
}

.woocommerce-order-details,
.woocommerce-customer-details {
    text-align: left;
    margin-top: 3rem;
}
.woocommerce-order-details h2,
.woocommerce-customer-details h2 {
    font-family: var(--font-display) !important;
    font-size: 1.3rem !important;
    color: var(--msj-white) !important;
    font-weight: 400 !important;
    text-align: left;
    margin-bottom: 1.2rem !important;
}
.woocommerce-order-details table.shop_table,
.woocommerce-customer-details address {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
}
.woocommerce-customer-details address {
    padding: 1.5rem;
    font-style: normal;
    color: rgba(250,247,240,.7);
    font-family: var(--font-body);
}

/* ────────────────────────────────────────────────────────────────────────
   MY ACCOUNT — Dashboard, Orders, Downloads, Addresses, Account Details
──────────────────────────────────────────────────────────────────────── */
.woocommerce-MyAccount-navigation {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.12);
    margin-bottom: 3rem;
}
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}
.woocommerce-MyAccount-navigation ul li {
    border-right: 1px solid rgba(201,168,76,.1);
}
.woocommerce-MyAccount-navigation ul li:last-child { border-right: none; }
.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 1rem 1.6rem;
    font-family: var(--font-sans) !important;
    font-size: .68rem !important;
    letter-spacing: .15em !important;
    text-transform: uppercase !important;
    color: rgba(250,247,240,.5) !important;
    text-decoration: none !important;
    transition: all .3s;
}
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
    color: var(--gold) !important;
    background: rgba(201,168,76,.06);
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: rgba(250,247,240,.35) !important;
}

.woocommerce-MyAccount-content {
    background: transparent;
}
.woocommerce-MyAccount-content > p:first-child {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(250,247,240,.65);
}
.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content a.button {
    background: var(--gold) !important;
    color: var(--msj-black) !important;
}

/* Orders table */
.woocommerce-orders-table,
table.account-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.1);
}
.woocommerce-orders-table thead th {
    font-family: var(--font-sans);
    font-size: .6rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(201,168,76,.18);
    background: var(--msj-dark3);
}
.woocommerce-orders-table td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(201,168,76,.08);
    color: rgba(250,247,240,.7);
    font-family: var(--font-body);
}
.woocommerce-orders-table .order-status {
    font-family: var(--font-sans);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
}
.woocommerce-orders-table .woocommerce-button {
    font-size: .58rem !important;
    padding: .6rem 1.2rem !important;
    margin: 0 .3rem .3rem 0 !important;
}

/* Addresses */
.woocommerce-Address {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.12);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}
.woocommerce-Address-title h3 {
    font-family: var(--font-display) !important;
    font-size: 1.1rem !important;
    color: var(--msj-white) !important;
    display: inline-block;
    margin: 0 !important;
}
.woocommerce-Address-title .edit {
    float: right;
    font-family: var(--font-sans);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
}
.woocommerce-Address address {
    font-style: normal;
    color: rgba(250,247,240,.65);
    font-family: var(--font-body);
    margin-top: 1rem;
}

/* Account details form */
.woocommerce-EditAccountForm fieldset {
    border: 1px solid rgba(201,168,76,.15);
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.woocommerce-EditAccountForm legend {
    font-family: var(--font-display);
    color: var(--msj-white);
    padding: 0 .6rem;
    font-size: 1rem;
}

/* Lost password */
.woocommerce-ResetPassword,
.woocommerce-form-login {
    max-width: 480px;
    margin: 0 auto;
}

/* Login/Register page (My Account when logged out) */
.woocommerce-form-login,
.woocommerce-form-register {
    background: var(--msj-dark2);
    border: 1px solid rgba(201,168,76,.15);
    padding: 2.2rem;
}
.woocommerce-form-login-toggle,
.woocommerce-form-register-toggle {
    background: none !important;
    border: none !important;
}
.u-column1, .u-column2 {
    width: 100%;
    float: none;
}
@media (min-width: 768px) {
    .login.woocommerce form.woocommerce-form-login,
    .login.woocommerce form.woocommerce-form-register {
        display: inline-block;
        vertical-align: top;
        width: 47%;
    }
    .u-column1 { float: left; width: 47%; }
    .u-column2 { float: right; width: 47%; }
}

/* Mobile responsive for account/cart/checkout */
@media (max-width: 768px) {
    .woocommerce-cart table.shop_table thead { display: none; }
    .woocommerce-cart table.shop_table,
    .woocommerce-cart table.shop_table tbody,
    .woocommerce-cart table.shop_table tr,
    .woocommerce-cart table.shop_table td {
        display: block;
        width: 100%;
    }
    .woocommerce-cart table.shop_table tr {
        border-bottom: 1px solid rgba(201,168,76,.15);
        padding: 1rem 0;
    }
    .cart_totals { max-width: 100%; }
    .woocommerce-MyAccount-navigation ul { flex-direction: column; }
    .woocommerce-MyAccount-navigation ul li { border-right: none; border-bottom: 1px solid rgba(201,168,76,.1); }
    ul.woocommerce-order-overview li { border-right: none; border-bottom: 1px solid rgba(201,168,76,.1); flex: 1 0 100%; }
}
