/*
 * Cart and checkout bridge (DESIGN.md "Components contract"): empty cart, net total row,
 * shipping method labels (net price, pickup note), cart remove link, InPost point picker.
 * Loaded only on is_cart() / is_checkout(), after flatsome-bridge.css. Like flatsome-bridge.css
 * it may target WooCommerce/plugin/.medi-* markup; values come from tokens.css.
 * Moved out of style.css on 2026-11-27 (rewrite stage in docs/plans/design-system-cleanup-2026-11.md).
 */

/* Informacje o dacie dostawy w koszyku */
.cart_totals.delivery-shipping-date-info {
    font-size: var(--mt-text-18);
    font-weight: 700;
}

/* Cart / checkout totals: net row. */
.medi-net-total th,
.medi-net-total td {
    font-weight: 700;
}

/* Empty cart. */
.medi-empty-cart {
    max-width: 760px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

.medi-empty-cart__title {
    margin: 0 0 16px;
    font-size: var(--mt-text-h2);
}

.medi-empty-cart__search {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
}

.medi-empty-cart__search input[type=search] {
    flex: 1 1 auto;
    margin: 0;
    border: 1px solid var(--mt-line);
}

.medi-empty-cart__search button {
    margin: 0;
    background: var(--mt-green-text);
}

.medi-empty-cart__cats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 20px;
    margin: 0 0 20px;
    list-style: none;
}

.medi-empty-cart__cats li {
    margin: 0;
    border-top: 1px solid var(--mt-line);
}

.medi-empty-cart__cats a {
    display: block;
    padding: 10px 0;
    color: var(--mt-ink) !important;
    font-weight: 700;
}

.medi-empty-cart__cats a:hover {
    color: var(--mt-green-text) !important;
}

.medi-empty-cart__more {
    color: var(--mt-muted);
}

.medi-empty-cart__more a {
    color: var(--mt-green-text) !important;
    font-weight: 700;
}

@media (max-width: 549px) {
.medi-empty-cart__cats {
        grid-template-columns: 1fr;
    }
}

.medi-pickup-note {
    display: block;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

/* Cart: remove "×" was #ccc on #f9f9f9 (1.5:1). */
.woocommerce-cart-form .product-remove a.remove {
    color: var(--mt-muted) !important;
    border-color: var(--mt-line) !important;
}

.woocommerce-cart-form .product-remove a.remove:hover {
    color: var(--mt-danger) !important;
    border-color: var(--mt-danger) !important;
}

/* InPost "Wybierz punkt odbioru": white on brand yellow was 1.6:1. */
#easypack_show_geowidget {
    color: var(--mt-ink) !important;
}

.medi-ship-price {
    white-space: nowrap;
}

.medi-ship-price__gross {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
}

.medi-ship-price__gross .woocommerce-Price-amount {
    font-weight: 400;
}

/* ======================================================================
   Cart and checkout on the mt system (critique 2026-11-27): the dark title band with the
   ordering steps, white hairline cards, sentence-case headings, net-first totals, one
   shipping list, 44px controls. Markup: Flatsome cart / checkout templates + functions.php.
   ====================================================================== */

/* ---------- head: h1 + steps in the band the category and product pages use ---------- */
.medi-checkout-head {
    background: color-mix(in srgb, var(--mt-green-text) 75%, black);
    color: var(--mt-surface);
}

.medi-checkout-head__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-3) var(--mt-space-6);
    padding-top: 22px;
    padding-bottom: 22px;
}

html body .medi-checkout-head__title {
    margin: 0;
    color: var(--mt-surface);
    font-size: var(--mt-text-h1);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
    text-transform: none;
}

.medi-checkout-steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2) var(--mt-space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: medi-step;
}

.medi-checkout-steps__item {
    display: flex;
    align-items: center;
    gap: var(--mt-space-2);
    margin: 0;
    color: var(--mt-on-dark);
    font-size: var(--mt-text-14);
    font-weight: 700;
    counter-increment: medi-step;
}

.medi-checkout-steps__item::before {
    content: counter(medi-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid color-mix(in srgb, var(--mt-on-dark) 55%, transparent);
    border-radius: var(--mt-radius-pill);
    font-size: var(--mt-text-13);
    font-variant-numeric: tabular-nums;
}

.medi-checkout-steps__item.is-current {
    color: var(--mt-surface);
}

.medi-checkout-steps__item.is-current::before {
    border-color: var(--mt-surface);
    background: var(--mt-surface);
    color: var(--mt-green-text);
}

.medi-checkout-steps__item.is-done::before {
    border-color: var(--mt-on-dark-accent);
    color: var(--mt-on-dark-accent);
}

.medi-checkout-steps__item a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.medi-checkout-steps__item a:hover {
    color: var(--mt-surface);
}

/* the page body sits on the tinted page like the other catalogue surfaces */
html body.woocommerce-cart #main,
html body.woocommerce-checkout #main {
    background: var(--mt-bg);
}

html body.woocommerce-cart .page-wrapper,
html body.woocommerce-checkout .page-wrapper {
    padding-top: var(--mt-space-5);
}

/* ---------- notices: a hairline strip, not bare text on the page ---------- */
html body.woocommerce-cart .woocommerce-message,
html body.woocommerce-checkout .woocommerce-message,
html body.woocommerce-checkout .woocommerce-info,
html body.woocommerce-cart .woocommerce-info {
    margin: 0 0 var(--mt-space-4);
    padding: 12px 16px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
}

html body.woocommerce-cart .woocommerce-message .message-container,
html body.woocommerce-checkout .woocommerce-message .message-container,
html body.woocommerce-checkout .woocommerce-info .message-container,
html body.woocommerce-cart .woocommerce-info .message-container {
    padding: 0;
    color: var(--mt-ink);
    line-height: 1.5;
    text-align: left;
}

html body.woocommerce-cart .woocommerce-message .icon-checkmark,
html body.woocommerce-checkout .woocommerce-message .icon-checkmark {
    margin-right: var(--mt-space-2);
    color: var(--mt-green-text);
}

html body.woocommerce-checkout .woocommerce-info a:not(.button),
html body.woocommerce-cart .woocommerce-info a:not(.button) {
    color: var(--mt-green-text);
    font-weight: 700;
}

