/* ==========================================================================
   Cart page — threadandfilm theme (0.13.0, site redesign Phase 4a)
   ==========================================================================
   Loaded on the cart only (inc/assets.php), right after woocommerce.css and before
   responsive.css, as product.css is on product pages. Design of record:
   design/Cart.dc.html from 769px, design/Mobile.dc.html M4 on the mobile twin, and
   design/README.md's ShipCore debug panel (which TAF ShipCore styles itself). Spec:
   2026-10-13-cart-and-checkout-design.md in the site-redesign folder under .plans/.

   The markup is the theme's: woocommerce/cart/*.php, template-parts/cart/*.php, every
   value from inc/cart-data.php. Every selector starts with .woocommerce-cart, the body
   class of the cart page (with or without items), so nothing here reaches checkout. The
   rate cards, which checkout shows too, are in woocommerce.css §9 (theme 0.16.0).

   Widths come from the theme's shell (.taf-main .taf-container caps at --content-max
   with --shell-gutter), not the mock's 1440px frame and 56px padding. Weights 800 are set
   at 700, the heaviest self-hosted Inter face. Buttons sit on the 36/44/52 scale; every
   control's hit area is at least 44 x 44px, from its own size or a transparent ::after.

   Sections:
   1. Page and head
   2. The grid
   3. Lines
   4. Files table
   5. Quantity and remove
   6. Notices, the line's pill and toasts
   7. Below the lines: continue, coupon, update
   8. The summary
   9. Shipping: head and calculator (the rate cards: woocommerce.css §9)
   10. Proceed, and the phone's checkout bar
   11. Empty cart
   12. Plugins' markup on the cart (Gang Sheet Maker, WooCommerce's item data)
   13. Focus and motion
   14. Phones (the mobile twin)
   ========================================================================== */


/* ── 1. Page and head ── */

.woocommerce-cart .taf-main {
    padding-top: 40px;
    padding-bottom: 96px;
}

.woocommerce-cart .taf-cart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border-light);
}

.woocommerce-cart .taf-cart-head-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* WooCommerce's breadcrumb: "Home / Cart". The current crumb is a text node, so the nav
   takes the ink and the links the muted colour. */
.woocommerce-cart .taf-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--color-text);
}

.woocommerce-cart .taf-crumbs a {
    color: var(--color-text-light);
    text-decoration: none;
}

.woocommerce-cart .taf-crumbs a:hover {
    color: var(--color-text);
}

.woocommerce-cart .taf-crumb-sep {
    color: var(--color-text-light);
}

.woocommerce-cart .taf-cart-title {
    margin: 0;
    font-size: clamp(2.25rem, 1.5rem + 2vw, 3.25rem);   /* 36px on small tablets to the mock's 52px */
    font-weight: var(--font-weight-bold);
    line-height: 1;
    letter-spacing: -0.04em;
}

.woocommerce-cart .taf-cart-head-count {
    font-size: 0.54em;                                    /* 28px beside 52px */
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    color: var(--color-text-light);
}

/* The steps: Cart, Checkout, Done. The connecting line is each later step's ::before. */
.woocommerce-cart .taf-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
}

.woocommerce-cart .taf-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-step + .taf-step::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--color-border-mid);
}

.woocommerce-cart .taf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border-mid);
    border-radius: 50%;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.woocommerce-cart .taf-step.is-current {
    color: var(--color-text);
}

.woocommerce-cart .taf-step.is-current .taf-step-num {
    background: var(--color-text);
    border-color: var(--color-text);
    color: var(--color-bg);
}


/* ── 2. The grid ── */

/* The lines column (.taf-cart-main: the notices, then the form) and the summary. One
   column below 1024px, the summary after the lines; two from 1024px, the mock's 3 : 2
   split with the summary at least 340px. */
.woocommerce-cart .taf-cart-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

@media (min-width: 1024px) {
    .woocommerce-cart .taf-cart-page {
        grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr);
    }

    /* Pinned only while it fits below the header (cart.js sets .is-fit), so its button is
       never out of reach. */
    .woocommerce-cart .taf-cart-aside.is-fit {
        position: sticky;
        top: calc(var(--header-h) + 16px);
    }
}


