/* Checkout redesign — Order Summary (left) / Complete Checkout (right). */

.tc-checkout {
    --tc-primary: #273C66;
    --tc-primary-dark: #1F3052;
    --tc-cta: #273C66;
    --tc-cta-hover: #1F3052;
    --tc-accent: #FF9C14;
    --tc-text: #2B354E;
    --tc-muted: #64748B;
    --tc-border: #E2E8F0;
    --tc-line: #EDF0F5;
    --tc-soft: #F5F7FB;
    --tc-offer: #FF9C14;
    --tc-radius: 8px;

    max-width: 1410px;
    margin: 0 auto;
    padding: 12px 16px 24px;
    font-family: "Rubik", sans-serif;
    color: var(--tc-text);
}

/* Page chrome carried over from the previous checkout */
.woocommerce-checkout footer,
.woocommerce-checkout section#title,
.woocommerce-checkout #content .container > h2 {
    display: none !important;
}

/* No white cover during totals refreshes, so payment stays tappable; the server re-checks totals on submit.
   While placing the order (.tc-is-processing) the overlay stays, under our processing screen. */
html:not(.tc-is-processing) .woocommerce-checkout .blockUI.blockOverlay {
    display: none !important;
}
.woocommerce-checkout #payment{
    border: none !important;
}
/* Elements replaced by the new layout */
.tc-checkout .woocommerce-form-login-toggle,
.tc-checkout .woocommerce-form-coupon-toggle,
.tc-checkout form.checkout_coupon,
.tc-checkout table.woocommerce-checkout-review-order-table,
.tc-checkout .woocommerce-privacy-policy-text,
.tc-checkout .woocommerce-billing-fields > h3 {
    display: none !important;
}

.tc-checkout h2,
.tc-checkout h3,
.tc-checkout h4 {
    font-family: inherit;
    color: var(--tc-text);
    letter-spacing: 0;
}

.tc-checkout a {
    color: var(--tc-primary);
}

/* Notices + login form above the grid */
.tc-checkout__notices form.woocommerce-form-login {
    max-width: 640px;
    margin: 0 0 24px auto;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
}

/* Grid */
.tc-checkout__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.tc-card {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 18px 20px;
}

.tc-checkout .tc-card__title {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}

/* ---------- Order Summary ---------- */

.tc-summary {
    transition: opacity .2s;
}

/* While totals refresh: no fade (the quantity box shows a spinner); Remove and the offer
   wait so they can't fire twice. The stepper stays usable (checkout.js queues the change). */
.tc-summary.is-loading .tc-item__remove,
.tc-summary.is-loading .tc-offer {
    pointer-events: none;
}

.tc-item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 0 0 12px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--tc-line);
}

.tc-item__thumb img {
    display: block;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover;
    border-radius: 6px;
    background: var(--tc-soft);
}

.tc-item__name {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 8px;
}

.tc-item__name dl.variation {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--tc-muted);
}

.tc-item__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tc-qty {
    display: inline-flex;
    align-items: center;
    height: 26px;
    border: 1px solid var(--tc-border);
    border-radius: 3px;
}

.tc-checkout .tc-qty__btn {
    width: 26px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--tc-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.tc-checkout .tc-qty__btn:disabled {
    opacity: .35;
    cursor: default;
}

.tc-checkout .tc-qty__val {
    width: 40px;
    min-width: 34px;
    height: 24px;
    margin: 0;
    padding: 0;
    line-height: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--tc-text);
    background: transparent;
    border: 0;
    border-left: 1px solid var(--tc-border);
    border-right: 1px solid var(--tc-border);
    border-radius: 0;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.tc-qty__val::-webkit-outer-spin-button,
.tc-qty__val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tc-checkout .tc-item__remove {
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: var(--tc-muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.tc-item__price,
.tc-item__price .amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--tc-primary);
    white-space: nowrap;
}

.tc-item__price del {
    display: none;
}

/* Exclusive Offer */
.tc-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin: 0 0 14px;
    border: 1px solid #CBD4E6;
    border-radius: var(--tc-radius);
    background: linear-gradient(180deg, #fff 35%, #E9EDF5 100%);
}

.tc-checkout .tc-offer h4 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--tc-offer);
}

.tc-offer p {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.5;
}

.tc-offer p strong,
.tc-offer p .amount {
    color: var(--tc-text);
    font-weight: 700;
}

.tc-checkout .tc-offer__toggle {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tc-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-transform: none;
    cursor: pointer;
}