/* the B2B sign-in prompt (b2b-solutions) is an offer, not the page's primary action */
html body.woocommerce-checkout .woocommerce-info .button.alt,
html body.woocommerce-cart .woocommerce-info .button.alt {
    min-height: var(--mt-control-h-sm);
    margin: var(--mt-space-1) 0 var(--mt-space-1) var(--mt-space-3);
    padding: 0 14px;
    border: 1px solid var(--mt-green-text);
    background: var(--mt-surface);
    color: var(--mt-green-text) !important;
    font-size: var(--mt-text-14);
    vertical-align: middle;
}

html body.woocommerce-checkout .woocommerce-info .button.alt:hover,
html body.woocommerce-cart .woocommerce-info .button.alt:hover {
    background: var(--mt-green-soft);
}

/* ---------- cards ---------- */
/* Flatsome's divided row draws a grey rule between the cart and its summary: the cards separate them */
html body.woocommerce-cart .row-divided > .col + .col {
    border-left: 0;
}

html body .woocommerce-cart-form,
html body .cart-collaterals .cart-sidebar,
html body form.checkout .medi-checkout-section,
html body .woocommerce-checkout .col-inner.is-well {
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
}

html body .woocommerce-cart-form {
    padding: var(--mt-space-2) var(--mt-space-5) var(--mt-space-5);
}

html body .cart-collaterals .cart-sidebar,
html body .woocommerce-checkout .col-inner.is-well {
    padding: var(--mt-space-5);
}

/* left column: one card per step (delivery, details, payment), x-kom pattern */
html body form.checkout > .row > .large-7 {
    display: flex;
    flex-direction: column;
    gap: var(--mt-space-5);
    padding: 0;
}

html body form.checkout .medi-checkout-section {
    padding: var(--mt-space-5);
}

/* #customer_details holds the billing, contact and delivery cards */
html body form.checkout #customer_details,
html body form.checkout #customer_details > .clear {
    display: flex;
    flex-direction: column;
    gap: var(--mt-space-5);
}

html body form.checkout #customer_details > .clear::before,
html body form.checkout #customer_details > .clear::after {
    display: none;
}

/* delivery card: the "another address" switch is a checkbox line, not a heading */
html body form.checkout #ship-to-different-address {
    margin: 0 0 var(--mt-space-3);
    font-size: var(--mt-text-15);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

html body form.checkout .woocommerce-shipping-fields .shipping_address {
    margin-bottom: var(--mt-space-4);
}

html body form.checkout .woocommerce-additional-fields .form-row {
    margin-bottom: 0;
}

/* contact card: two pairs of half-width fields */
html body form.checkout .medi-checkout-contact__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mt-space-4) var(--mt-space-5);
}

html body form.checkout .medi-checkout-contact__fields .form-row {
    width: auto;
    margin: 0;
    padding: 0;
    float: none;
}

@media (max-width: 549px) {
    html body form.checkout .medi-checkout-contact__fields {
        grid-template-columns: 1fr;
    }
}

html body form.checkout .medi-checkout-section__title {
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

html body .medi-checkout-shipping__table {
    margin: 0;
    border: 0;
}

html body .medi-checkout-shipping__table td,
html body .medi-checkout-shipping__table .shipping__inner {
    padding: 0;
    border: 0 !important;
}

/* the section heading names it; Flatsome's "Przesyłka" cell would repeat it */
html body .medi-checkout-shipping__table .shipping__table th {
    display: none;
}

/* payment: the order button lives in the summary on the right */
html body form.checkout .medi-checkout-payment #place_order {
    display: none;
}

html body form.checkout .medi-checkout-payment .form-row.place-order {
    margin: var(--mt-space-4) 0 0;
    padding: 0;
}

/* right column: a short summary that stays in view */
html body .medi-checkout-summary-cta {
    margin-top: var(--mt-space-4);
}

html body .medi-checkout-summary-cta .medi-place-order {
    width: 100%;
    min-height: 52px;
    margin: 0;
    font-size: var(--mt-text-17);
}

html body .medi-checkout-help {
    margin: var(--mt-space-3) 0 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    text-align: center;
}

html body .medi-checkout-help a {
    color: var(--mt-green-text);
    font-weight: 700;
}

/* the checkout's two columns line up with the title band and the notices above them:
   a grid without Flatsome's negative row margins and column gutters */
html body form.checkout.woocommerce-checkout > .row:not(.row-collapse) {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--mt-space-5);
    align-items: stretch; /* the summary column spans the row, so its sticky panel can travel */
    max-width: none;
    margin: 0;
    padding: 0;
}

html body form.checkout.woocommerce-checkout > .row > .col {
    flex: none;
    max-width: none;
    padding: 0;
}

@media (max-width: 849px) {
    html body form.checkout.woocommerce-checkout > .row:not(.row-collapse) {
        grid-template-columns: minmax(0, 1fr);
    }

    html body form.checkout .medi-checkout-section,
    html body .woocommerce-cart-form,
    html body .cart-collaterals .cart-sidebar,
    html body .woocommerce-checkout .col-inner.is-well {
        padding: var(--mt-space-4);
    }
}