/* ── 3. Lines ── */

.woocommerce-cart .taf-lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-cart .taf-line {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 16px 20px;
    align-items: start;
    padding: 22px 0;
    border-bottom: 1px solid var(--color-border-light);
}

/* The picture: the product image, with two cards behind it when the line has more than
   one file, and a count badge. */
.woocommerce-cart .taf-line-media {
    position: relative;
    width: 96px;
    height: 96px;
}

.woocommerce-cart .taf-line-media.is-stack::before,
.woocommerce-cart .taf-line-media.is-stack::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.woocommerce-cart .taf-line-media.is-stack::before {
    z-index: 0;
    background: var(--color-border-light);
    transform: translate(8px, -6px) rotate(6deg);
}

.woocommerce-cart .taf-line-media.is-stack::after {
    z-index: 1;
    background: var(--color-bg-muted);
    transform: translate(4px, -3px) rotate(3deg);
}

.woocommerce-cart .taf-line-thumb {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
}

.woocommerce-cart .taf-line-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.woocommerce-cart .taf-line-badge {
    position: absolute;
    z-index: 3;
    right: -8px;
    bottom: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: var(--radius-full);
    background: var(--color-text);
    color: var(--color-bg);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 3px var(--color-bg);
}

.woocommerce-cart .taf-line-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.woocommerce-cart .taf-line-name {
    margin: 0;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.woocommerce-cart .taf-line-name a {
    color: var(--color-text);
    text-decoration: none;
}

.woocommerce-cart .taf-line-name a:hover {
    color: var(--color-link);
}

.woocommerce-cart .taf-line-summary {
    margin: 0;
    font-size: 13.5px;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

.woocommerce-cart .taf-line-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.woocommerce-cart .taf-line-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.woocommerce-cart .taf-line-total {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
}

.woocommerce-cart .taf-line-rate {
    font-size: 12.5px;
    color: var(--color-text-light);
}


/* ── 4. Files table ── */

.woocommerce-cart .taf-files {
    margin-top: 4px;
}

/* The toggle: a 36px pill; its hit area is 44px tall (::after). */
.woocommerce-cart .taf-files-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    font-size: 12.5px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    list-style: none;
    transition: border-color var(--ease-out-fast);
}

.woocommerce-cart .taf-files-toggle::-webkit-details-marker {
    display: none;
}

.woocommerce-cart .taf-files-toggle::after {
    content: "";
    position: absolute;
    inset: -5px 0;   /* 4px past the 1px border: an absolute box is measured from the padding box */
}

.woocommerce-cart .taf-files-toggle:hover {
    border-color: var(--color-text);
}

.woocommerce-cart .taf-files-toggle .taf-icon {
    transition: transform var(--ease-out-fast);
}

.woocommerce-cart .taf-files[open] .taf-files-toggle .taf-icon {
    transform: rotate(180deg);
}

/* "Hide 3 files" while open, "Show 3 files" while closed. */
.woocommerce-cart .taf-files-show,
.woocommerce-cart .taf-files:not([open]) .taf-files-hide {
    display: none;
}

.woocommerce-cart .taf-files:not([open]) .taf-files-show {
    display: inline;
}

.woocommerce-cart .taf-files-table {
    width: 100%;
    margin-top: 10px;
    border: 1px solid var(--color-border-light);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-tile);
    overflow: hidden;
    table-layout: fixed;
    font-size: 14px;
}