.tc-checkout .tc-offer__courses {
    margin: 10px 0 0;
    padding: 0 0 0 20px;
    list-style: decimal;
}

.tc-checkout .tc-offer__courses[hidden] {
    display: none;
}

.tc-checkout .tc-offer__courses li {
    margin: 0 0 4px;
    padding-left: 2px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--tc-muted);
}

.tc-checkout .tc-offer__add,
.tc-checkout .tc-btn-outline {
    flex-shrink: 0;
    margin: 0;
    padding: 0 14px;
    height: 38px;
    background: #fff;
    border: 1px solid var(--tc-cta);
    border-radius: 4px;
    color: var(--tc-cta);
    font-size: 15px;
    font-weight: 600;
    line-height: 36px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

/* Navy outline, like the Place Order button. */
.tc-checkout .tc-offer__add:hover,
.tc-checkout .tc-btn-outline:hover {
    background: var(--tc-cta);
    color: #fff;
}

/* Discount code */
.tc-coupon {
    padding: 12px 0;
    border-top: 1px solid var(--tc-line);
    border-bottom: 1px solid var(--tc-line);
}

.tc-checkout .tc-coupon__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: var(--tc-text);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
}

.tc-chevron {
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-left: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s;
}

.tc-coupon__toggle[aria-expanded="false"] .tc-chevron {
    transform: rotate(225deg);
}

.tc-coupon__body {
    padding-top: 12px;
}

.tc-coupon__body[hidden] {
    display: none;
}

.tc-coupon__row {
    display: flex;
    gap: 12px;
}

.tc-checkout .tc-coupon__row input {
    flex: 1;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--tc-border);
    border-radius: 4px;
    box-shadow: none;
    font-size: 14px;
}

.tc-checkout .tc-coupon__apply {
    width: 110px;
    height: 42px;
    line-height: 40px;
}

.tc-coupon__msg:empty {
    display: none;
}

.tc-coupon__msg {
    margin-top: 12px;
}

.tc-checkout .tc-coupon__msg ul,
.tc-checkout .tc-coupon__msg div {
    margin: 0 !important;
    padding: 10px 14px !important;
    font-size: 14px;
}

/* Totals */
.tc-summary-totals {
    padding-top: 14px;
}

.tc-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 15px;
}

.tc-row > span:last-child,
.tc-row .amount {
    font-weight: 700;
    color: var(--tc-text);
    text-align: right;
}

.tc-row.cart-discount > span:last-child,
.tc-row.cart-discount .amount {
    color: #1A8D3F;
}

.tc-row .woocommerce-remove-coupon {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
}

.tc-row.order-total {
    margin: 6px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--tc-line);
    font-size: 18px;
    font-weight: 700;
}

.tc-row.order-total > span:last-child,
.tc-row.order-total .amount {
    color: var(--tc-primary);
}

.tc-row.order-total small,
.tc-row.order-total .off_textcart {
    display: block;
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--tc-muted);
}

.tc-row.order-total .off_textcart .amount,
.tc-row.order-total small .amount {
    font-weight: 400;
    color: var(--tc-muted);
}

/* ---------- Complete Checkout ---------- */

.tc-checkout form.checkout {
    margin: 0;
}

.tc-checkout #wc-stripe-express-checkout-element {
    margin-top: 0 !important;
}

.tc-checkout #wc-stripe-express-checkout-button-separator {
    position: relative;
    margin: 14px 0 16px !important;
    font-size: 0;
    line-height: 1;
    text-align: center;
}

.tc-checkout #wc-stripe-express-checkout-button-separator::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--tc-border);
}

.tc-checkout #wc-stripe-express-checkout-button-separator::after {
    content: "or pay by Card";
    position: relative;
    padding: 0 20px;
    background: #fff;
    font-size: 14px;
    color: var(--tc-text);
}

.tc-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.tc-checkout .tc-section-title {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
}

.tc-login-link {
    font-size: 14px;
}

.tc-login-link a {
    margin-left: 4px;
    font-weight: 700;
    text-decoration: underline;
}

/* Billing fields */
.tc-checkout #customer_details,
.tc-checkout #customer_details .col-1 {
    width: 100%;
    float: none;
    max-width: none;
    padding: 0;
    margin: 0;
}

.tc-checkout .woocommerce-account-fields {
    display: block;
}

.tc-checkout .woocommerce-billing-fields__field-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
}



.tc-checkout form.checkout .form-row {
    float: none;
    width: 100%;
    padding: 0;
    margin: 0 0 12px;
}

.tc-checkout form.checkout .form-row label {
    display: block;
    margin: 0 0 5px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400;
    color: var(--tc-text);
}