/* ---------- headings: sentence case, title scale ---------- */
html body .woocommerce-billing-fields > h3,
html body .woocommerce-additional-fields > h3,
html body .woocommerce-shipping-fields h3,
html body #order_review_heading,
html body .cart_totals .medi-cart-summary__title {
    margin: 0 0 var(--mt-space-4);
    padding: 0;
    border: 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

/* Flatsome draws a 2px grey rule above the billing fields; the card edge does that job */
html body .woocommerce-checkout .woocommerce-billing-fields {
    padding-top: 0;
    border-top: 0;
}

html body .woocommerce-additional-fields > h3 {
    margin-top: var(--mt-space-6);
}

/* table column heads: the mt-table head, not grey capitals */
html body .woocommerce-cart-form__contents thead th,
html body .woocommerce-checkout-review-order-table thead th {
    padding-top: var(--mt-space-3);
    padding-bottom: var(--mt-space-3);
    border-bottom: 1px solid var(--mt-line);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

/* ---------- cart lines ---------- */
html body .woocommerce-cart-form__contents td {
    padding-top: var(--mt-space-4);
    padding-bottom: var(--mt-space-4);
    border-bottom: 1px solid var(--mt-line);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

html body .woocommerce-cart-form__contents td.actions {
    border-bottom: 0;
    padding-bottom: 0;
}

html body .woocommerce-cart-form__contents .product-thumbnail img {
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
}

html body .woocommerce-cart-form__contents td.product-name > a,
html body .woocommerce-checkout-review-order-table td.product-name {
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    line-height: 1.35;
}

html body .woocommerce-cart-form__contents td.product-name > a:hover {
    color: var(--mt-green-text);
}

html body .woocommerce-cart-form__contents .stock,
html body .woocommerce-checkout-review-order-table .stock {
    margin: var(--mt-space-1) 0 0;
    font-size: var(--mt-text-13);
}

/* remove: the 36px icon circle of the One Button Rule, a drawn cross */
html body .woocommerce-cart-form .product-remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--mt-line) !important;
    border-radius: var(--mt-radius-pill);
    background: var(--mt-surface);
    position: relative;
    overflow: hidden;
    text-indent: 200%; /* the "×" stays the link's text for screen readers; no 0px text */
    white-space: nowrap;
    line-height: 1;
}

html body .woocommerce-cart-form .product-remove a.remove::before {
    content: "";
    width: 18px;
    height: 18px;
    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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .woocommerce-cart-form .product-remove a.remove:hover {
    background: var(--mt-surface);
}

/* actions row: "Kontynuuj zakupy" and "Zaktualizuj koszyk" are both secondary */
html body .woocommerce-cart-form .actions .button[name="update_cart"] {
    min-height: var(--mt-control-h);
    margin-left: var(--mt-space-3);
    padding: 0 20px;
    border: 1px solid var(--mt-green-text);
    background: var(--mt-surface);
    color: var(--mt-green-text) !important;
    font-size: var(--mt-text-15);
    opacity: 1;
}

html body .woocommerce-cart-form .actions .button[name="update_cart"]:disabled {
    border-color: var(--mt-line-strong);
    color: var(--mt-disabled) !important;
    cursor: default;
}

/* ---------- quantity: 16px digits so iOS does not zoom ---------- */
html body .woocommerce-cart-form .quantity.buttons_added input.qty {
    font-size: var(--mt-text-input);
}

/* ---------- totals ---------- */
html body .cart_totals .shop_table,
html body .woocommerce-checkout-review-order-table {
    margin: 0;
    border: 0;
    font-variant-numeric: tabular-nums;
}

html body .cart_totals .shop_table th,
html body .cart_totals .shop_table td,
html body .woocommerce-checkout-review-order-table th,
html body .woocommerce-checkout-review-order-table td {
    padding-top: var(--mt-space-3);
    padding-bottom: var(--mt-space-3);
    border-bottom: 1px solid var(--mt-line);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
}

html body .cart_totals .cart-subtotal th,
html body .woocommerce-checkout-review-order-table .cart-subtotal th,
html body .cart_totals .shipping__table th,
html body .woocommerce-checkout-review-order-table .shipping__table th {
    color: var(--mt-muted);
    font-weight: 700;
}

/* net total: the B2B headline figure (as the product page price) */
html body .shop_table .medi-net-total th {
    padding-top: var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

html body .shop_table .medi-net-total td {
    padding-top: var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

html body .shop_table .medi-net-total td .medi-price__label {
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    font-weight: 400;
}

/* gross amount to pay */
html body .shop_table .order-total th {
    font-size: var(--mt-text-17) !important;
}

html body .shop_table .order-total th,
html body .shop_table .order-total td {
    border-bottom: 0 !important;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

html body .shop_table .order-total td strong {
    color: var(--mt-ink);
    font-size: var(--mt-text-h2);
    font-weight: 700;
}

html body .order-total td .includes_tax {
    display: block;
    margin-top: 2px;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
}

html body .order-total td .includes_tax .amount {
    color: var(--mt-muted);
    font-weight: 400;
    white-space: nowrap;
}

/* ---------- shipping methods: one list of hairline rows ---------- */
html body .shipping__table th,
html body .shipping__table td {
    border-bottom: 0 !important;
}

html body .shipping__list {
    margin: var(--mt-space-2) 0 0;
    padding: 0;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    overflow: hidden;
}

html body .shipping__list .shipping__list_item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 48px;
    align-items: center;
    gap: var(--mt-space-3);
    min-height: 56px;
    margin: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mt-line);
    background: var(--mt-surface);
}

html body .shipping__list .shipping__list_item:last-child {
    border-bottom: 0;
}

html body .shipping__list .shipping__list_item:has(input:checked) {
    background: var(--mt-green-soft);
    box-shadow: inset 0 0 0 1px var(--mt-green-text);
}

html body .shipping__list input.shipping_method {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--mt-green-text);
}

html body .shipping__list .shipping__list_label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px var(--mt-space-3);
    margin: 0;
    padding: 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    opacity: 1;
}

.medi-ship-name {
    flex: 1 1 12em;
    min-width: 0;
    font-weight: 700;
}

html body .shipping__list .medi-pickup-note {
    display: block;
    margin-top: 2px;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
}

html body .shipping__list .medi-ship-price {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

html body .shipping__list .medi-ship-price .medi-price__label {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
}

html body .shipping__list .medi-ship-price__gross {
    font-size: var(--mt-text-13);
}

html body .shipping__list .medi-ship-price--free {
    color: var(--mt-green-text);
}

/* carrier logos in one 48x32 frame; the shop pickup gets a drawn shop mark */
html body .shipping__list .inpost_pl-shipping-method-meta-wrap,
html body .shipping__list .simple-ups-shipping-method-logo {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 32px;
    margin: 0 !important;
}

html body .shipping__list .inpost_pl-shipping-method-meta-wrap img,
html body .shipping__list .simple-ups-shipping-method-logo img,
html body .shipping__list .easypack-shipping-method-logo img {
    display: block;
    width: 48px !important;
    max-width: 48px !important;
    height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    object-fit: contain;
}

html body .shipping__list .easypack-shipping-method-logo {
    display: block;
    margin: 0;
}

html body .shipping__list .shipping__list_item:has(input[value^="local_pickup"])::after {
    content: "";
    justify-self: center;
    width: 24px;
    height: 24px;
    background: var(--mt-green-text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1.5-5h15L21 9M3 9h18M3 9v1.5a3 3 0 0 0 6 0V9m0 1.5a3 3 0 0 0 6 0V9m0 1.5a3 3 0 0 0 6 0V9M5 13v7h14v-7M10 20v-4h4v4'/%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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1.5-5h15L21 9M3 9h18M3 9v1.5a3 3 0 0 0 6 0V9m0 1.5a3 3 0 0 0 6 0V9m0 1.5a3 3 0 0 0 6 0V9M5 13v7h14v-7M10 20v-4h4v4'/%3E%3C/svg%3E") center / contain no-repeat;
    grid-column: 3;
    grid-row: 1;
}

/* the cart's "Metody wysyłki zostaną zaktualizowane…" and calculator: small print, 13px */
html body .woocommerce-shipping-destination,
html body .shipping-calculator-button {
    margin-top: var(--mt-space-2);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

html body .shipping-calculator-button {
    color: var(--mt-green-text);
    font-weight: 700;
}

/* InPost point picker: a secondary button under the list, not a fourth button shape */
html body tr.easypack-parcel-machine th,
html body tr.easypack-parcel-machine td {
    padding-top: 0;
    border-bottom: 0;
    text-align: left !important;
}

html body #easypack_show_geowidget,
html body .easypack_show_geowidget {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: var(--mt-control-h-sm);
    margin: var(--mt-space-2) 0 0;
    padding: 0 14px;
    border: 1px solid var(--mt-green-text) !important;
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface) !important;
    box-shadow: none !important;
    color: var(--mt-green-text) !important;
    font-family: var(--mt-font);
    font-size: var(--mt-text-14) !important;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

html body #easypack_show_geowidget:hover,
html body .easypack_show_geowidget:hover {
    background: var(--mt-green-soft) !important;
}

/* ---------- checkout fields and choices ---------- */
html body .woocommerce-checkout .form-row .input-text,
html body .woocommerce-checkout .form-row select,
html body .woocommerce-checkout .select2-container .select2-selection__rendered {
    font-size: var(--mt-text-input);
}

html body .woocommerce-checkout .form-row label {
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    font-weight: 700;
}

html body .woocommerce-checkout .form-row .description,
html body .woocommerce-checkout .woocommerce-billing-fields p:not(.form-row) {
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
}

html body .woocommerce-checkout input[type="checkbox"],
html body .woocommerce-checkout input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--mt-green-text);
    vertical-align: -3px;
}

/* payment and place order */
html body #payment {
    background: transparent;
}

html body #payment .payment_methods {
    padding: 0;
    border: 0;
}