.woocommerce-cart .taf-files-table th,
.woocommerce-cart .taf-files-table td {
    padding: 12px 16px;
    border: 0;
    border-top: 1px solid var(--color-border-light);
    background: none;
    text-align: left;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.woocommerce-cart .taf-files-table thead th {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 0;
    background: var(--color-bg-muted);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-files-table thead th:nth-child(2) {
    width: 90px;
}

.woocommerce-cart .taf-files-table thead th:nth-child(3) {
    width: 64px;
    text-align: right;
}

.woocommerce-cart .taf-files-table .taf-file-qty {
    text-align: right;
}

.woocommerce-cart .taf-file-name {
    font-weight: var(--font-weight-semibold);
}

.woocommerce-cart .taf-file-name span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── 5. Quantity and remove ── */

/* A gang sheet's quantity: − input + in a 46px pill, so each part is a 44px target. The buttons show only while
   JavaScript runs (cart.js steps them); without it the input is a plain number box and
   "Update cart" shows below the lines. */
.woocommerce-cart .taf-qty {
    display: inline-flex;
    align-items: center;
    height: 46px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-full);
    background: var(--color-bg);
}

.woocommerce-cart .taf-qty .quantity {
    margin: 0;
}

.woocommerce-cart .taf-qty input.qty {
    width: 48px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    -moz-appearance: textfield;
    appearance: textfield;
}

.woocommerce-cart .taf-qty input.qty::-webkit-inner-spin-button,
.woocommerce-cart .taf-qty input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woocommerce-cart .taf-qty-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ease-out-fast);
}

.taf-js .woocommerce-cart .taf-qty-btn {
    display: inline-flex;
}

/* cart.js never ran (cart/cart.php sets .taf-cart-off at the window's load): − and +
   would do nothing, so the quantity is the plain number box again. */
.taf-cart-off .woocommerce-cart .taf-qty-btn {
    display: none;
}

.woocommerce-cart .taf-qty-btn:hover:not(:disabled) {
    background: var(--color-bg-muted);
}

.woocommerce-cart .taf-qty-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* A sold-individually line's quantity (TAF FileDrop's locked "1" and its hidden
   cart[key][qty] field): printed, so the field still posts, but never shown. */
.woocommerce-cart .taf-qty-locked {
    display: none;
}

/* Remove: a 36px square; 44px hit area. */
.woocommerce-cart .taf-line-remove {
    margin-top: 8px;
}

.woocommerce-cart .taf-line-remove a.remove {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--ease-out-fast), border-color var(--ease-out-fast), color var(--ease-out-fast);
}

.woocommerce-cart .taf-line-remove a.remove::after {
    content: "";
    position: absolute;
    inset: -5px;   /* 4px past the 1px border: an absolute box is measured from the padding box */
}

.woocommerce-cart .taf-line-remove a.remove:hover {
    background: var(--state-error-bg);
    border-color: var(--state-error-text);
    color: var(--state-error-text);
}


/* ── 6. Notices, the line's pill and toasts ── */

/* Every notice on the cart takes woocommerce.css §16's construction; this section only
   places them and styles what the cart adds. WooCommerce's notices print at the top of the
   lines column (.taf-cart-main), before the form; §16 spaces them. TAF FileDrop styles the
   rows of its expired-uploads notice itself (taffd-checkout.css), the same on checkout. */

/* The notes: the minimum-charge notes under the lines and the two shipping warnings in the
   summary (§9 spaces those). They are warning notices with the theme's own taf-cart-note
   class, never a WooCommerce notice class: WooCommerce's cart.js collects every
   .woocommerce-info in a refreshed page and prints it again in the notices wrapper, which
   would double them. */
.woocommerce-cart .taf-cart-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.woocommerce-cart .taf-cart-note {
    margin: 0;
}

/* "Edit address", the outline pill under a shipping warning. cart.js opens the calculator
   from it, so it shows only while JavaScript runs and cart.js has started (.taf-cart-off
   says it has not); without JavaScript the calculator's fields already show. */
.woocommerce-cart .taf-edit-address {
    display: none;
    margin-top: 12px;
}

.taf-js .woocommerce-cart .taf-edit-address {
    display: inline-flex;
}

.taf-cart-off .woocommerce-cart .taf-edit-address {
    display: none;
}

/* "Re-upload needed" on each line holding an expired file (template-parts/cart/line.php),
   under its summary: the error tint and ink, with a 6px magenta square. */
.woocommerce-cart .taf-line-pill {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    height: 26px;
    margin-top: 4px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    background: var(--state-error-bg);
    color: var(--state-error-text);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

.woocommerce-cart .taf-line-pill::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    background: var(--state-error-mark);
}