.tc-checkout form.checkout .form-row label.checkbox,
.tc-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tc-checkout form.checkout .form-row .required {
    color: inherit;
    text-decoration: none;
    border: 0;
}

.tc-checkout form.checkout .form-row input.input-text,
.tc-checkout form.checkout .form-row select,
.tc-checkout form.checkout .select2-container .select2-selection--sitce {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--tc-border);
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    font-size: 14px;
    color: var(--tc-text);
}

.tc-checkout form.checkout .form-row input.input-text:focus {
    border-color: var(--tc-primary);
    outline: none;
}

.tc-checkout form.checkout .woocommerce-invalid input.input-text {
    border-color: #D63638;
}

.tc-checkout .select2-container .select2-selection--sitce .select2-selection__rendered {
    padding: 0;
    line-height: 40px;
    color: var(--tc-text);
}

.tc-checkout .select2-container--default .select2-selection--sitce .select2-selection__arrow {
    top: 7px;
    right: 12px;
}

.tc-checkout #woo_ml_subscribe_field {
    margin: 0 0 12px;
}

/* Payment methods — tab bar built by checkout.js; Stripe renders the
   Card Number / Expiry / Security Code fields inside the selected box and
   takes its input styling from the inputs above. */
.tc-checkout #payment {
    background: transparent;
    border-radius: 0;
}

.tc-pm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 14px;
}

.tc-checkout .tc-pm-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 170px;
    height: 40px;
    margin: 0;
    padding: 0 20px;
    background: #E9EDF5;
    border: 2px solid transparent;
    border-radius: 3px;
    box-shadow: none;
    color: var(--tc-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.tc-checkout .tc-pm-tab:hover {
    background: #DCE3F0;
}

.tc-checkout .tc-pm-tab.is-active {
    background: #fff;
    border-color: var(--tc-primary);
}

.tc-pm-tab__paypal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 800;
    font-style: italic;
    color: #002991;
}

.tc-pm-tab__paypal img {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0 !important;
}

.tc-pm-tab__paypal span {
    letter-spacing: -.2px;
}

.tc-checkout #payment ul.payment_methods {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    list-style: none;
}

.tc-checkout #payment ul.payment_methods > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The tab bar replaces the radio + label of each gateway */
.tc-checkout #payment ul.tc-pm-tabbed > li > input[name="payment_method"],
.tc-checkout #payment ul.tc-pm-tabbed > li > label {
    display: none !important;
}

/* Without JS (or before it runs) the plain list still works */
.tc-checkout #payment ul.payment_methods:not(.tc-pm-tabbed) > li {
    margin: 0 0 12px;
}

.tc-checkout #payment ul.payment_methods:not(.tc-pm-tabbed) > li > label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tc-text);
    cursor: pointer;
}

.tc-checkout #payment ul.payment_methods > li > label img {
    max-height: 24px;
    margin: 0 0 0 4px;
}

.tc-checkout #payment div.payment_box {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 14px;
    color: var(--tc-muted);
}

.tc-checkout #payment ul.payment_methods:not(.tc-pm-tabbed) div.payment_box {
    margin-top: 12px;
}

.tc-checkout #payment div.payment_box::before {
    display: none;
}

.tc-checkout #payment div.payment_box > p:first-child {
    margin-top: 0;
}

.tc-checkout #payment div.payment_box fieldset {
    padding: 0;
    margin: 0;
    border: 0;
}

.tc-checkout #payment .wc-stripe-upe-element {
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
}

.tc-checkout #payment .payment_box .testmode-info {
    margin: 0 0 16px;
    font-size: 13px;
}

.tc-checkout #payment .woocommerce-SavedPaymentMethods-saveNew {
    margin: 16px 0 0;
}

.tc-checkout #payment .form-row.place-order {
    padding: 0;
    margin: 0;
}

.tc-checkout .tc-terms {
    margin: 0 0 10px;
    padding: 0;
    font-size: 13px;
    color: var(--tc-text);
}

.tc-checkout .tc-terms a {
    margin-left: 4px;
    font-weight: 600;
    text-decoration: underline;
}

.tc-checkout #payment #place_order,
.tc-checkout #place_order {
    display: block;
    float: none;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    background: var(--tc-cta) !important;
    border: 1px solid var(--tc-cta) !important;
    border-radius: 4px;
    color: #fff !important;
    font-size: 19px;
    font-weight: 700;
    line-height: 48px;
    text-transform: none;
    transition: background-color .15s, border-color .15s;
}