html body #payment .payment_methods > li > label {
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

html body #payment .payment_box {
    margin: var(--mt-space-2) 0 0;
    padding: 12px 14px;
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
}

html body #payment .payment_box::before {
    display: none;
}

html body .woocommerce-terms-and-conditions-wrapper,
html body .woocommerce-privacy-policy-text {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

html body .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label-for-checkbox {
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    font-weight: 700;
}

html body #place_order {
    width: 100%;
    min-height: 52px;
    font-size: var(--mt-text-17);
}

html body .wc-proceed-to-checkout .checkout-button {
    width: 100%;
    min-height: 52px;
    margin: var(--mt-space-4) 0 0;
    font-size: var(--mt-text-17);
}

/* ---------- notices Flatsome prints right under the header (checkout): inside the page width ---------- */
html body.woocommerce-checkout #wrapper > .message-wrapper {
    width: calc(100% - 30px);
    max-width: 1540px;
    margin: var(--mt-space-4) auto 0;
}

html body.woocommerce-checkout .message-wrapper .message-container,
html body.woocommerce-cart .message-wrapper .message-container {
    text-align: left !important;
}

/* InPost picker row: one cell across, the button under the shipping list */
html body tr.easypack-parcel-machine th {
    display: none;
}

html body tr.easypack-parcel-machine td {
    display: block;
    width: 100%;
}

html body #easypack_show_geowidget,
html body .easypack_show_geowidget {
    white-space: nowrap;
}