/* Toasts (cart.js): a success after an in-page action (a quantity, a removal with Undo, a
   coupon, new shipping costs) shows here for 5 seconds instead of in the notices wrapper.
   The stack is fixed at the bottom centre, newest last, at most three; on phones it sits
   above the checkout bar (§14). The region itself never takes a click. */
.woocommerce-cart .taf-toasts {
    position: fixed;
    z-index: 950;              /* over the checkout bar (900), under the header shell (1000) */
    left: 0;
    right: 0;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.woocommerce-cart .taf-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100% - 32px);
    padding: 12px 12px 12px 18px;
    border-radius: var(--radius-tile);
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    font-size: 14.5px;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    pointer-events: auto;
    animation: taf-toast-in 0.2s ease-out;
}

/* The success square. */
.woocommerce-cart .taf-toast::before {
    content: "";
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--state-success-mark);
}

.woocommerce-cart .taf-toast-text {
    min-width: 0;
    padding-right: 6px;
}

/* Undo: WooCommerce's own restore link (a.restore-item, which its cart.js runs over AJAX),
   drawn as a white 36px pill; 44px hit area. */
.woocommerce-cart .taf-toast-undo {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.woocommerce-cart .taf-toast-undo::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
}

.woocommerce-cart .taf-toast-undo:hover {
    background: var(--color-primary);
    color: var(--color-text);
}

/* The ring on the dark box: the inverse of the site ring (base.css); this outweighs §13's. */
.woocommerce-cart .taf-toasts .taf-toast-undo:focus-visible {
    outline: 2px solid var(--focus-ring-inverse);
    outline-offset: 2px;
}

/* A slide only, no fade: the toast is readable from its first frame. */
@keyframes taf-toast-in {
    from {
        transform: translateY(12px);
    }
}


/* ── 7. Below the lines: continue, coupon, update ── */

.woocommerce-cart .taf-cart-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 22px;
}

.woocommerce-cart .taf-continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-link);
    text-decoration: none;
}

.woocommerce-cart .taf-continue:hover {
    color: var(--color-accent-text);
}

.woocommerce-cart .taf-coupon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.woocommerce-cart .taf-coupon input#coupon_code {
    width: 200px;
    max-width: 100%;
    height: 44px;
    padding: 0 18px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    box-sizing: border-box;
}

.woocommerce-cart .taf-coupon input#coupon_code:focus {
    border-color: var(--color-text);
}

/* Apply, and the no-JavaScript "Update cart": outline pills. */
.woocommerce-cart .taf-coupon button[name="apply_coupon"],
.woocommerce-cart .taf-update-cart {
    height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--color-text);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--ease-out-fast), color var(--ease-out-fast);
}

.woocommerce-cart .taf-coupon button[name="apply_coupon"]:hover,
.woocommerce-cart .taf-update-cart:hover:not(:disabled) {
    background: var(--color-text);
    color: var(--color-bg);
}

.woocommerce-cart .taf-update-cart:disabled {
    opacity: 0.45;
    cursor: default;
}

/* While cart.js runs, a quantity change updates the cart by itself (it clicks this
   button), so the button is not shown; if cart.js never ran (.taf-cart-off), it is. */
.taf-js .woocommerce-cart .taf-update-cart {
    display: none;
}

.taf-cart-off .woocommerce-cart .taf-update-cart {
    display: inline-block;
}

/* WooCommerce's own coupon error, printed under the field by its cart.js. */
.woocommerce-cart .taf-coupon .coupon-error-notice {
    flex-basis: 100%;
    margin: 2px 0 0;
    font-size: 13.5px;
    color: var(--state-error-text);
}


/* ── 8. The summary ── */

.woocommerce-cart .taf-summary {
    position: relative;
    padding: 28px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* The brand bar along the top. */
.woocommerce-cart .taf-summary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-magenta), var(--color-yellow));
}

.woocommerce-cart .taf-summary-title {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}

.woocommerce-cart .taf-summary-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    font-size: 14.5px;
}

.woocommerce-cart .taf-summary-table th,
.woocommerce-cart .taf-summary-table td {
    display: table-cell;          /* ShipCore's fallback sets .cart_totals .shipping td to block */
    padding: 7px 0;
    border: 0;
    background: none;
    vertical-align: top;
    text-transform: none;
    letter-spacing: 0;
}