/* Thames navy. White text on Thames orange (#FF9C14) is too low-contrast for the main button. */
.tc-checkout #payment #place_order:hover,
.tc-checkout #place_order:hover {
    background: var(--tc-cta-hover) !important;
    border-color: var(--tc-cta-hover) !important;
}

/* Place Order: button state + full-screen processing overlay (checkout.js) */
.tc-checkout form.checkout.processing #place_order {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.tc-checkout form.checkout.processing #place_order::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tc-spin .8s linear infinite;
}

/* Our overlay replaces WooCommerce's grey block on the form while submitting */
.tc-is-processing form.checkout .blockOverlay {
    opacity: 0 !important;
}

.tc-is-processing,
.tc-is-processing body {
    overflow: hidden;
}

.tc-processing {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 27, 51, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: tc-fade .2s ease-out;
}

.tc-processing[hidden] {
    display: none;
}

.tc-processing__box {
    width: 100%;
    max-width: 400px;
    padding: 36px 28px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
    text-align: center;
    font-family: "Rubik", sans-serif;
    animation: tc-pop .25s ease-out;
}

.tc-processing__spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    border: 4px solid #E3E8F2;
    border-top-color: #273C66;
    border-radius: 50%;
    animation: tc-spin .9s linear infinite;
}

/* Lock in the middle (counter-rotated so it stays upright) */
.tc-processing__spinner span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 14px;
    margin: -4px 0 0 -9px;
    background: #273C66;
    border-radius: 3px;
    animation: tc-spin .9s linear infinite reverse;
}

.tc-processing__spinner span::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -9px;
    width: 12px;
    height: 12px;
    border: 3px solid #273C66;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    box-sizing: border-box;
}

.tc-processing__box h3 {
    margin: 0 0 8px;
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    color: #2B354E;
}

.tc-processing__step {
    min-height: 22px;
    margin: 0 0 18px;
    font-size: 15px;
    color: #273C66;
    font-weight: 600;
}

.tc-processing__note {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid #EDF0F5;
    font-size: 13px;
    color: #64748B;
}

@keyframes tc-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tc-fade {
    from {
        opacity: 0;
    }
}

@keyframes tc-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-processing,
    .tc-processing__box,
    .tc-processing__spinner,
    .tc-processing__spinner span,
    .tc-checkout form.checkout.processing #place_order::after {
        animation-duration: 2.4s;
    }

    .tc-processing,
    .tc-processing__box {
        animation: none;
    }
}

/* Trust badges */
.tc-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 28px;
    margin: 12px 0 6px;
    font-size: 13px;
    color: var(--tc-muted);
}

.tc-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Help */
.tc-help {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: var(--tc-text);
}

.tc-help a {
    margin-left: 4px;
    text-decoration: underline;
}

/* Checkout error notices (prepended to the form by WooCommerce) */
.tc-checkout .woocommerce-NoticeGroup-checkout {
    margin-bottom: 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
    .tc-checkout__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
}

@media (max-width: 575px) {
    .tc-checkout {
        padding: 16px 16px 40px;
    }

    .tc-checkout .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .tc-card {
        padding: 16px;
    }

    .tc-checkout .tc-card__title,
    .tc-checkout .tc-section-title {
        font-size: 18px;
    }

    .tc-item {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .tc-item__thumb img {
        width: 52px !important;
        height: 52px !important;
    }

    .tc-item__price,
    .tc-item__price .amount {
        font-size: 16px;
    }

    .tc-offer {
        display: none;
        padding: 14px;
    }

    .tc-checkout .tc-offer__add {
        width: 100%;
    }

    .tc-coupon__row {
        gap: 12px;
    }

    .tc-checkout .tc-coupon__apply {
        width: 100px;
    }

    .tc-row.order-total {
        font-size: 17px;
    }

    .tc-checkout #place_order {
        font-size: 17px;
    }

    .tc-pm-tabs {
        gap: 12px;
    }

    .tc-checkout .tc-pm-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 12px;
        font-size: 15px;
    }
}

/* ---------- Terms & Conditions modal (checkout-terms-modal.php) ---------- */
.tc-terms-is-open,
.tc-terms-is-open body {
    overflow: hidden;
}

.tc-terms-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(15, 27, 51, .5);
    animation: tc-fade .2s ease-out;
}

.tc-terms-modal[hidden] {
    display: none;
}

.tc-terms-modal__dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    max-height: min(850px, calc(100vh - 48px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    font-family: "Rubik", sans-serif;
    color: #2B354E;
    outline: none;
    animation: tc-pop .25s ease-out;
}

.tc-terms-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 12px;
}