@media (max-width: 849px) {
    .medi-checkout-head__inner {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .medi-checkout-steps {
        gap: var(--mt-space-2) var(--mt-space-3);
    }

    .medi-checkout-steps__item {
        gap: 6px;
        font-size: var(--mt-text-13);
    }

    .medi-checkout-steps__item::before {
        width: 22px;
        height: 22px;
        font-size: var(--mt-text-12);
    }

}

/* Below 1400px the cart card can be narrower than its six-column table (the remove button left
   the card between 850 and 1250px with a long product code): the line becomes rows instead. */
@media (max-width: 1399px) {
    /* cart line: [image | name, code, price | remove] then the quantity under the name */
    html body .woocommerce-cart-form__contents thead {
        display: none;
    }

    html body .woocommerce-cart-form__contents tr.cart_item {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr) auto; /* the remove button is 44px on touch widths */
        column-gap: var(--mt-space-3);
        row-gap: var(--mt-space-3);
        padding: var(--mt-space-4) 0;
        border-bottom: 1px solid var(--mt-line);
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td {
        display: block;
        width: auto !important;
        padding: 0 !important;
        border: 0 !important;
        text-align: left;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-thumbnail img {
        width: 64px;
        height: auto;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-name {
        grid-column: 2;
        grid-row: 1;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-remove {
        grid-column: 3;
        grid-row: 1;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-quantity {
        grid-column: 2 / span 2;
        grid-row: 2;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-price,
    html body .woocommerce-cart-form__contents tr.cart_item > td.product-subtotal {
        display: none;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td::before {
        display: none;
    }

    html body .woocommerce-cart-form__contents .mobile-product-price {
        margin-top: var(--mt-space-2);
        color: var(--mt-ink);
        font-size: var(--mt-text-14);
    }

    html body .woocommerce-cart-form__contents td.actions .button,
    html body .woocommerce-cart-form__contents td.actions .continue-shopping {
        width: 100%;
        margin: var(--mt-space-3) 0 0 !important;
    }

    html body .woocommerce-cart-form__contents .mobile-product-price .medi-price {
        display: inline-flex;
        flex-direction: column;
        vertical-align: top;
    }

}

/* ---------- cart summary first (child woocommerce/cart/cart-totals.php) ---------- */
html body .cart_totals .medi-cart-summary__title {
    display: block;
}

html body .medi-cart-summary td .medi-price__net {
    font-size: var(--mt-text-17);
}

html body .medi-cart-summary__method {
    display: block;
    margin-top: 2px;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
}

html body .medi-cart-summary .medi-cart-summary__shipping th,
html body .medi-cart-summary .cart-subtotal th {
    color: var(--mt-ink);
    font-weight: 700;
}

html body .medi-cart-summary__free {
    color: var(--mt-green-text);
    font-size: var(--mt-text-17);
    font-weight: 700;
}

html body .medi-cart-summary__pending {
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
}

html body .cart_totals .wc-proceed-to-checkout {
    padding: 0;
}

html body .cart_totals .wc-proceed-to-checkout .checkout-button {
    margin-top: var(--mt-space-3);
}


/* ---------- order summary lines: thumbnail beside name, code and stock ---------- */
html body .woocommerce-checkout-review-order-table td.product-name .medi-review-line {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: var(--mt-space-3);
    align-items: start;
}

html body .medi-review-line__thumb img {
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    object-fit: contain;
}

/* ---------- checkout / cart errors: one card with a hairline in the danger colour ---------- */
html body.woocommerce-checkout .woocommerce-error,
html body.woocommerce-cart .woocommerce-error {
    position: relative;
    margin: 0 0 var(--mt-space-5);
    padding: 12px 16px 12px 46px;
    list-style: none;
    border: 1px solid color-mix(in srgb, var(--mt-danger) 35%, transparent);
    border-radius: var(--mt-radius-card);
    background: color-mix(in srgb, var(--mt-danger) 4%, var(--mt-surface));
    color: var(--mt-danger);
    font-size: var(--mt-text-15);
    line-height: 1.5;
}

html body.woocommerce-checkout .woocommerce-error::before,
html body.woocommerce-cart .woocommerce-error::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 16px;
    width: 18px;
    height: 18px;
    background: var(--mt-danger);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body.woocommerce-checkout .woocommerce-error li,
html body.woocommerce-cart .woocommerce-error li {
    margin: 0;
    padding: 0;
    list-style: none;
}

html body.woocommerce-checkout .woocommerce-error li + li,
html body.woocommerce-cart .woocommerce-error li + li {
    margin-top: var(--mt-space-1);
}

html body.woocommerce-checkout .woocommerce-error .message-container,
html body.woocommerce-cart .woocommerce-error .message-container {
    padding: 0;
    color: var(--mt-danger);
    text-align: left !important;
}

html body.woocommerce-checkout .woocommerce-error .message-icon,
html body.woocommerce-cart .woocommerce-error .message-icon {
    display: none;
}

/* the field the error points at */
html body .woocommerce-checkout .form-row.woocommerce-invalid .input-text,
html body .woocommerce-checkout .form-row.woocommerce-invalid select {
    border-color: var(--mt-danger);
}

/* ---------- line numbers (Lp.) and the positions count ---------- */
html body .woocommerce-cart-form__contents tbody,
html body .woocommerce-checkout-review-order-table tbody {
    counter-reset: medi-line;
}

html body .woocommerce-cart-form__contents tr.cart_item,
html body .woocommerce-checkout-review-order-table tr.cart_item {
    counter-increment: medi-line;
}

/* cart: the number sits in front of the thumbnail */
html body .woocommerce-cart-form__contents td.product-thumbnail {
    position: relative;
    padding-left: 30px;
}

html body .woocommerce-cart-form__contents td.product-thumbnail::before,
html body .medi-review-line::before {
    content: counter(medi-line) ".";
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

html body .woocommerce-cart-form__contents td.product-thumbnail::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 24px;
    transform: translateY(-50%);
    text-align: right;
}

/* quantity column between the product and the amount */
html body .woocommerce-checkout-review-order-table .medi-review-qty {
    width: 1%;
    padding-right: var(--mt-space-4);
    padding-left: var(--mt-space-3);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

html body .woocommerce-checkout-review-order-table thead .medi-review-qty {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
}

html body .woocommerce-checkout-review-order-table .medi-review-qty .product-quantity {
    font-weight: inherit;
}

/* order summary: [no. | thumbnail | text] */
html body .woocommerce-checkout-review-order-table td.product-name .medi-review-line {
    grid-template-columns: 22px 56px minmax(0, 1fr);
}

html body .medi-review-line::before {
    padding-top: 18px;
    text-align: right;
}

html body .medi-cart-summary__count {
    margin: calc(var(--mt-space-3) * -1) 0 var(--mt-space-3);
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    font-variant-numeric: tabular-nums;
    text-align: left;
}

html body caption.medi-cart-summary__count {
    margin: 0 0 var(--mt-space-2);
    padding: 0;
    caption-side: top;
}

@media (max-width: 1399px) {
    /* row cart line: [no. + image | text | remove] */
    html body .woocommerce-cart-form__contents tr.cart_item {
        grid-template-columns: 88px minmax(0, 1fr) auto;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-thumbnail {
        padding-left: 24px !important;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-thumbnail::before {
        display: block;
        top: 22px;
        width: 18px;
    }
}

/* from 550px the "1 x price" line under the name is hidden: the line amount sits beside the quantity */
@media (min-width: 550px) and (max-width: 1399px) {
    html body .woocommerce-cart-form__contents tr.cart_item > td.product-subtotal {
        display: block;
        grid-column: 2 / -1;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        text-align: right;
    }

    html body .woocommerce-cart-form__contents tr.cart_item > td.product-quantity {
        justify-self: start;
    }
}

/* two-column cart with row lines: the two secondary actions stay side by side */
@media (min-width: 850px) and (max-width: 1399px) {
    html body .woocommerce-cart-form__contents td.actions .button,
    html body .woocommerce-cart-form__contents td.actions .continue-shopping {
        width: auto;
        margin: var(--mt-space-3) var(--mt-space-3) 0 0 !important;
    }

    html body .woocommerce-cart-form__contents td.actions .continue-shopping .button {
        margin: 0 !important;
    }
}

@media (max-width: 849px) {

    /* order summary line: the price goes under the text, the name gets the width
       (block rows inside a table body would keep the first column's width) */
    html body .woocommerce-checkout-review-order-table thead {
        display: none;
    }

    html body table.woocommerce-checkout-review-order-table {
        display: block;
    }

    html body .woocommerce-checkout-review-order-table caption {
        display: block;
    }

    html body .woocommerce-checkout-review-order-table tbody {
        display: block;
        width: 100%;
    }

    /* the totals keep their two-column table */
    html body .woocommerce-checkout-review-order-table tfoot {
        display: table;
        width: 100%;
    }

    /* [no. | picture | name] on the first row, [quantity | amount] under the name */
    html body .woocommerce-checkout-review-order-table tr.cart_item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--mt-space-2) var(--mt-space-3);
        padding: var(--mt-space-3) 0;
        border-bottom: 1px solid var(--mt-line);
    }

    html body .woocommerce-checkout-review-order-table tr.cart_item > td.product-name {
        grid-column: 1 / -1;
    }

    html body .woocommerce-checkout-review-order-table tr.cart_item > td.medi-review-qty {
        width: auto;
        padding-left: calc(22px + 56px + 2 * var(--mt-space-3));
        text-align: left;
    }

    html body .woocommerce-checkout-review-order-table tr.cart_item > td {
        display: block;
        padding: 0;
        border: 0;
    }

    html body .woocommerce-checkout-review-order-table tr.cart_item > td.product-total {
        text-align: right;
    }

    html body .woocommerce-checkout-review-order-table tr.cart_item > td.product-total .medi-price {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-end;
    }
}

/* ---------- checkout details: "Kupujesz jako" switch and field groups ---------- */
.medi-buyer-type {
    margin: 0 0 var(--mt-space-5);
}

.medi-buyer-type__label {
    margin: 0 0 var(--mt-space-2);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

.medi-buyer-type__options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mt-space-3);
}

html body .medi-buyer-type__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--mt-control-h);
    margin: 0;
    padding: 0 16px 0 44px;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    box-shadow: none;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    cursor: pointer;
}

/* radio mark drawn from the pressed state */
html body .medi-buyer-type__option::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-pill);
    background: var(--mt-surface);
}

html body .medi-buyer-type__option:hover {
    border-color: var(--mt-green-text);
}

html body .medi-buyer-type__option:focus-visible {
    outline: none;
    box-shadow: var(--mt-focus);
}

html body .medi-buyer-type__option[aria-pressed="true"] {
    border-color: var(--mt-green-text);
    background: var(--mt-green-soft);
    box-shadow: inset 0 0 0 1px var(--mt-green-text);
}

html body .medi-buyer-type__option[aria-pressed="true"]::before {
    border: 5px solid var(--mt-green-text);
}

/* a B2B account orders on a VAT invoice only: "Osoba prywatna" is greyed, with the reason */
html body .medi-buyer-type__option[aria-disabled="true"] {
    border-color: var(--mt-line);
    background: var(--mt-bg);
    color: var(--mt-disabled);
    cursor: not-allowed;
}

html body .medi-buyer-type__option[aria-disabled="true"]::before {
    border-color: var(--mt-line);
    background: var(--mt-bg);
}

.medi-buyer-type__tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 5;
    width: max-content;
    max-width: 280px;
    padding: 8px 12px;
    border-radius: var(--mt-radius-control);
    background: var(--mt-ink);
    box-shadow: var(--mt-shadow-raised);
    color: var(--mt-surface);
    font-size: var(--mt-text-13);
    font-weight: 400;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    visibility: hidden;
}

.medi-buyer-type__option:not([aria-disabled="true"]) .medi-buyer-type__tip {
    display: none;
}

.medi-buyer-type__option[aria-disabled="true"]:hover .medi-buyer-type__tip,
.medi-buyer-type__option[aria-disabled="true"]:focus-visible .medi-buyer-type__tip,
.medi-buyer-type__option.show-tip .medi-buyer-type__tip {
    opacity: 1;
    visibility: visible;
}

.medi-buyer-type__note {
    margin: var(--mt-space-2) 0 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

/* the b2b-solutions checkbox stays as the data field; the switch replaces its label */
html body .woocommerce-checkout #vat_invoice_field label.checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html body .woocommerce-checkout #vat_invoice_field {
    margin: 0;
}

html body .woocommerce-checkout #vat_invoice_field .description {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

/* group headings inside the details card */
html body .woocommerce-checkout h3.medi-form-group {
    width: 100%;
    margin: var(--mt-space-5) 0 var(--mt-space-3);
    padding: var(--mt-space-4) 0 0;
    border-top: 1px solid var(--mt-line);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

html body .woocommerce-checkout h3.medi-form-group--company {
    margin-top: var(--mt-space-4);
}

/* field rhythm: label above, 16px between rows */
html body .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    margin-bottom: var(--mt-space-4);
}

html body .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row label:not(.checkbox) {
    margin-bottom: 6px;
}

@media (max-width: 549px) {
    html body .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first,
    html body .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last {
        width: 100%;
        float: none;
    }
}

html body .woocommerce-checkout #vat_invoice_field .description {
    display: block;
}

@media (max-width: 549px) {
    html body .medi-buyer-type__option {
        padding: 0 10px 0 38px;
        font-size: var(--mt-text-14);
        white-space: nowrap;
    }

    html body .medi-buyer-type__option::before {
        left: 12px;
    }
}

/* remove (trash) is the last cell of the line */
html body .woocommerce-cart-form__contents td.product-remove {
    width: 52px;
    padding-left: var(--mt-space-3);
    text-align: right;
}

/* VAT as its own summary row */
html body .shop_table .medi-vat-total th,
html body .shop_table .medi-vat-total td {
    color: var(--mt-muted);
    font-size: var(--mt-text-15);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* order notes card: the card title names the field */
html body form.checkout .woocommerce-additional-fields #order_comments_field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html body form.checkout #order_comments {
    min-height: 96px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ---------- cart: the summary stays in view; cross-sells are their own card ---------- */
@media (min-width: 850px) {
    html body.woocommerce-cart .cart-collaterals .cart-sidebar {
        position: sticky;
        top: 100px;
    }
}

html body .medi-cart-cross-sells {
    margin-top: var(--mt-space-5);
    padding: var(--mt-space-5);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
}

html body .medi-cart-cross-sells .medi-related-products {
    margin: 0;
    padding: 0;
}

html body .medi-cart-cross-sells .medi-related-products__title {
    margin-top: 0;
}

/* summary: terms right above the order button */
html body .medi-checkout-summary-cta .woocommerce-terms-and-conditions-wrapper {
    margin: 0 0 var(--mt-space-3);
}

html body .medi-checkout-summary-cta .woocommerce-terms-and-conditions-wrapper .form-row {
    margin: 0;
    padding: 0;
}

/* Flatsome's sticky summary stops 30px from the top, under the 82px sticky header */
html body.woocommerce-checkout form.checkout .is-sticky-column {
    top: 100px;
}

/* both cart columns end on the same line (Flatsome gives forms a 1.3em bottom margin) */
html body .woocommerce-cart-form {
    margin-bottom: 0;
}

/* cross-sells card: Flatsome's .product-section top rule and the page-level heading size
   do not belong inside a card */
html body .medi-cart-cross-sells .product-section {
    border-top: 0;
}

html body .medi-cart-cross-sells .medi-related-products__title {
    margin-bottom: var(--mt-space-4);
    padding: 0;
    background: none;
    font-size: var(--mt-text-18);
}

/* ---------- business account: saved billing data as a card with "Zmień" ---------- */
.medi-account-billing__card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--mt-space-4);
    margin: 0 0 var(--mt-space-4);
    padding: 14px 16px;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
}