.woocommerce-cart .taf-summary-table th {
    padding-right: 12px;
    text-align: left;
    font-weight: var(--font-weight-normal);
    color: var(--color-text-light);
}

.woocommerce-cart .taf-summary-table td {
    text-align: right;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.woocommerce-cart .taf-sum-estimated {
    font-size: 12px;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-summary-table tr.order-total th,
.woocommerce-cart .taf-summary-table tr.order-total td {
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.woocommerce-cart .taf-summary-table .woocommerce-remove-coupon {
    margin-left: 6px;
    font-size: 13px;
    font-weight: var(--font-weight-normal);
    color: var(--color-link);
}


/* ── 9. Shipping: head and calculator ── */

.woocommerce-cart .taf-summary-table tr.taf-ship td {
    padding: 12px 0 10px;
    text-align: left;
    font-weight: var(--font-weight-normal);
}

.woocommerce-cart .taf-ship-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.woocommerce-cart .taf-ship-title {
    margin: 0;
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* "Change address": a 36px pill; 44px hit area. Shown only while JavaScript runs, as
   only WooCommerce's cart.js opens the calculator; without it the fields always show. */
.woocommerce-cart .taf-pill {
    position: relative;
    display: none;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: border-color var(--ease-out-fast);
}

.taf-js .woocommerce-cart .taf-pill {
    display: inline-flex;
}

.woocommerce-cart .taf-pill::after {
    content: "";
    position: absolute;
    inset: -5px 0;   /* 4px past the 1px border: an absolute box is measured from the padding box */
}

.woocommerce-cart .taf-pill:hover {
    border-color: var(--color-text);
}

.woocommerce-cart .taf-ship-dest {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-ship-dest strong {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.woocommerce-cart .taf-ship-prompt {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: var(--color-text);
}

.woocommerce-cart .taf-ship .taf-cart-note {
    margin-top: 12px;
}

/* The calculator. Closed (an address is known), WooCommerce's cart.js hides it on load
   and slides it open from the pill; cart.css hides it too while JavaScript runs, so a
   refreshed summary starts closed. Open (no address yet) it is .is-open and always shows.
   Its children are spaced with margins: jQuery shows it as display: block. */
.taf-js .woocommerce-cart .shipping-calculator-form {
    display: none;
}

.woocommerce-cart .taf-calc {
    margin-top: 12px;
}

.woocommerce-cart .taf-calc-fields {
    max-width: none;              /* ShipCore's fallback caps .shipping-calculator-form at 300px */
    padding: 16px;
    border-radius: var(--radius-tile);
    background: var(--color-bg-muted);
}

.woocommerce-cart .taf-calc-fields > * + * {
    margin-top: 12px;
}

.woocommerce-cart .taf-calc-row {
    margin: 0;
    padding: 0;
}

.woocommerce-cart .taf-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: 10px;
}

.woocommerce-cart .taf-calc label,
.woocommerce-cart .taf-calc-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.woocommerce-cart .taf-calc-static {
    display: block;
    font-size: 15px;
}

.woocommerce-cart .taf-calc input.input-text,
.woocommerce-cart .taf-calc select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    box-sizing: border-box;
}

.woocommerce-cart .taf-calc input.input-text:focus,
.woocommerce-cart .taf-calc select:focus {
    border-color: var(--color-text);
}

/* The state dropdown after WooCommerce turns it into a selectWoo box. */
.woocommerce-cart .taf-calc .select2-container {
    width: 100% !important;   /* selectWoo writes an inline width on the container */
}

/* `form` in each selector: woocommerce.css's `.woocommerce form .form-row .select2-container
   .select2-selection` (checkout's fields) carries one more element, and its 0.7rem padding pushed the
   state's name to the bottom of the box. */
.woocommerce-cart form.taf-calc .select2-container .select2-selection--single {
    height: 44px;
    padding: 0;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.woocommerce-cart form.taf-calc .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0 36px 0 12px;
    line-height: 42px;
    font-size: 15px;
    color: var(--color-text);
}

.woocommerce-cart form.taf-calc .select2-container .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 6px;
    height: 42px;
}

.woocommerce-cart form.taf-calc .select2-container--open .select2-selection--single,
.woocommerce-cart form.taf-calc .select2-container--focus .select2-selection--single {
    border-color: var(--color-text);
}

/* The open list. selectWoo appends it to <body>, outside the form, so it is scoped by the
   cart page's body class; the cart has no other selectWoo box. */
.woocommerce-cart .select2-dropdown {
    min-width: 220px;   /* selectWoo sizes it to the state box, ~120px in the three-across row */
    overflow: hidden;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.woocommerce-cart .select2-container--open .select2-dropdown--below {
    margin-top: 4px;
}

.woocommerce-cart .select2-container--open .select2-dropdown--above {
    margin-top: -4px;
}

.woocommerce-cart .select2-search--dropdown {
    padding: 8px;
}

.woocommerce-cart .select2-search--dropdown .select2-search__field {
    height: 44px;
    padding: 0 10px;
    border: 1px solid var(--color-border-mid);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    box-sizing: border-box;
}

.woocommerce-cart .select2-search--dropdown .select2-search__field:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.woocommerce-cart .select2-results__option {
    padding: 10px 12px;
    font-size: 15px;
    color: var(--color-text);
    white-space: nowrap;
}

/* selectWoo moves keyboard focus onto each option: the site's ring, inside the list's edge. */
.woocommerce-cart .select2-results__option:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.woocommerce-cart .select2-container--default .select2-results__option[aria-selected="true"],
.woocommerce-cart .select2-container--default .select2-results__option[data-selected="true"] {
    background: transparent;
    font-weight: var(--font-weight-semibold);
}

.woocommerce-cart .select2-container--default .select2-results__option--highlighted[aria-selected],
.woocommerce-cart .select2-container--default .select2-results__option--highlighted[data-selected] {
    background: var(--color-bg-muted);
    color: var(--color-text);
}

.woocommerce-cart .taf-calc-actions {
    margin: 0;
}

.woocommerce-cart .taf-calc-submit {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--color-text);
    color: var(--color-bg);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--ease-out-fast), color var(--ease-out-fast);
}

.woocommerce-cart .taf-calc-submit:hover {
    background: var(--color-primary);
    color: var(--color-text);
}

/* The rate cards are shared with checkout: woocommerce.css §9 (theme 0.16.0). */


/* ── 10. Proceed, and the phone's checkout bar ── */

.woocommerce-cart .wc-proceed-to-checkout {
    margin-top: 18px;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-text);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-decoration: none;
    box-sizing: border-box;
    transition: background var(--ease-out-fast), color var(--ease-out-fast);
}

/* The arrow, drawn: "→" is not among the self-hosted Inter characters. */
.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* The phone's sticky bar (§14) is a second link to checkout, printed inside the totals so
   its amount refreshes with them. Hidden from 769px. */
.woocommerce-cart .taf-checkout-bar {
    display: none;
}


/* ── 11. Empty cart ── */

.woocommerce-cart .taf-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 48px 0 72px;
    text-align: center;
}