.tc-terms-modal__head h2 {
    margin: 0;
    font-family: inherit;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    color: #2B354E;
}

.tc-terms-modal .tc-terms-modal__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 6px rgba(16, 24, 40, .18);
    color: #2B354E;
    font-size: 24px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

.tc-terms-modal .tc-terms-modal__close:hover {
    background: #F3F5FA;
}

.tc-terms-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 8px;
    font-size: 15px;
    line-height: 1.75;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #273C66 #F1F3F7;
}

.tc-terms-modal__body::-webkit-scrollbar {
    width: 10px;
}

.tc-terms-modal__body::-webkit-scrollbar-track {
    background: #F1F3F7;
    border-radius: 10px;
}

.tc-terms-modal__body::-webkit-scrollbar-thumb {
    background: #273C66;
    border-radius: 10px;
}

.tc-terms-modal__body h3 {
    margin: 22px 0 10px;
    font-family: inherit;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
    color: #2B354E;
}

.tc-terms-modal__body h3:first-child {
    margin-top: 8px;
}

.tc-terms-modal__body h4 {
    margin: 16px 0 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #2B354E;
}

.tc-terms-modal__body p {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.75;
    color: #2B354E;
}

.tc-terms-modal__body ul {
    margin: -6px 0 14px;
    padding: 0 0 0 20px;
}

.tc-terms-modal__body ul.tc-terms-modal__sub {
    list-style: none;
}

.tc-terms-modal__body ul.tc-terms-modal__list {
    list-style: disc;
    padding-left: 22px;
}

.tc-terms-modal__body li {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.7;
}

.tc-terms-modal__body a {
    color: #273C66;
    text-decoration: underline;
}

.tc-terms-modal__foot {
    padding: 16px 24px 24px;
}

.tc-terms-modal .tc-terms-modal__back {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 4px;
    background: #273C66;
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 48px;
    text-transform: none;
    cursor: pointer;
    transition: filter .15s;
}

.tc-terms-modal .tc-terms-modal__back:hover {
    filter: brightness(1.15);
}

@media (max-width: 575px) {
    .tc-coupon{
        border-top: none;
    }
    .tc-terms-modal {
        padding: 12px;
    }

    .tc-terms-modal__dialog {
        max-height: calc(100vh - 24px);
        border-radius: 12px;
    }

    .tc-terms-modal__head {
        padding: 18px 16px 10px;
    }

    .tc-terms-modal__head h2 {
        font-size: 20px;
    }

    .tc-terms-modal__body {
        padding: 0 16px 8px;
        font-size: 14px;
    }

    .tc-terms-modal__body h3 {
        font-size: 17px;
    }

    .tc-terms-modal__body p,
    .tc-terms-modal__body li {
        font-size: 14px;
    }

    .tc-terms-modal__foot {
        padding: 12px 16px 16px;
    }
}

/* Phones: 16px text stops iOS Safari zooming into fields; 44px tap targets. */
@media (max-width: 767px) {
    .tc-checkout form.checkout .form-row input.input-text,
    .tc-checkout form.checkout .form-row select,
    .tc-checkout form.checkout .form-row textarea,
    .tc-checkout #tc_coupon_code,
    .tc-checkout .tc-qty__val,
    .select2-search__field {
        font-size: 16px;
    }

    .tc-qty {
        height: auto;
    }

    .tc-checkout .tc-qty__btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
        touch-action: manipulation;
    }

    .tc-checkout .tc-qty__val {
        height: 44px;
        line-height: 44px;
    }

    .tc-checkout .tc-item__remove,
    .tc-checkout .tc-terms-open,
    .tc-checkout .tc-login-open,
    .tc-checkout .tc-coupon__toggle {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 8px;
    }
}

/* Spinner in the quantity box while the new quantity is saved (checkout.js adds .is-updating). */
.tc-qty {
    position: relative;
}

.tc-checkout .tc-qty.is-updating .tc-qty__val {
    color: transparent;
}

.tc-qty.is-updating::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid var(--tc-border);
    border-top-color: var(--tc-text);
    border-radius: 50%;
    animation: tc-spin .8s linear infinite;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .tc-qty.is-updating::after {
        animation-duration: 2.4s;
    }
}

/* Spinner on the coupon Apply button while the code is checked (checkout.js adds .is-applying). */
.tc-checkout .tc-coupon__apply {
    position: relative;
}

.tc-checkout .tc-coupon__apply.is-applying {
    color: transparent !important;
    cursor: progress;
}