.medi-account-billing__data p {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

html body .medi-account-billing__data .medi-account-billing__label {
    margin-bottom: var(--mt-space-1);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
}

html body .medi-account-billing__data .medi-account-billing__name {
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

html body .medi-account-billing__change {
    flex: none;
    min-height: var(--mt-control-h-sm);
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--mt-green-text);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    color: var(--mt-green-text);
    font-size: var(--mt-text-14);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

html body .medi-account-billing__change:hover {
    background: var(--mt-green-soft);
}

.woocommerce-billing-fields__field-wrapper.is-account-collapsed :is(#vat_invoice_field, h3.medi-form-group, #tax_number_field, #billing_company_field, #billing_country_field, #billing_address_1_field, #billing_address_2_field, #billing_postcode_field, #billing_city_field, #billing_state_field),
.medi-account-billing__card[hidden],
.medi-account-billing__save[hidden] {
    display: none !important;
}

html body .medi-account-billing__save {
    margin: var(--mt-space-2) 0 0;
    padding: 12px 14px;
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
}

html body .medi-account-billing__save .description,
html body .medi-nip-locked {
    display: block;
    margin-top: var(--mt-space-1);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

/* a short cart: the products card is as tall as the summary beside it */
@media (min-width: 850px) {
    html body.woocommerce-cart .woocommerce > .row > .large-7 {
        display: flex;
        flex-direction: column;
    }

    html body.woocommerce-cart .woocommerce > .row > .large-7 > .woocommerce-cart-form {
        flex: 1 1 auto;
    }
}

/* ======================================================================
   Order received (child checkout/thankyou.php): confirmation, "Co dalej", data, summary.
   ====================================================================== */
.medi-thankyou {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--mt-space-5);
    align-items: stretch;
}

.medi-thankyou__main {
    display: flex;
    flex-direction: column;
    gap: var(--mt-space-5);
    min-width: 0;
}

.medi-thankyou__aside {
    min-width: 0;
}

@media (min-width: 850px) {
    .medi-thankyou__summary {
        position: sticky;
        top: 100px;
    }
}

@media (max-width: 849px) {
    .medi-thankyou {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* confirmation */
html body .medi-thankyou__confirm {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: var(--mt-space-4);
    align-items: start;
}

.medi-thankyou__check {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: var(--mt-radius-pill);
    background: var(--mt-green-text);
    -webkit-mask: none;
    position: relative;
}

.medi-thankyou__check::after {
    content: "";
    position: absolute;
    inset: 12px;
    background: var(--mt-surface);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%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='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .medi-thankyou__title {
    margin: 0 0 var(--mt-space-2);
    color: var(--mt-ink);
    font-size: var(--mt-text-21);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
}

.medi-thankyou__lead {
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-muted);
    font-size: var(--mt-text-15);
}

.medi-thankyou__lead strong {
    color: var(--mt-ink);
}

html body .medi-thankyou__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--mt-space-3) var(--mt-space-5);
    margin: 0;
    padding: var(--mt-space-4) 0 0;
    border-top: 1px solid var(--mt-line);
}

html body .medi-thankyou__facts dt {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

html body .medi-thankyou__facts dd {
    margin: 2px 0 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

/* "Co dalej": numbered steps; the current one carries the transfer data */
html body .medi-thankyou__steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: medi-next;
}

html body .medi-thankyou__step {
    position: relative;
    margin: 0;
    padding: 0 0 var(--mt-space-5) 44px;
    counter-increment: medi-next;
}

html body .medi-thankyou__step:last-child {
    padding-bottom: 0;
}

html body .medi-thankyou__step::before {
    content: counter(medi-next);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-pill);
    background: var(--mt-surface);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

html body .medi-thankyou__step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 32px;
    bottom: 4px;
    left: 14px;
    width: 1px;
    background: var(--mt-line);
}

html body .medi-thankyou__step.is-current::before {
    border-color: var(--mt-green-text);
    background: var(--mt-green-text);
    color: var(--mt-surface);
}

html body .medi-thankyou__step.is-done::before {
    border-color: var(--mt-green-text);
    color: var(--mt-green-text);
}

.medi-thankyou__step-title {
    margin: 3px 0 2px;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
}

.medi-thankyou__step-text {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    line-height: 1.5;
}

html body .medi-transfer {
    margin: var(--mt-space-3) 0 0;
    padding: 0;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
}

html body .medi-transfer > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: var(--mt-space-3);
    align-items: center;
    min-height: 48px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--mt-line);
}