.woocommerce-cart .taf-cart-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-muted);
    color: var(--color-text);
}

.woocommerce-cart .taf-cart-empty-title {
    margin: 0;
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.woocommerce-cart .taf-cart-empty-sub {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-cart-empty .return-to-shop {
    margin: 0;
}

.woocommerce-cart .taf-cart-empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 26px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-text);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    text-decoration: none;
    transition: background var(--ease-out-fast), color var(--ease-out-fast);
}

.woocommerce-cart .taf-cart-empty-cta:hover {
    background: var(--color-text);
    color: var(--color-bg);
}


/* ── 12. Plugins' markup on the cart ── */

/* Gang Sheet Maker's Preview and Edit (its own markup and handlers, never edited from this
   repo). Its inline <style>, printed in the footer, sets a 3px-radius outline at .82em;
   these selectors outweigh it. 36px pills; 44px hit areas. */
.woocommerce-cart .taf-line .gsm-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.woocommerce-cart .taf-line .gsm-cart-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid var(--color-text);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: var(--font-weight-semibold);
    opacity: 1;
    cursor: pointer;
    transition: background var(--ease-out-fast), color var(--ease-out-fast);
}

.woocommerce-cart .taf-line .gsm-cart-action::after {
    content: "";
    position: absolute;
    inset: -5.5px 0;   /* 4px past the 1.5px border: an absolute box is measured from the padding box */
}