.tc-coupon__apply.is-applying::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--tc-border);
    border-top-color: var(--tc-text);
    border-radius: 50%;
    animation: tc-spin .8s linear infinite;
}

.tc-checkout #tc_coupon_code[readonly] {
    background: var(--tc-soft);
}

@media (prefers-reduced-motion: reduce) {
    .tc-coupon__apply.is-applying::after {
        animation-duration: 2.4s;
    }
}

/* "Your Details" toggle (logged in): a plain heading on desktop; the accordion is phone-only. */
.tc-checkout .tc-details-toggle {
    display: inline;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: none;
    cursor: default;
}

.tc-details-toggle__summary,
.tc-details-toggle .tc-chevron {
    display: none;
}

/* ==========================================================================
   Mobile checkout styling (design: "Thames College mobile checkout - final design").
   Styling only: every element, label and field stays as on desktop.
   ========================================================================== */

@media (max-width: 767px) {
    .tc-checkout {
        --tc-page: #F5F7FA;
        --tc-field: #C9D0DA;
        --tc-sep: #EEF0F3;
        --tc-muted: #64748B;

        /* Full-bleed: white sections edge to edge on a light grey page. */
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 0 0 24px;
        background: var(--tc-page);
    }

    /* No gap between the site header and the checkout (theme's .content has 30px padding). */
    .woocommerce-checkout section#content,
    .woocommerce-checkout #content .content {
        padding-top: 0;
        margin-top: 0;
    }

    .tc-checkout__notices {
        padding: 0 16px;
    }

    .tc-checkout__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .tc-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-color: #E6E9EE;
    }

    .tc-checkout .tc-card__title,
    .tc-checkout .tc-section-title {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: -.2px;
    }

    /* ---------- Order summary ---------- */

    .tc-summary {
        padding: 12px 16px;
        border-top: 0;
    }

    .tc-checkout .tc-summary > .tc-card__title {
        margin: 0 0 10px;
    }

    /* No course image on phones: name + actions on the left, price on the right. */
    .tc-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 0 0 12px;
        margin: 0 0 12px;
        border-bottom-color: var(--tc-sep);
    }

    .tc-item__thumb {
        display: none;
    }

    .tc-item__name {
        margin: 0 0 6px;
        font-size: 12px;
        line-height: 1.35;
    }

    .tc-item__name dl.variation {
        font-size: 11px;
    }

    .tc-item__actions {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .tc-item__price,
    .tc-item__price .amount {
        font-size: 13px;
        font-weight: 800;
        line-height: 18px;
    }

    .tc-qty {
        box-sizing: border-box;
        height: 44px;
        border-radius: 8px;
    }

    .tc-checkout .tc-qty__btn {
        width: 44px;
        min-width: 44px;
        height: 42px;
        min-height: 42px;
        font-size: 16px;
    }

    .tc-checkout .tc-qty__btn--minus {
        color: var(--tc-muted);
    }

    .tc-checkout .tc-qty__val {
        width: 32px;
        min-width: 32px;
        height: 42px;
        line-height: 42px;
        border: 0;
        font-weight: 700;
    }

    .tc-checkout .tc-item__remove {
        padding: 0 4px;
        font-size: 11px;
    }

    /* Exclusive Offer (shown 576-767px) */
    .tc-checkout .tc-offer h4 {
        font-size: 15px;
    }

    .tc-offer p,
    .tc-checkout .tc-offer__toggle {
        font-size: 12px;
    }

    .tc-checkout .tc-offer__courses li {
        font-size: 11px;
    }

    .tc-checkout .tc-offer__add {
        font-size: 13px;
    }

    /* Discount code */
    .tc-coupon {
        padding: 0;
        border-color: var(--tc-sep);
    }

    .tc-checkout .tc-coupon__toggle {
        color: var(--tc-primary);
        font-size: 12px;
        font-weight: 600;
        padding: 0;
    }

    .tc-checkout .tc-coupon__msg ul,
    .tc-checkout .tc-coupon__msg div {
        font-size: 12px;
    }

    .tc-coupon__body {
        padding: 4px 0 12px;
    }

    .tc-checkout .tc-coupon__row input {
        height: 48px;
        border-color: var(--tc-field);
        border-radius: 8px;
    }

    .tc-checkout .tc-coupon__apply {
        height: 48px;
        line-height: 46px;
        border-radius: 8px;
        font-size: 13px;
    }

    /* Totals */
    .tc-summary-totals {
        padding-top: 12px;
    }

    .tc-row {
        margin-bottom: 6px;
        font-size: 12px;
    }

    .tc-row .woocommerce-remove-coupon {
        font-size: 11px;
    }

    .tc-row.order-total {
        align-items: baseline;
        margin-top: 4px;
        padding-top: 10px;
        border-top-color: var(--tc-sep);
        font-size: 14px;
        font-weight: 800;
    }

    .tc-row.order-total > span:last-child,
    .tc-row.order-total > span:last-child .amount {
        font-size: 14px;
        font-weight: 800;
    }

    .tc-row.order-total small,
    .tc-row.order-total .off_textcart,
    .tc-row.order-total small .amount,
    .tc-row.order-total .off_textcart .amount {
        font-size: 11px;
    }

    /* ---------- Complete checkout ---------- */

    .tc-pay {
        padding: 14px 16px 32px;
    }

    .tc-checkout .tc-express .tc-card__title {
        margin: 0 0 12px;
    }

    .tc-checkout #wc-stripe-express-checkout-button-separator {
        margin: 12px 0 !important;
    }

    .tc-checkout #wc-stripe-express-checkout-button-separator::before {
        border-top-color: var(--tc-border);
    }

    .tc-checkout #wc-stripe-express-checkout-button-separator::after {
        padding: 0 12px;
        font-size: 11px;
        color: var(--tc-muted);
    }

    .tc-section-head {
        align-items: center;
        margin: 4px 0 10px;
    }

    .tc-section-head .tc-section-title {
        margin: 0;
    }

    .tc-login-link {
        font-size: 11px;
        color: var(--tc-muted);
    }

    /* "Your Details" accordion (logged-in learners; checkout.js adds the classes). */
    .tc-details-head.is-collapsible {
        margin: 4px 0 0;
    }

    .tc-details-head.is-collapsible.is-open {
        margin-bottom: 10px;
    }

    .tc-details-head.is-collapsible .tc-section-title {
        flex: 1;
    }

    .tc-checkout .tc-details-head.is-collapsible .tc-details-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 52px;
        margin: 0;
        padding: 8px 12px;
        background: #fff;
        border: 1px solid var(--tc-field);
        border-radius: 8px;
        box-shadow: none;
        color: var(--tc-text);
        font: inherit;
        text-align: left;
        text-transform: none;
        cursor: pointer;
    }

    .tc-details-head.is-collapsible .tc-details-toggle__text {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .tc-details-head.is-collapsible .tc-details-toggle__summary {
        display: block;
        overflow: hidden;
        margin-top: 2px;
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 0;
        color: var(--tc-muted);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tc-details-head.is-collapsible.is-open .tc-details-toggle__summary {
        display: none;
    }

    .tc-details-head.is-collapsible .tc-chevron {
        display: block;
        flex: none;
        width: 8px;
        height: 8px;
        margin: 0 4px 0 0;
        border-left: 1.5px solid currentColor;
        border-top: 1.5px solid currentColor;
        transform: rotate(225deg);
        transition: transform .2s;
    }

    .tc-details-head.is-collapsible.is-open .tc-chevron {
        transform: rotate(45deg);
    }

    .tc-checkout #customer_details.tc-details-collapsed {
        display: none;
    }

    .tc-checkout #customer_details.tc-details-collapsed + * {
        margin-top: 12px;
    }

    .tc-checkout .tc-login-link .tc-login-open {
        padding: 0 0 0 4px;
        font-weight: 700;
    }

    /* Billing fields */
    .tc-checkout .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .tc-checkout form.checkout .form-row {
        margin: 0 0 12px;
    }

    .tc-checkout form.checkout .form-row label,
    .tc-checkout form.checkout .form-row label.checkbox,
    .tc-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox {
        margin: 0 0 6px;
        font-size: 12px;
        font-weight: 600;
    }

    .tc-checkout form.checkout .form-row .description {
        font-size: 11px;
    }

    .tc-checkout form.checkout .form-row input.input-text,
    .tc-checkout form.checkout .form-row select,
    .tc-checkout form.checkout .select2-container .select2-selection--sitce {
        height: 48px;
        padding: 0 12px;
        border-color: var(--tc-field);
        border-radius: 8px;
        font-size: 16px;
    }

    .tc-checkout form.checkout .form-row input.input-text:focus {
        border-color: var(--tc-primary);
    }

    .tc-checkout .select2-container .select2-selection--sitce .select2-selection__rendered {
        line-height: 46px;
    }

    .tc-checkout .select2-container--default .select2-selection--sitce .select2-selection__arrow {
        top: 11px;
    }

    /* "Payment Method" heading */
    .tc-checkout form.checkout > .tc-section-title {
        margin: 4px 0 10px;
    }

    /* Payment method tabs: two equal radio cards. */
    .tc-pm-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 12px;
    }

    .tc-checkout .tc-pm-tab {
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
        height: 52px;
        padding: 0 11px;
        background: #fff;
        border: 1px solid var(--tc-field);
        border-radius: 10px;
        color: var(--tc-text);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
        text-align: left;
        white-space: normal;
    }

    .tc-pm-tab__paypal {
        font-size: 14px;
    }

    .tc-checkout #payment div.payment_box,
    .tc-checkout #payment ul.payment_methods:not(.tc-pm-tabbed) > li > label {
        font-size: 12px;
    }

    .tc-checkout #payment .payment_box .testmode-info {
        font-size: 11px;
    }

    .tc-checkout .tc-pm-tab:hover {
        background: #fff;
    }

    /* Radio indicator */
    .tc-checkout .tc-pm-tab::before {
        content: "";
        flex: none;
        box-sizing: border-box;
        width: 18px;
        height: 18px;
        border: 2px solid #8A94A3;
        border-radius: 50%;
    }

    .tc-checkout .tc-pm-tab.is-active {
        padding: 0 10px;
        background: #F5F7FB;
        border: 2px solid var(--tc-primary);
    }

    .tc-checkout .tc-pm-tab.is-active::before {
        border-color: var(--tc-primary);
        background: radial-gradient(circle, var(--tc-primary) 0 4px, transparent 4.5px);
    }

    /* Terms, Place Order, trust badges */
    .tc-checkout .tc-terms {
        margin: 0 0 16px;
        font-size: 10px;
        text-align: center;
        color: var(--tc-muted);
    }

    .tc-checkout #payment #place_order,
    .tc-checkout #place_order {
        height: 52px;
        border-radius: 10px;
        font-size: 15px;
        line-height: 50px;
    }

    .tc-trust {
        gap: 6px 16px;
        margin: 12px 0 0;
        font-size: 10px;
        font-weight: 600;
        color: var(--tc-text);
    }

    .tc-trust span {
        gap: 6px;
    }

    #wc-stripe-express-checkout-element>div {
    flex: 1;
    min-width: 100px !important;
    }
}