html body .medi-transfer > div:last-child {
    border-bottom: 0;
}

html body .medi-transfer dt {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

html body .medi-transfer dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-2);
    margin: 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

html body .medi-copy {
    flex: none;
    min-height: var(--mt-control-h-sm);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--mt-green-text);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    color: var(--mt-green-text);
    font-size: var(--mt-text-13);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    transition: background-color .15s ease, transform .1s ease;
}

html body .medi-copy:hover {
    background: var(--mt-green-soft);
}

html body .medi-copy:active {
    transform: translateY(1px);
}

html body .medi-copy.is-done {
    border-color: var(--mt-green-text);
    background: var(--mt-green-text);
    color: var(--mt-surface);
}

/* data: two columns inside one card */
html body .medi-thankyou__data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mt-space-5);
}

@media (max-width: 549px) {
    html body .medi-thankyou__data {
        grid-template-columns: 1fr;
    }

    html body .medi-transfer > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

html body .medi-thankyou__address {
    margin: 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-style: normal;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}

.medi-thankyou__sub {
    margin: var(--mt-space-4) 0 var(--mt-space-1);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
}

.medi-thankyou__note {
    margin: 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
}

/* summary */
html body .medi-thankyou__lines {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: medi-line;
}

html body .medi-thankyou__line {
    display: grid;
    grid-template-columns: 22px 56px minmax(0, 1fr) auto minmax(96px, auto);
    gap: var(--mt-space-3);
    align-items: start;
    margin: 0;
    padding: var(--mt-space-3) 0;
    border-bottom: 1px solid var(--mt-line);
    counter-increment: medi-line;
}

html body .medi-thankyou__line::before {
    content: counter(medi-line) ".";
    padding-top: 18px;
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* quantity: its own column, never glued to the name */
html body .medi-thankyou__line-qty {
    padding-top: 2px;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* column heads over the lines (Produkt · Ilość · Wartość), the checkout table's head style */
html body .medi-thankyou__line.medi-thankyou__lines-head {
    align-items: end;
    padding: 0 0 var(--mt-space-2);
    border-bottom: 1px solid var(--mt-line);
    counter-increment: none;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
}

html body .medi-thankyou__line.medi-thankyou__lines-head::before {
    content: none;
}

html body .medi-thankyou__lines-head .medi-thankyou__lines-head-product {
    grid-column: 1 / 4;
}

html body .medi-thankyou__lines-head .medi-thankyou__line-qty,
html body .medi-thankyou__lines-head .medi-thankyou__line-price {
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.medi-thankyou__line-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.medi-thankyou__line-name {
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    line-height: 1.35;
}

.medi-thankyou__line-name a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--mt-line-strong, var(--mt-line));
    text-underline-offset: 3px;
}

.medi-thankyou__line-name a:hover {
    color: var(--mt-green-text);
    text-decoration-color: currentColor;
}

a.medi-review-line__thumb {
    display: block;
}

.medi-thankyou__line-sku {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

.medi-thankyou__line-sku strong {
    color: var(--mt-green-text);
}

.medi-thankyou__line-price {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.medi-thankyou__line-price .medi-price {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

html body .medi-thankyou__totals {
    width: 100%;
    margin: 0;
    border: 0;
    font-variant-numeric: tabular-nums;
}

html body .medi-thankyou__totals th,
html body .medi-thankyou__totals td {
    padding-top: var(--mt-space-3);
    padding-bottom: var(--mt-space-3);
    border-bottom: 1px solid var(--mt-line);
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    vertical-align: middle;
}

html body .medi-thankyou__totals td {
    text-align: right;
}

html body .medi-thankyou__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-3);
    margin: var(--mt-space-4) 0 0;
}

html body .medi-thankyou__actions .button {
    flex: 1 1 auto;
    margin: 0;
}

/* phones: name and code on the first row, quantity and value on the second */
@media (max-width: 549px) {
    html body .medi-thankyou__line {
        grid-template-columns: 18px 48px minmax(0, 1fr) auto;
        row-gap: var(--mt-space-2);
    }

    html body .medi-thankyou__line > .medi-thankyou__line-text {
        grid-column: 3 / -1;
    }

    html body .medi-thankyou__line > .medi-thankyou__line-qty {
        grid-column: 3;
        grid-row: 2;
        text-align: left;
    }

    html body .medi-thankyou__line > .medi-thankyou__line-price {
        grid-column: 4;
        grid-row: 2;
    }

    html body .medi-thankyou__line.medi-thankyou__lines-head {
        display: none;
    }
}

/* order received: the same cards as the checkout (that rule is scoped to form.checkout) */
html body .medi-thankyou .medi-checkout-section {
    padding: var(--mt-space-5);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
}

html body .medi-thankyou .medi-checkout-section__title {
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

html body .medi-thankyou .medi-thankyou__summary .medi-checkout-section__title {
    margin-bottom: var(--mt-space-1);
}

/* Flatsome sets dl/dt/dd inline, small and in capitals, and table heads in capitals */
html body .medi-thankyou dl,
html body .medi-thankyou dt,
html body .medi-thankyou dd {
    letter-spacing: 0;
    text-transform: none;
}

html body .medi-thankyou__facts > div {
    display: block;
}

html body .medi-thankyou__facts dt,
html body .medi-thankyou__facts dd {
    display: block;
}

html body .medi-thankyou__totals th {
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
}

html body .medi-thankyou__totals .medi-vat-total th,
html body .medi-thankyou__totals .medi-vat-total td {
    color: var(--mt-muted);
    font-weight: 400;
}

@media (max-width: 849px) {
    html body .medi-thankyou .medi-checkout-section {
        padding: var(--mt-space-4);
    }
}

/* ---------- audit fixes 2026-11-28 ---------- */
html body .medi-thankyou dl {
    opacity: 1;
}

/* links inside sentences are underlined, not told apart by colour alone */
html body .woocommerce-privacy-policy-text a,
html body .woocommerce-terms-and-conditions-checkbox-text a,
html body .medi-checkout-help a,
html body .woocommerce-checkout .woocommerce-info a:not(.button),
html body .woocommerce-cart .woocommerce-info a:not(.button) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* the "Koszyk" step link: a 24px target */
.medi-checkout-steps__item a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

/* InPost point picker (made a button by medi-checkout.js) */
html body #easypack_show_geowidget:focus-visible,
html body .easypack_show_geowidget:focus-visible {
    outline: none;
    box-shadow: var(--mt-focus) !important;
}

/* section titles are h2 now: keep the card title size */
html body form.checkout h2.medi-checkout-section__title {
    line-height: 1.3;
}

/* phones: amount to pay in view until the summary is on screen */
.medi-paybar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-3);
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mt-line);
    background: var(--mt-surface);
    box-shadow: 0 -4px 16px color-mix(in srgb, var(--mt-green-night) 6%, transparent);
}

.medi-paybar[hidden] {
    display: none;
}

.medi-paybar__total {
    display: flex;
    flex-direction: column;
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    line-height: 1.2;
}

.medi-paybar__total strong {
    color: var(--mt-ink);
    font-size: var(--mt-text-21);
    font-variant-numeric: tabular-nums;
}

html body .medi-paybar__go {
    flex: none;
    min-height: var(--mt-control-h);
    margin: 0;
}