.woocommerce-cart .taf-line .gsm-cart-action:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

.woocommerce-cart .taf-line .gsm-cart-hint {
    font-size: 12.5px;
    color: var(--color-text-light);
    opacity: 1;
}

/* Gang Sheet Maker's preview modal: its dialog takes the redesign's radius and the brand
   bar; its behaviour (the scrim, the close button, Escape) is its own. */
.woocommerce-cart .gsm-cart-modal__dialog {
    padding: 28px 22px 18px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.woocommerce-cart .gsm-cart-modal__dialog::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-magenta), var(--color-yellow));
}

.woocommerce-cart .gsm-cart-modal__close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
    border-radius: 50%;
    background: var(--color-bg-muted);
    color: var(--color-text);
}

/* WooCommerce's item data under a line's name (another plugin's data; a variation's
   attributes when the line has no size summary). */
.woocommerce-cart .taf-line-info dl.variation {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 6px;
    margin: 0;
    font-size: 13px;
    color: var(--color-text-light);
}

.woocommerce-cart .taf-line-info dl.variation dt {
    font-weight: var(--font-weight-semibold);
}

.woocommerce-cart .taf-line-info dl.variation dd,
.woocommerce-cart .taf-line-info dl.variation dd p {
    margin: 0;
}


/* WooCommerce's cross-sells (its cart/cross-sells.php), printed under the cart since
   inc/woocommerce.php moves them out of the summary column. The cards are the listing
   pages' (woocommerce.css); this only spaces the strip and sets its heading. */
.woocommerce-cart .cross-sells {
    margin-top: 56px;
}

.woocommerce-cart .cross-sells > h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}


/* ── 13. Focus and motion ── */

/* The site ring (base.css explains the pair). The rate cards' ring is in woocommerce.css §9. */
.woocommerce-cart .taf-cart-page a:focus-visible,
.woocommerce-cart .taf-cart-page button:focus-visible,
.woocommerce-cart .taf-cart-page summary:focus-visible,
.woocommerce-cart .taf-cart-page input:focus-visible,
.woocommerce-cart .taf-cart-page select:focus-visible,
.woocommerce-cart .taf-cart-head a:focus-visible,
.woocommerce-cart .taf-cart-empty a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce-cart .taf-files-toggle .taf-icon,
    .woocommerce-cart .taf-qty-btn,
    .woocommerce-cart .taf-line-remove a.remove {
        transition: none;
    }

    /* A toast appears where it stays, without the slide. */
    .woocommerce-cart .taf-toast {
        animation: none;
    }
}


/* ── 14. Phones (the mobile twin) ── */