/* WooCommerce's inline terms box stays as WooCommerce shows it until Thames has a terms modal
   (includes/checkout-terms-modal.php); with the modal, checkout.js opens it instead. */

/* No "Save payment information to my account" checkbox (see wc_stripe_upe_params in includes/checkout-redesign.php).
   Hiding it does not change its value, so subscriptions still save the card where Stripe forces it. */
.tc-checkout #payment .woocommerce-SavedPaymentMethods-saveNew {
    display: none !important;
}

/* Checkboxes on the checkout form ("I have read and agree to the website terms and conditions", etc.).
   The parent theme (wplms style.css, Bootstrap) sets .checkbox input[type=checkbox] to position:absolute with a
   negative margin, which put the box on top of the first letter in our flex label. Keep it in the flow instead. */
.tc-checkout form.checkout .form-row label.checkbox,
.tc-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--tc-text);
    cursor: pointer;
}

.tc-checkout form.checkout .form-row label.checkbox input[type="checkbox"],
.tc-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox input[type="checkbox"] {
    position: static !important;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0 !important;
    padding: 0;
    accent-color: var(--tc-primary);
    cursor: pointer;
}

.tc-checkout .woocommerce-terms-and-conditions-wrapper .form-row.validate-required {
    margin: 0 0 12px;
}

.tc-checkout .woocommerce-terms-and-conditions-checkbox-text {
    margin: 0;
}

.tc-checkout .woocommerce-terms-and-conditions-wrapper a.woocommerce-terms-and-conditions-link {
    font-weight: 600;
    text-decoration: underline;
}

.tc-checkout .woocommerce-terms-and-conditions-wrapper .required {
    margin-left: 2px;
    color: #D63638 !important;
}

@media (max-width: 767px) {
    .tc-checkout form.checkout .form-row label.checkbox,
    .tc-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox {
        font-size: 13px;
        font-weight: 400;
        line-height: 19px;
    }
}

/* Thames orange on the trust badge icons. */
.tc-trust svg {
    color: var(--tc-accent);
}

/* wplms-gift-course box: hidden on checkout, as the previous Thames checkout did. */
.woocommerce-checkout .checkout-gift-container {
    display: none !important;
}