/* design/Mobile.dc.html M4, with every control the frame leaves out (spec §7). Keep this
   query byte-identical to its nine other copies (css-lint.mjs CL-3): responsive.css's
   mobile-overlay and utility-row blocks, pages.css's card-overlap block, product.css's,
   policy.css's, checkout.css's, account.css's and content.css's phone blocks and
   MOBILE_QUERY in assets/js/main.js. */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {

    /* Room for the checkout bar (52px and its 12px margins) and the iPhone home indicator,
       on the page itself, so the footer's last line ends above the bar too. The class is
       the cart's body. */
    .woocommerce-cart {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .woocommerce-cart .taf-main {
        padding-top: 18px;
        padding-bottom: 48px;
    }

    .woocommerce-cart .taf-cart-head {
        padding-bottom: 14px;
        margin-bottom: 8px;
    }

    .woocommerce-cart .taf-crumbs,
    .woocommerce-cart .taf-steps {
        display: none;
    }

    .woocommerce-cart .taf-cart-title {
        font-size: 32px;
        letter-spacing: -0.035em;
    }

    .woocommerce-cart .taf-cart-head-count {
        font-size: 18px;
    }

    /* "(3)" on phones (M4): the unit word stays in the heading for screen readers. */
    .woocommerce-cart .taf-cart-head-unit {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .woocommerce-cart .taf-cart-page {
        gap: 24px;
    }

    /* The toasts sit 12px above the checkout bar's white strip, which reaches 12px above
       its 52px pill, itself 12px off the bottom: never over it. */
    .woocommerce-cart .taf-toasts {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    /* A line: the picture, then its text; the total and the rate under the text; remove at
       the top right. */
    .woocommerce-cart .taf-line {
        position: relative;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px 12px;
        padding: 16px 0;
    }

    .woocommerce-cart .taf-line-media {
        width: 64px;
        height: 64px;
    }

    .woocommerce-cart .taf-line-badge {
        right: -6px;
        bottom: -6px;
        min-width: 22px;
        height: 22px;
        padding: 0 5px;
        font-size: 11px;
    }

    .woocommerce-cart .taf-line-info {
        padding-right: 48px;
    }

    .woocommerce-cart .taf-line-name {
        font-size: 14.5px;
    }

    .woocommerce-cart .taf-line-summary {
        font-size: 12.5px;
    }

    .woocommerce-cart .taf-line-side {
        grid-column: 2;
        flex-direction: row;
        align-items: baseline;
        justify-content: flex-start;
        gap: 10px;
        text-align: left;
    }

    .woocommerce-cart .taf-line-total {
        font-size: 15px;
    }

    .woocommerce-cart .taf-line-remove {
        position: absolute;
        top: 12px;
        right: 0;
        margin: 0;
    }

    .woocommerce-cart .taf-files-table {
        font-size: 13px;
    }

    .woocommerce-cart .taf-files-table th,
    .woocommerce-cart .taf-files-table td {
        padding: 10px 12px;
    }

    .woocommerce-cart .taf-files-table thead th:nth-child(2) {
        width: 72px;
    }

    .woocommerce-cart .taf-files-table thead th:nth-child(3) {
        width: 52px;
    }

    .woocommerce-cart .taf-cart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .woocommerce-cart .taf-coupon {
        width: 100%;
    }

    .woocommerce-cart .taf-coupon input#coupon_code {
        flex: 1;
        width: auto;
    }

    /* The summary: M4's flatter card. */
    .woocommerce-cart .taf-summary {
        padding: 20px 16px;
        border-radius: var(--radius-tile);
        box-shadow: none;
    }

    .woocommerce-cart .taf-summary-title {
        font-size: 18px;
    }

    /* The checkout bar replaces the card's own button. A white bar along the bottom (::before)
       holds a cyan pill (::after); the link's text sits on both. */
    .woocommerce-cart .wc-proceed-to-checkout {
        display: none;
    }

    .woocommerce-cart .taf-checkout-bar {
        position: fixed;
        z-index: 900;              /* under the header shell (1000) and Gang Sheet Maker's overlays */
        left: 16px;
        right: 16px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        display: flex;
        align-items: center;
        justify-content: center;
        height: 52px;
        color: var(--color-text);
        font-size: 15px;
        font-weight: var(--font-weight-semibold);
        letter-spacing: -0.01em;
        text-transform: uppercase;
        text-decoration: none;
        isolation: isolate;
    }

    .woocommerce-cart .taf-checkout-bar::before {
        content: "";
        position: absolute;
        z-index: -2;
        left: -16px;
        right: -16px;
        top: -12px;
        bottom: calc(-12px - env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--color-border-light);
        background: var(--color-bg);
    }

    .woocommerce-cart .taf-checkout-bar::after {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        border-radius: var(--radius-full);
        background: var(--color-primary);
    }

    .woocommerce-cart .taf-checkout-bar:hover::after {
        background: var(--color-text);
    }

    .woocommerce-cart .taf-checkout-bar:hover {
        color: var(--color-bg);
    }

    .woocommerce-cart .taf-cart-empty {
        padding: 32px 0 48px;
    }

    .woocommerce-cart .taf-cart-empty-title {
        font-size: 26px;
    }
}
