/*
 * Product listing bridge (DESIGN.md "Components contract"): category, brand, shop and product
 * search archives — horizontal filters, brand category nav, product rows, pagination, category
 * description and the bottom buying guide.
 * Loaded only on is_shop() / is_product_taxonomy() / product search, after flatsome-bridge.css.
 * Like flatsome-bridge.css it may target Flatsome/WooCommerce/.medi-* markup; values come from tokens.css.
 * The category catalogue panel and quick links stay in style.css (owner's work in progress).
 * Moved out of style.css on 2026-11-27 (rewrite stage 2 in docs/plans/design-system-cleanup-2026-11.md).
 */

/* B2B product listing rows. */
.category-page-row .products .medi-product-row {
    align-items: stretch;
    background: var(--mt-surface);
    display: grid;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.category-page-row .products .medi-product-row:hover {
    border-color: var(--mt-line-strong);
    box-shadow: var(--mt-shadow-raised);
}

.category-page-row .term-description {
    margin-bottom: 14px;
}

.medi-category-description {
    background: var(--mt-surface);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    box-shadow: var(--mt-shadow-low);
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    margin-bottom: 14px;
    padding: 14px 16px;
    position: relative;
}

.medi-category-description__content {
    overflow: hidden;
}

.medi-category-description.is-collapsible:not(.is-expanded) .medi-category-description__content {
    display: -webkit-box;
    margin-bottom: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.medi-category-description.is-collapsible:not(.is-expanded)::after {
    background: linear-gradient(180deg, transparent, var(--mt-surface));
    bottom: 56px;
    content: "";
    height: 36px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.medi-category-description p:last-child {
    margin-bottom: 0;
}

/* the button sits under the fade's lower edge; keep its top border above it */
.medi-category-description__toggle {
    position: relative;
    z-index: 1;
}

.medi-category-description__toggle:hover {
    background: var(--mt-green-soft);
    color: var(--mt-green-deep);
}

/* Product category bottom buying guide. */
.category-page-row .pcbdw-bottom-description-content {
    --medi-guide-green: var(--mt-green-text);
    --medi-guide-green-dark: var(--mt-green-deep);
    --medi-guide-green-soft: var(--mt-green-soft);
    --medi-guide-line: var(--mt-line);
    --medi-guide-text: var(--mt-ink);
    --medi-guide-muted: var(--mt-muted);
    background: var(--mt-surface);
    border: 1px solid var(--medi-guide-line);
    border-radius: var(--mt-radius-card);
    box-shadow: var(--mt-shadow-low);
    color: var(--medi-guide-text);
    font-size: var(--mt-text-15);
    line-height: 1.7;
    margin: 34px 0 16px;
    padding: 30px 32px 32px;
    position: relative;
}

.category-page-row .pcbdw-bottom-description-content::before {
    color: var(--medi-guide-green);
    content: "Poradnik zakupowy";
    display: block;
    font-size: var(--mt-text-min);
    font-weight: 900;
    letter-spacing: .12em;
    line-height: 1;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.category-page-row .pcbdw-bottom-description-content p:first-child:empty {
    display: none;
}

.category-page-row .pcbdw-bottom-description-content br {
    display: none;
}

.category-page-row .pcbdw-bottom-description-content h2,
.category-page-row .pcbdw-bottom-description-content h3,
.category-page-row .pcbdw-bottom-description-content p,
.category-page-row .pcbdw-bottom-description-content table {
    max-width: 980px;
}

.category-page-row .pcbdw-bottom-description-content h2 {
    color: var(--medi-guide-green-dark);
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1.08;
    margin: 0 0 18px;
}

.category-page-row .pcbdw-bottom-description-content h2::after {
    background: linear-gradient(90deg, var(--medi-guide-green), transparent);
    border-radius: var(--mt-radius-pill);
    content: "";
    display: block;
    height: 3px;
    margin-top: 16px;
    width: 148px;
}

.category-page-row .pcbdw-bottom-description-content h3 {
    align-items: center;
    color: var(--medi-guide-green-dark);
    display: flex;
    font-size: var(--mt-text-21);
    font-weight: 900;
    gap: 10px;
    letter-spacing: -.015em;
    line-height: 1.22;
    margin: 28px 0 10px;
}

.category-page-row .pcbdw-bottom-description-content h3::before {
    background: var(--medi-guide-green);
    border-radius: var(--mt-radius-pill);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--mt-green) 10%, transparent);
    content: "";
    flex: 0 0 auto;
    height: 8px;
    width: 8px;
}

.category-page-row .pcbdw-bottom-description-content p {
    margin: 0 0 14px;
}

.category-page-row .pcbdw-bottom-description-content strong {
    color: var(--medi-guide-green-dark);
    font-weight: 900;
}

.category-page-row .pcbdw-bottom-description-content table {
    background: var(--mt-surface);
    border: 1px solid var(--medi-guide-line);
    border-radius: var(--mt-radius-card);
    box-shadow: var(--mt-shadow-raised);
    margin: 18px 0 28px;
    overflow: hidden;
}

.category-page-row .pcbdw-bottom-description-content th,
.category-page-row .pcbdw-bottom-description-content td {
    border: 0;
    border-bottom: 1px solid var(--mt-line);
    color: var(--medi-guide-text);
    font-size: var(--mt-text-14);
    line-height: 1.45;
    padding: 13px 15px;
    vertical-align: top;
}

.category-page-row .pcbdw-bottom-description-content th {
    background: var(--mt-green-soft);
    color: var(--medi-guide-green-dark);
    font-size: var(--mt-text-12);
    font-weight: 900;
    letter-spacing: .06em;
}

.category-page-row .pcbdw-bottom-description-content tr:last-child td {
    border-bottom: 0;
}

.category-page-row .pcbdw-bottom-description-content p:last-child {
    margin-bottom: 0;
}

/* Blog articles - align editorial pages with category buying-guide cards. */

.medi-brand-category-nav {
    background: var(--mt-surface);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    box-shadow: var(--mt-shadow-raised);
    margin: 0 0 20px;
    padding: 18px;
}

.medi-brand-category-nav__header {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 14px;
}

.medi-brand-category-nav__eyebrow {
    color: var(--mt-green);
    font-size: var(--mt-text-min);
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.medi-brand-category-nav__title {
    color: var(--mt-ink);
    font-size: var(--mt-text-21);
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
}

.medi-brand-category-nav__intro {
    color: var(--mt-muted);
    flex-basis: 100%;
    font-size: var(--mt-text-13);
    line-height: 1.4;
    margin: -2px 0 0;
}

.medi-category-filter-search {
    margin: 0 0 14px;
    max-width: 420px;
    position: relative;
}

.medi-category-filter-search:before {
    background: var(--mt-green);
    border-radius: var(--mt-radius-pill);
    content: "";
    height: 2px;
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 58%;
    transform: rotate(45deg) translateY(-50%);
    width: 8px;
    z-index: 1;
}

.medi-category-filter-search:after {
    border: 2px solid var(--mt-green);
    border-radius: var(--mt-radius-pill);
    content: "";
    height: 12px;
    pointer-events: none;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    z-index: 1;
}

.medi-category-filter-search input[type="search"] {
    background: color-mix(in srgb, var(--mt-surface) 92%, transparent);
    border: 1px solid var(--mt-line-strong);
    box-shadow: var(--mt-shadow-raised);
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    font-weight: 600;
    line-height: 42px;
    margin: 0;
    padding: 0 42px 0 16px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.medi-category-filter-search input[type="search"]::placeholder {
    color: var(--mt-muted);
    font-weight: 500;
}

.medi-category-filter-search input[type="search"]:focus {
    border-color: var(--mt-green);
    box-shadow: var(--mt-focus);
    outline: none;
}

.medi-category-filter-empty {
    background: color-mix(in srgb, var(--mt-surface) 78%, transparent);
    border: 1px dashed var(--mt-line-strong);
    border-radius: var(--mt-radius-card);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    margin: 12px 0 0;
    padding: 12px 14px;
}

.medi-brand-category-nav__tree > .medi-brand-category-nav__list {
    column-gap: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.medi-brand-category-nav__list {
    list-style: none;
    margin: 0;
}

.medi-brand-category-nav__list--depth-1 {
    border-left: 1px solid var(--mt-line);
    margin: 8px 0 0 8px;
    padding-left: 10px;
}

.medi-brand-category-nav__list--depth-2,
.medi-brand-category-nav__list--depth-3,
.medi-brand-category-nav__list--depth-4 {
    margin: 6px 0 0 8px;
    padding-left: 8px;
}

.medi-brand-category-nav__item {
    break-inside: avoid;
    margin: 0 0 8px;
    position: relative;
}

.medi-brand-category-nav__link {
    align-items: center;
    background: color-mix(in srgb, var(--mt-surface) 82%, transparent);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    color: var(--mt-green-text);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 10px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.medi-brand-category-nav__link:hover {
    border-color: var(--mt-line-strong);
    box-shadow: var(--mt-shadow-raised);
    color: var(--mt-green-deep);
    transform: translateY(-1px);
}

.medi-brand-category-nav__item.has-children > .medi-brand-category-nav__link {
    font-weight: 900;
    margin-right: 50px;
    min-height: 44px;
}

.medi-brand-category-nav__toggle {
    align-items: center;
    background: var(--mt-surface);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    color: var(--mt-green-text);
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    list-style: none;
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
}

.medi-brand-category-nav__toggle::-webkit-details-marker {
    display: none;
}

.medi-brand-category-nav__toggle:hover {
    background: var(--mt-green-soft);
    border-color: var(--mt-line-strong);
}

.medi-brand-category-nav__toggle:focus-visible {
    outline: 2px solid var(--mt-green-text);
    outline-offset: 2px;
}

.medi-brand-category-nav__toggle::after {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    content: "";
    height: 8px;
    transform: translateY(-2px) rotate(45deg);
    width: 8px;
}

.medi-brand-category-nav [open] > .medi-brand-category-nav__toggle::after {
    transform: translateY(2px) rotate(225deg);
}

.medi-brand-category-nav__item.is-filter-child-match > .medi-brand-category-nav__link {
    background: color-mix(in srgb, var(--mt-green-soft) 92%, transparent);
    border-color: var(--mt-line-strong);
}

.medi-brand-category-nav__name {
    font-size: var(--mt-text-13);
    font-weight: 800;
    line-height: 1.25;
}

.medi-brand-category-nav__list--depth-1 .medi-brand-category-nav__name,
.medi-brand-category-nav__list--depth-2 .medi-brand-category-nav__name,
.medi-brand-category-nav__list--depth-3 .medi-brand-category-nav__name,
.medi-brand-category-nav__list--depth-4 .medi-brand-category-nav__name {
    font-weight: 700;
}

.medi-brand-category-nav__count {
    background: var(--mt-green-soft);
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-pill);
    color: var(--mt-muted);
    flex: 0 0 auto;
    font-size: var(--mt-text-min);
    font-weight: 900;
    line-height: 1;
    min-width: 28px;
    padding: 5px 7px;
    text-align: center;
}

.medi-horizontal-filters {
    background: var(--mt-surface);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    box-shadow: var(--mt-shadow-low);
    margin: 0 0 14px;
    min-height: 302px;
    padding: 14px;
    position: relative;
}

.medi-horizontal-filters.is-collapsed {
    min-height: 60px;
}

.medi-horizontal-filters.is-loading {
    pointer-events: none;
}

.medi-horizontal-filters.is-loading::after {
    background: color-mix(in srgb, var(--mt-surface) 72%, transparent);
    border-radius: var(--mt-radius-card);
    bottom: 0;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 4;
}

.medi-horizontal-filters.is-loading::before {
    animation: mediFiltersSpin .7s linear infinite;
    border: 2px solid var(--mt-line-strong);
    border-top-color: var(--mt-green);
    border-radius: 50%;
    content: "";
    height: 24px;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    position: absolute;
    top: 50%;
    width: 24px;
    z-index: 5;
}

.medi-horizontal-filters__header {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.medi-horizontal-filters.is-collapsed .medi-horizontal-filters__header {
    margin-bottom: 0;
}

.medi-horizontal-filters__toggle {
    align-items: center;
    border: 0;
    display: flex;
    justify-content: space-between;
    line-height: inherit;
    margin: 0;
    min-height: 30px;
    padding: 0;
    text-align: left;
    text-transform: none;
    width: 100%;
}

.medi-horizontal-filters__toggle:hover {
    box-shadow: none;
    color: inherit;
}

.medi-horizontal-filters .medi-horizontal-filters__reset {
    align-items: center;
    border-radius: var(--mt-radius-control);
    display: inline-flex;
    flex: 0 0 auto;
    gap: 5px;
    line-height: 1.2;
    white-space: nowrap;
}

.medi-horizontal-filters .medi-horizontal-filters__reset:hover {
    background: var(--mt-green-soft);
    border-color: var(--mt-line-strong);
}

.medi-horizontal-filters .medi-horizontal-filters__reset:focus-visible,
.medi-horizontal-filters__option:focus-visible {
    outline: 2px solid var(--mt-green-text);
    outline-offset: 1px;
}

.medi-horizontal-filters .medi-horizontal-filters__reset::before {
    background: currentColor;
    clip-path: polygon(43% 1%, 57% 1%, 57% 46%, 72% 46%, 94% 91%, 72% 91%, 65% 76%, 65% 91%, 44% 91%, 44% 76%, 36% 91%, 6% 91%, 28% 46%, 43% 46%);
    flex: 0 0 15px;
    height: 15px;
}

.medi-horizontal-filters__facet-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 4px;
    min-height: 32px;
}

.medi-horizontal-filters__toggle-copy {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}

.medi-horizontal-filters__eyebrow {
    color: var(--mt-green);
    font-size: var(--mt-text-min);
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.medi-horizontal-filters__title {
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 900;
    line-height: 1.2;
}

.medi-horizontal-filters__note {
    color: var(--mt-muted);
    font-size: var(--mt-text-12);
}

.medi-horizontal-filters__toggle-icon {
    align-items: center;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-pill);
    color: var(--mt-green-text);
    display: inline-flex;
    flex: 0 0 auto;
    height: 28px;
    justify-content: center;
    margin-left: 12px;
    width: 28px;
}

.medi-horizontal-filters__toggle-icon::before {
    content: "\2303";
    font-size: var(--mt-text-15);
    font-weight: 900;
    line-height: 1;
    transform: translateY(2px);
}

.medi-horizontal-filters.is-collapsed .medi-horizontal-filters__toggle-icon::before {
    content: "\2304";
    transform: translateY(-2px);
}

.medi-horizontal-filters.is-collapsed .medi-horizontal-filters__note {
    display: none;
}

.medi-horizontal-filters__scroller {
    display: flex;
    overflow-y: hidden;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--mt-line-strong) var(--mt-green-soft);
}

.medi-horizontal-filters.is-collapsed .medi-horizontal-filters__scroller {
    display: none;
}

.medi-horizontal-filters__scroller > .widget {
    margin: 0;
    overflow: hidden;
    scroll-snap-align: start;
}

.medi-horizontal-filters__scroller > .widget .widget-title {
    display: block;
    line-height: 1.25;
}

.medi-horizontal-filters__scroller > .widget .is-divider {
    display: none;
}

.medi-horizontal-filters__scroller > .widget ul,
.medi-horizontal-filters__scroller > .widget .pwb-filter-products {
    max-height: 176px;
    overflow-y: auto;
    scrollbar-color: var(--mt-line-strong) var(--mt-green-soft);
}

.medi-horizontal-filters__scroller .medi-horizontal-filters__facet-heading ~ ul,
.medi-horizontal-filters__scroller .medi-horizontal-filters__facet-heading ~ .pwb-filter-products {
    max-height: 170px;
}

.medi-horizontal-filters__scroller > .widget li {
    border-top: 0;
    font-size: var(--mt-text-12);
    line-height: 1.3;
    margin: 0;
}

.medi-horizontal-filters__scroller > .widget a:hover,
.medi-horizontal-filters__option:hover {
    color: var(--mt-green-text);
}

.medi-horizontal-filters__option::before {
    background: var(--mt-surface);
    border: 1px solid var(--mt-line-strong);
    border-radius: 3px;
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    height: 16px;
    width: 16px;
}

.medi-horizontal-filters__scroller .woocommerce-widget-layered-nav-list__item a:hover::before,
.medi-horizontal-filters__scroller .wc-layered-nav-term a:hover::before,
.medi-horizontal-filters__option:hover::before {
    border-color: var(--mt-green-text);
}

.medi-horizontal-filters__scroller .widget_layered_nav_filters a::before,
.medi-horizontal-filters__scroller .chosen a[aria-label*="Usuń"]::before {
    border-radius: 50%;
    font-size: var(--mt-text-14);
}

.medi-horizontal-filters__option--disabled {
    color: var(--mt-disabled);
    cursor: not-allowed;
    opacity: .82;
}

.medi-horizontal-filters__option--disabled::before {
    background: var(--mt-bg);
    border-color: var(--mt-line-strong);
}

.medi-horizontal-filters__scroller .is-disabled .count {
    color: var(--mt-disabled);
}

.medi-horizontal-filters__scroller > .widget input[type="checkbox"] {
    accent-color: var(--mt-green-text);
}

.medi-product-row__image {
    align-self: stretch;
    display: flex;
}

.medi-product-row__image .box-image {
    align-items: center;
    background: var(--mt-surface);
    border-radius: var(--mt-radius-control);
    display: flex;
    justify-content: center;
    width: 100%;
}

.medi-product-row__image img {
    object-fit: contain;
    width: auto;
}

.medi-product-row__image .back-image,
.medi-product-row__image .show-on-hover {
    display: none !important;
}

.medi-product-row__body {
    min-width: 0;
    padding-top: 2px;
}

.medi-product-row__body .badge-container {
    display: none;
}

.medi-product-row__title {
    color: var(--mt-green-text);
    display: block;
    line-height: 1.35;
}

.medi-product-row__title:hover {
    color: var(--mt-green);
}

.medi-product-row__meta {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.medi-product-row__meta li {
    color: var(--mt-muted);
    line-height: 1.3;
}

.medi-product-row__meta-label {
    color: var(--mt-muted);
}

.medi-product-row__meta-value {
    color: var(--mt-ink);
    font-weight: 700;
}

.medi-product-row__meta-value a,
.medi-product-row__meta a {
    color: var(--mt-green-text);
}

.medi-product-row__specs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.medi-product-row__spec {
    grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
}

.medi-product-row__spec dt {
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medi-product-row__spec dd {
    line-height: 1.25;
    text-overflow: ellipsis;
}

@media only screen and (max-width: 848px) {
.medi-product-row__image {
        align-self: start;
        display: block;
    }
}

.medi-product-row__buy {
    align-self: stretch;
    display: grid;
    padding-top: 2px;
    text-align: left;
}

.medi-product-row__price-slot .price {
    align-self: start;
    color: var(--mt-ink);
    display: block;
    font-size: var(--mt-text-21);
    font-weight: 800;
    line-height: 1.15;
}

.medi-product-row__price-slot .price .woocommerce-Price-amount {
    font-weight: 800;
}

.medi-product-row__stock {
    align-self: start;
    line-height: 1.15;
    margin: 0;
    min-height: 18px;
}

.medi-product-row__availability {
    align-items: center;
    font-size: var(--mt-text-12);
    line-height: 1.2;
    overflow: hidden;
}

.medi-product-row__availability-chip {
    display: inline-flex;
    line-height: 1.1;
    min-width: 0;
    white-space: nowrap;
}

.medi-product-row__cta {
    padding-top: 8px;
}

.medi-product-row__buy .delivery-shipping-date-info,
.medi-product-row__buy .czas-realizacji-delivery-day {
    color: var(--mt-status-confirm);
    display: block;
    font-size: var(--mt-text-12);
    line-height: 1.25;
    margin: 3px 0;
}

.woocommerce-pagination {
    margin: 24px 0 8px;
}

.woocommerce-pagination.is-loading-more {
    opacity: .65;
    pointer-events: none;
}

.woocommerce-pagination.is-loading-more::after {
    animation: medi-search-loading 900ms ease-in-out infinite;
    background: linear-gradient(90deg, transparent, var(--mt-green), transparent);
    content: "";
    display: block;
    height: 3px;
    margin: 14px auto 0;
    max-width: 220px;
    border-radius: var(--mt-radius-pill);
}

.woocommerce-pagination .page-numbers.nav-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.woocommerce-pagination .page-number {
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    color: var(--mt-green-text);
    min-width: 38px;
}

.woocommerce-pagination .page-number.current,
.woocommerce-pagination .page-number:hover {
    background: var(--mt-green-text);
    border-color: var(--mt-green-text);
    color: var(--mt-surface);
}

@media (max-width: 549px) {
.woocommerce-pagination .page-numbers.nav-pagination {
        gap: 4px;
    }

.woocommerce-pagination .page-numbers.nav-pagination > li {
        display: none;
        margin: 0;
    }

.woocommerce-pagination .page-numbers.nav-pagination > li:first-child,
    .woocommerce-pagination .page-numbers.nav-pagination > li:nth-child(2),
    .woocommerce-pagination .page-numbers.nav-pagination > li:last-child,
    .woocommerce-pagination .page-numbers.nav-pagination > li:nth-last-child(2),
    .woocommerce-pagination .page-numbers.nav-pagination > li:has(.current),
    .woocommerce-pagination .page-numbers.nav-pagination > li:has(.current) + li,
    .woocommerce-pagination .page-numbers.nav-pagination > li:has(+ li .current),
    .woocommerce-pagination .page-numbers.nav-pagination > li:has(.dots) {
        display: block;
    }

.woocommerce-pagination .page-number {
        min-width: 36px;
        height: 40px;
        line-height: 38px;
    }
}

@media only screen and (max-width: 64em) {
.medi-brand-category-nav__tree > .medi-brand-category-nav__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 48em) {
.category-page-row .products .medi-product-row {
        align-items: start;
    }

.category-page-row .products .medi-product-row:hover {
        box-shadow: var(--mt-shadow-low);
    }

.medi-category-description {
        font-size: var(--mt-text-13);
        line-height: 1.55;
        margin: 0 0 12px;
        padding: 12px 14px;
    }

.medi-category-description.is-collapsible:not(.is-expanded) .medi-category-description__content {
        margin-bottom: 12px;
    }

.medi-category-description.is-collapsible:not(.is-expanded)::after {
        bottom: 52px;
        height: 32px;
    }

.medi-brand-category-nav {
        border-radius: var(--mt-radius-card);
        margin: 0 0 12px;
        padding: 14px;
    }

.medi-brand-category-nav__header {
        display: block;
        margin-bottom: 12px;
    }

.medi-brand-category-nav__title {
        font-size: var(--mt-text-18);
        margin-top: 4px;
    }

.medi-brand-category-nav__intro {
        font-size: var(--mt-text-12);
        margin-top: 6px;
    }

.medi-category-filter-search {
        max-width: none;
    }

.medi-category-filter-search input[type="search"] {
        font-size: var(--mt-text-13);
        line-height: 40px;
    }

.medi-brand-category-nav__tree > .medi-brand-category-nav__list {
        display: block;
    }

.medi-brand-category-nav__link {
        min-height: 40px;
        padding: 9px 10px;
    }

.medi-brand-category-nav__name {
        font-size: var(--mt-text-12);
    }

.medi-brand-category-nav__list--depth-1,
    .medi-brand-category-nav__list--depth-2,
    .medi-brand-category-nav__list--depth-3,
    .medi-brand-category-nav__list--depth-4 {
        margin-left: 6px;
        padding-left: 8px;
    }

.medi-product-row__specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.medi-product-row__spec dd {
        -webkit-box-orient: vertical;
    }

.medi-product-row__availability {
        overflow: visible;
    }

.category-page-row .pcbdw-bottom-description-content {
        border-radius: var(--mt-radius-card);
        font-size: var(--mt-text-14);
        line-height: 1.62;
        margin: 22px 0 12px;
        padding: 20px 18px 22px;
    }

.category-page-row .pcbdw-bottom-description-content::before {
        font-size: var(--mt-text-min);
        margin-bottom: 10px;
    }

.category-page-row .pcbdw-bottom-description-content h2 {
        font-size: var(--mt-text-h2);
        line-height: 1.12;
        margin-bottom: 14px;
    }

.category-page-row .pcbdw-bottom-description-content h2::after {
        margin-top: 13px;
        width: 112px;
    }

.category-page-row .pcbdw-bottom-description-content h3 {
        font-size: var(--mt-text-18);
        gap: 9px;
        margin: 24px 0 9px;
    }

.category-page-row .pcbdw-bottom-description-content p {
        margin-bottom: 12px;
    }

.category-page-row .pcbdw-bottom-description-content table {
        display: block;
        margin: 15px 0 22px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

.category-page-row .pcbdw-bottom-description-content th,
    .category-page-row .pcbdw-bottom-description-content td {
        font-size: var(--mt-text-13);
        min-width: 180px;
        padding: 11px 12px;
    }
}

.medi-horizontal-filters__count {
    margin-left: 6px;
    color: var(--mt-muted);
    font-size: var(--mt-text-15);
    font-weight: 700;
    white-space: nowrap;
}

/* Category copy: readable measure (~80 characters of Lato) for the intro and the guide. */
.medi-category-description__content,
.category-page-row .pcbdw-bottom-description-content p,
.category-page-row .pcbdw-bottom-description-content li {
    max-width: 66ch;
}

.medi-category-filter-search--quick-links input::placeholder {
    color: var(--mt-muted);
}

/* ---------- Quick preview on the row photo (assets/js/medi-quick-view.js; owner request
   2026-11-28, Allegro pattern in the mt look): one card over the row — the photo on the
   neutral tile with the other photos under it, then producer, name, codes, net-first price,
   availability, quantity + "Dodaj do koszyka". Desktop pointers only. ---------- */
html body .medi-quick {
    position: absolute;
    z-index: 60;
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: var(--mt-space-5);
    width: min(780px, calc(100vw - 24px));
    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-raised);
    color: var(--mt-ink);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .14s ease-out, transform .18s cubic-bezier(.2, .7, .2, 1);
}

html body .medi-quick.is-open {
    opacity: 1;
    transform: none;
}

html body .medi-quick[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    html body .medi-quick {
        transform: none;
        transition: opacity .1s linear;
    }
}

html body .medi-quick__media {
    display: flex;
    flex-direction: column;
    gap: var(--mt-space-2);
    min-width: 0;
}

html body .medi-quick__photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 320px;
    padding: var(--mt-space-4);
    border-radius: var(--mt-radius-card);
    background: var(--mt-bg);
}

html body .medi-quick__photo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

html body .medi-quick__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2);
}

html body .medi-quick__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-height: 0;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
    cursor: pointer;
}

html body .medi-quick__thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

html body .medi-quick__thumb:hover,
html body .medi-quick__thumb.is-active {
    border-color: var(--mt-green-text);
    box-shadow: inset 0 0 0 1px var(--mt-green-text);
}

html body .medi-quick__thumb:focus-visible,
html body .medi-quick__title:focus-visible {
    outline: 2px solid var(--mt-green-text);
    outline-offset: 2px;
}

html body .medi-quick__info {
    display: flex;
    flex-direction: column;
    gap: var(--mt-space-3);
    min-width: 0;
}

html body .medi-quick__title {
    color: var(--mt-ink);
    font-size: var(--mt-text-17);
    font-weight: 700;
    line-height: 1.3;
    text-wrap: pretty;
}

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

html body .medi-quick__meta {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

html body .medi-quick__meta li {
    margin: 0;
}

html body .medi-quick__meta .medi-product-row__meta-value {
    color: var(--mt-ink);
    font-weight: 700;
}

html body .medi-quick__meta a {
    color: var(--mt-green-text);
}

html body .medi-quick__price .price,
html body .medi-quick__price {
    color: var(--mt-ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

html body .medi-quick__price .medi-price__net {
    font-size: var(--mt-text-28);
    font-weight: 700;
}

html body .medi-quick__price .medi-price__gross {
    display: block;
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
}

html body .medi-quick__stock {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-1) var(--mt-space-3);
    align-items: baseline;
    margin: 0;
    font-size: var(--mt-text-15);
    font-weight: 700;
}

html body .medi-quick__stock.is-available {
    color: var(--mt-green-text);
}

html body .medi-quick__stock.is-confirm {
    color: var(--mt-status-confirm);
}

/* "Do potwierdzenia" in the preview: the product page's inquiry block (status, how to ask,
   e-mail with the code filled in, phone) so the preview gives the next step, not a dead end. */
html body .medi-quick__ask {
    padding: var(--mt-space-3) var(--mt-space-4);
    border: 1px solid var(--mt-status-confirm-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-status-confirm-bg);
}

html body .medi-quick__ask .medi-quick__stock {
    margin-bottom: var(--mt-space-1);
}

html body .medi-quick__ask-text {
    margin: 0 0 var(--mt-space-3);
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    line-height: 1.5;
}

html body .medi-quick__ask-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2) var(--mt-space-4);
    align-items: center;
}

html body .medi-quick__ask-mail {
    min-height: var(--mt-control-h);
    margin: 0;
}

html body .medi-quick__ask-phone {
    color: var(--mt-green-text);
    font-size: var(--mt-text-17);
    font-weight: 700;
    white-space: nowrap;
}

html body .medi-quick__ask-phone:focus-visible {
    outline: 2px solid var(--mt-green-text);
    outline-offset: 3px;
}

html body .medi-quick__ask-meta {
    margin: var(--mt-space-2) 0 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

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

html body .medi-quick__buy {
    margin-top: auto;
    padding-top: var(--mt-space-3);
    border-top: 1px solid var(--mt-line);
}

html body .medi-quick__form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2);
    align-items: center;
    margin: 0;
}

/* the mini-cart's stepper, under its own names (medi-mini-cart.js listens to .medi-qty__*) */
html body .medi-quick__qty {
    display: inline-flex;
    flex: none;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
}

html body .medi-quick__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mt-control-h);
    height: var(--mt-control-h);
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--mt-radius-control);
    background: transparent;
    color: var(--mt-green-text);
    font-size: var(--mt-text-18);
    font-weight: 600;
    line-height: 1;
}

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

html body .medi-quick__step:disabled {
    color: var(--mt-disabled);
}

html body .medi-quick__qty input[type="number"] {
    width: 52px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--mt-line);
    border-left: 1px solid var(--mt-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--mt-ink);
    font-size: var(--mt-text-input);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

html body .medi-quick__qty input::-webkit-inner-spin-button,
html body .medi-quick__qty input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

html body .medi-quick__step:focus-visible,
html body .medi-quick__qty input:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    box-shadow: var(--mt-focus);
}

html body .medi-quick__add,
html body .medi-quick__go {
    flex: 1 1 180px;
    min-height: var(--mt-control-h);
    margin: 0;
}

html body .medi-quick__go {
    width: 100%;
}

html body .medi-quick__add.is-done {
    background: var(--mt-green-deep);
}

html body .medi-quick__note {
    flex-basis: 100%;
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

html body .medi-quick__error {
    margin: var(--mt-space-2) 0 0;
    color: var(--mt-danger);
    font-size: var(--mt-text-14);
}

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

/* the row photo says it opens a preview */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html body .medi-product-row[data-medi-quick] .medi-product-row__image {
        cursor: zoom-in;
    }
}

/* ---------- Listing views: switch + "Kafle" (owner request 2026-11-28, TME pattern) ----------
   Same HTML as the rows; html[data-medi-view="grid"] (set in <head>, functions.php) turns the
   list into a grid of cards. One URL for every view, so nothing changes for search engines. */
html body .medi-view-switch {
    display: flex;
    gap: var(--mt-space-1);
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 var(--mt-space-3);
}

html body .medi-view-switch__label {
    margin-right: var(--mt-space-1);
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
}

html body .medi-view-switch__btn {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: var(--mt-control-h-sm);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}

html body .medi-view-switch__btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html body .medi-view-switch__btn:hover {
    border-color: var(--mt-line-strong);
    background: var(--mt-green-soft);
}

html body .medi-view-switch__btn[aria-pressed="true"] {
    border-color: var(--mt-green-text);
    background: var(--mt-green-soft);
    color: var(--mt-green-text);
    font-weight: 700;
}

html body .medi-view-switch__btn:focus-visible {
    outline: 0;
    box-shadow: var(--mt-focus);
}

/* the grid: cards of at least 232px (5 at 1440, 4 at 1024, 3 at 768, 2 on phones) */
html[data-medi-view="grid"] body .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: var(--mt-space-3);
    margin: 0;
}

html[data-medi-view="grid"] body .products::before,
html[data-medi-view="grid"] body .products::after {
    content: none;
}

html[data-medi-view="grid"] body .category-page-row .products .medi-product-row,
html[data-medi-view="grid"] body .products .medi-product-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    gap: var(--mt-space-3);
    width: auto;
    max-width: none;
    flex: none;
    margin: 0;
    padding: var(--mt-space-3) !important; /* the row rule uses !important */
}

html[data-medi-view="grid"] body .medi-product-row__image {
    display: block;
}

html[data-medi-view="grid"] body .medi-product-row__image .box-image {
    height: 168px;
    padding: var(--mt-space-3);
    border-radius: var(--mt-radius-control);
    background: var(--mt-bg);
}

html[data-medi-view="grid"] body .medi-product-row__image img {
    max-height: 144px;
    mix-blend-mode: multiply;
}

html[data-medi-view="grid"] body .medi-product-row__title {
    display: -webkit-box;
    min-height: calc(3 * 1.35em); /* same height on every card, so the prices line up */
    overflow: hidden;
    font-size: var(--mt-text-14);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

html[data-medi-view="grid"] body .medi-product-row__meta {
    display: grid;
    gap: 2px;
    margin: 0 0 6px;
}

html[data-medi-view="grid"] body .medi-product-row__meta li {
    overflow: hidden;
    font-size: var(--mt-text-12);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* three parameters on a card; the rest stays in the row, the table and the product page */
html[data-medi-view="grid"] body .medi-product-row__specs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 2px;
    min-height: calc(3 * var(--mt-text-12) * 1.5 + 4px); /* three lines on every card */
}

html[data-medi-view="grid"] body .medi-product-row__spec {
    display: flex;
    min-width: 0;
}

html[data-medi-view="grid"] body .medi-product-row__spec:nth-child(n+4) {
    display: none;
}

html[data-medi-view="grid"] body .medi-product-row__spec dt,
html[data-medi-view="grid"] body .medi-product-row__spec dd {
    font-size: var(--mt-text-12);
}

html[data-medi-view="grid"] body .medi-product-row__spec dd {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* buy block at the bottom of every card, so prices line up across a row of cards */
html[data-medi-view="grid"] body .medi-product-row__buy {
    grid-template-columns: minmax(0, 1fr);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: stretch;
    padding: var(--mt-space-3) 0 0;
    border-top: 1px solid var(--mt-line);
    border-left: 0;
}

html[data-medi-view="grid"] body .medi-product-row__price-slot,
html[data-medi-view="grid"] body .medi-product-row__stock,
html[data-medi-view="grid"] body .medi-product-row__availability {
    align-self: flex-start;
    justify-content: flex-start;
    text-align: left;
}

html[data-medi-view="grid"] body .medi-product-row__price-slot .price,
html[data-medi-view="grid"] body .medi-product-row__price-slot .medi-price {
    align-items: flex-start;
    text-align: left;
}

html[data-medi-view="grid"] body .medi-product-row__price-slot .price {
    font-size: var(--mt-text-18);
}

html[data-medi-view="grid"] body .medi-product-row__cta {
    align-self: stretch;
    margin-top: auto; /* the button sits at the bottom of every card */
}

@media (max-width: 548px) {
    html[data-medi-view="grid"] body .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--mt-space-2);
    }

    html[data-medi-view="grid"] body .category-page-row .products .medi-product-row,
    html[data-medi-view="grid"] body .products .medi-product-row {
        gap: var(--mt-space-2);
        padding: var(--mt-space-2) !important;
    }

    html[data-medi-view="grid"] body .medi-product-row__image .box-image {
        height: 128px;
        padding: var(--mt-space-2);
    }

    html[data-medi-view="grid"] body .medi-product-row__image img {
        max-height: 112px;
    }

    html[data-medi-view="grid"] body .medi-product-row__title {
        font-size: var(--mt-text-13);
    }

    html[data-medi-view="grid"] body .medi-product-row__spec:nth-child(n+3) {
        display: none;
    }

    html[data-medi-view="grid"] body .medi-product-row__specs {
        min-height: calc(2 * var(--mt-text-12) * 1.5 + 2px);
    }

    html[data-medi-view="grid"] body .medi-product-row__price-slot .price {
        font-size: var(--mt-text-15);
    }

    html body .medi-view-switch__label {
        display: none;
    }
}


/* ---------- "Tabela" view (owner request 2026-11-28, TME pattern) ----------
   One line per product: photo | name, code, producer | the category's parameters (from
   functions.php: the same columns for the whole category, --medi-cols of them) | net price |
   availability | cart. 1024px and wider; narrower screens keep the list. The column heads
   (.medi-table-head) sit above the list and stick under the header while it scrolls. */
html body .medi-product-row__cols,
html body .medi-table-head,
html body .medi-view-switch__btn--table {
    display: none;
}

@media (min-width: 1024px) {
    html body .medi-view-switch__btn--table {
        display: inline-flex;
    }

    /* the table grid lives on the list column, which is a size container: the number of
       parameter columns follows the room beside the rail (--medi-cols-cN from functions.php:
       the category's columns, at most N) */
    html body .medi-listing__main {
        container: medi-listing / inline-size;
    }

    html[data-medi-view="table"] body .medi-listing__main {
        --medi-n: var(--medi-cols-c1, 1);
    }

    html[data-medi-view="table"] body .medi-table-head {
        position: sticky;
        top: 95px; /* under the stuck header */
        z-index: 5;
        display: grid;
        grid-template-columns: 56px minmax(180px, 2.4fr) repeat(var(--medi-n), minmax(72px, 1fr)) 112px 156px 96px 44px;
        gap: 0 var(--mt-space-3);
        align-items: end;
        margin: 0;
        padding: 10px 13px 8px;
        border: 1px solid var(--mt-line);
        border-bottom-color: var(--mt-line-strong);
        border-radius: var(--mt-radius-card) var(--mt-radius-card) 0 0;
        background: var(--mt-surface);
        color: var(--mt-muted);
        font-size: var(--mt-text-13);
        font-weight: 700;
        line-height: 1.25;
    }

    html[data-medi-view="table"] body .medi-table-head__num {
        text-align: right;
    }

    /* the list becomes the table body: one white card, rows on hairlines */
    html[data-medi-view="table"] body .products {
        display: block;
        margin: 0;
        border: 1px solid var(--mt-line);
        border-top: 0;
        border-radius: 0 0 var(--mt-radius-card) var(--mt-radius-card);
        background: var(--mt-surface);
        box-shadow: var(--mt-shadow-low);
        overflow: hidden;
    }

    html[data-medi-view="table"] body .products::before,
    html[data-medi-view="table"] body .products::after {
        content: none;
    }

    html[data-medi-view="table"] body .category-page-row .products .medi-product-row,
    html[data-medi-view="table"] body .products .medi-product-row {
        grid-template-columns: 56px minmax(180px, 2.4fr) repeat(var(--medi-n), minmax(72px, 1fr)) 112px 156px 96px 44px;
        gap: 0 var(--mt-space-3);
        align-items: center;
        width: auto;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 8px 12px !important; /* the row rule uses !important */
        border: 0;
        border-bottom: 1px solid var(--mt-line);
        border-radius: 0;
        box-shadow: none;
        font-variant-numeric: tabular-nums;
    }

    html[data-medi-view="table"] body .category-page-row .products .medi-product-row:hover,
    html[data-medi-view="table"] body .products .medi-product-row:hover {
        border-color: var(--mt-line);
        background: var(--mt-green-soft);
        box-shadow: none;
    }

    html[data-medi-view="table"] body .products .medi-product-row:last-child {
        border-bottom: 0;
    }

    html[data-medi-view="table"] body .medi-product-row__image,
    html[data-medi-view="table"] body .medi-product-row__body,
    html[data-medi-view="table"] body .medi-product-row__cell,
    html[data-medi-view="table"] body .medi-product-row__price-slot,
    html[data-medi-view="table"] body .medi-product-row__cta {
        grid-row: 1 / span 2;
    }

    html[data-medi-view="table"] body .medi-product-row__image .box-image {
        height: 56px;
        padding: 3px;
        border-radius: var(--mt-radius-control);
        background: var(--mt-bg);
    }

    html[data-medi-view="table"] body .medi-product-row__image img {
        max-height: 50px;
        mix-blend-mode: multiply;
    }

    html[data-medi-view="table"] body .medi-product-row__body {
        padding: 0;
    }

    html[data-medi-view="table"] body .medi-product-row__title {
        display: -webkit-box;
        margin: 0 0 2px;
        overflow: hidden;
        font-size: var(--mt-text-14);
        line-height: 1.3;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html[data-medi-view="table"] body .medi-product-row__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0 12px;
        margin: 0;
    }

    html[data-medi-view="table"] body .medi-product-row__meta li {
        font-size: var(--mt-text-12);
    }

    /* the parameters are the columns now */
    html[data-medi-view="table"] body .medi-product-row__specs {
        display: none;
    }

    html[data-medi-view="table"] body .medi-product-row__cols,
    html[data-medi-view="table"] body .medi-product-row__buy {
        display: contents;
    }

    html[data-medi-view="table"] body .medi-product-row__cell {
        display: -webkit-box;
        min-width: 0;
        overflow: hidden;
        color: var(--mt-ink);
        font-size: var(--mt-text-13);
        font-weight: 700;
        line-height: 1.3;
        overflow-wrap: anywhere;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html[data-medi-view="table"] body .medi-product-row__cell-empty {
        color: var(--mt-disabled);
        font-weight: 400;
    }

    /* buy columns: price | availability (status over channels) | quantity | cart */
    html[data-medi-view="table"] body .medi-product-row__price-slot {
        grid-column: -5;
        justify-self: end;
        text-align: right;
    }

    html[data-medi-view="table"] body .medi-product-row__price-slot .price {
        font-size: var(--mt-text-15);
    }

    html[data-medi-view="table"] body .medi-product-row__price-slot .medi-price {
        align-items: flex-end;
    }

    html[data-medi-view="table"] body .medi-product-row__stock {
        grid-column: -4;
        grid-row: 1;
        align-self: end;
        font-size: var(--mt-text-13);
    }

    html[data-medi-view="table"] body .medi-product-row__availability {
        grid-column: -4;
        grid-row: 2;
        align-self: start;
    }

    html[data-medi-view="table"] body .medi-product-row__stock--empty,
    html[data-medi-view="table"] body .medi-product-row__availability--empty {
        display: none;
    }

    /* the cart button as a 44px icon (its accessible name stays "Dodaj do koszyka: …") */
    html[data-medi-view="table"] body .medi-product-row__cta {
        grid-column: -2;
        align-self: center;
        padding: 0;
    }

    html[data-medi-view="table"] body .medi-product-row__buy .button,
    html[data-medi-view="table"] body .medi-product-row__buy .add_to_cart_button {
        position: relative;
        width: var(--mt-control-h);
        min-width: 0;
        height: var(--mt-control-h);
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        color: transparent !important;
        text-indent: 200%; /* the words stay the accessible name; no 0px text (design-lint) */
        white-space: nowrap;
    }

    html[data-medi-view="table"] body .medi-product-row__buy .button::before {
        content: "";
        position: absolute;
        inset: 0;
        margin: auto;
        width: 20px;
        height: 20px;
        background: var(--mt-surface);
        -webkit-mask: var(--mt-icon-cart) center / contain no-repeat;
        mask: var(--mt-icon-cart) center / contain no-repeat;
    }

    /* "Zobacz produkt" (no buy button): an arrow, outline */
    html[data-medi-view="table"] body .medi-product-row__buy .button:not(.add_to_cart_button) {
        border: 1px solid var(--mt-green-text);
        background: var(--mt-surface);
    }

    html[data-medi-view="table"] body .medi-product-row__buy .button:not(.add_to_cart_button)::before {
        background: var(--mt-green-text);
        -webkit-mask-image: var(--mt-icon-arrow-right);
        mask-image: var(--mt-icon-arrow-right);
    }

    html[data-medi-view="table"] body .woocommerce-pagination {
        margin-top: var(--mt-space-5);
    }
}

/* Flatsome's row gutters (-10px, ".container .row:not(.row-collapse)") pulled the grid and the
   table past the content edges; both start at the edge of the filters and the column heads */
html[data-medi-view="grid"] body .shop-container .products.row,
html[data-medi-view="table"] body .shop-container .products.row {
    margin-right: 0;
    margin-left: 0;
}

@media (min-width: 1024px) {
    /* code and producer on one line under the name */
    html[data-medi-view="table"] body .medi-product-row__meta li {
        flex: 0 1 auto;
        width: auto;
        white-space: nowrap;
    }

    /* no "Sklep / Dostawca" line: the status sits in the middle of the row */
    html[data-medi-view="table"] body .medi-product-row:not(:has(.medi-product-row__availability:not(.medi-product-row__availability--empty))) .medi-product-row__stock {
        grid-row: 1 / span 2;
        align-self: center;
    }
}

@media (min-width: 1024px) {
    /* after adding: WooCommerce's "Zobacz koszyk" link does not fit the cart cell (the header
       cart shows the change); the icon turns into a tick instead */
    html[data-medi-view="table"] body .medi-product-row__cta .added_to_cart {
        display: none;
    }

    html[data-medi-view="table"] body .medi-product-row__buy .add_to_cart_button.added::before {
        -webkit-mask-image: var(--mt-icon-check);
        mask-image: var(--mt-icon-check);
    }

    html[data-medi-view="table"] body .medi-product-row__buy .add_to_cart_button.loading::before {
        opacity: .4;
    }

    html[data-medi-view="table"] body .medi-product-row__buy .add_to_cart_button::after {
        display: none; /* Flatsome's spinner / tick glyphs */
    }
}

/* ---------- Catalogue with a left rail (owner decision 2026-11-28; functions.php
   meditronik_open_listing_layout): [rail 272px | products]. The rail is one quiet panel —
   catalogue buttons, the subcategories as a list, the filters as stacked groups — on hairlines,
   no cards inside; it sticks under the header and scrolls on its own. In the "Tabela" view the
   number of parameter columns follows the room beside it. Below 1024px the rail turns into the
   "Filtry" sheet (further down). ---------- */
@media (min-width: 1024px) {
    html body .medi-listing {
        display: grid;
        grid-template-columns: 272px minmax(0, 1fr);
        gap: var(--mt-space-5);
        align-items: start;
    }

    html body .medi-listing__main {
        min-width: 0;
    }

    html body .medi-listing__rail {
        position: sticky;
        top: 111px; /* the stuck header (95px) + 16px */
        max-height: calc(100vh - 127px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--mt-space-4);
        border: 1px solid var(--mt-line);
        border-radius: var(--mt-radius-card);
        background: var(--mt-surface);
        box-shadow: var(--mt-shadow-low);
        scrollbar-color: var(--mt-line-strong) transparent;
        scrollbar-width: thin;
    }

    /* catalogue buttons: one row at the top */
    html body .medi-listing__rail .medi-catalog-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: var(--mt-space-2);
        margin: 0 0 var(--mt-space-4);
    }

    /* subcategories: a list, the current one tinted */
    html body .medi-listing__rail .medi-category-quick-links,
    html body .medi-listing__rail .medi-brand-category-nav {
        margin: 0;
        padding: var(--mt-space-4) 0;
        border: 0;
        border-top: 1px solid var(--mt-line);
        border-radius: 0;
        background: none;
        box-shadow: none;
        overflow: visible;
    }

    html body .medi-listing__rail .medi-category-quick-links__intro {
        display: block;
        margin: 0 0 var(--mt-space-2);
        padding: 0;
    }

    html body .medi-listing__rail .medi-category-quick-links__title {
        color: var(--mt-ink);
        font-size: var(--mt-text-15);
        font-weight: 700;
    }

    html body .medi-listing__rail .medi-category-quick-links__note,
    html body .medi-listing__rail .medi-category-quick-links__desc,
    html body .medi-listing__rail .medi-category-quick-links__badge {
        display: none;
    }

    html body .medi-listing__rail .medi-category-quick-links__parent {
        margin: 0 0 var(--mt-space-1);
    }

    html body .medi-listing__rail .medi-category-quick-links__parent a {
        display: flex;
        min-height: var(--mt-control-h-sm);
        padding: 0 var(--mt-space-2);
        color: var(--mt-green-text);
        font-size: var(--mt-text-14);
        font-weight: 700;
    }

    html body .medi-listing__rail .medi-category-quick-links__list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    html body .medi-listing__rail .medi-category-quick-links__item a,
    html body .medi-listing__rail .medi-category-quick-links__card {
        display: flex;
        min-height: var(--mt-control-h-sm);
        padding: 6px var(--mt-space-2);
        border: 0;
        border-radius: var(--mt-radius-control);
        background: none;
        box-shadow: none;
        color: var(--mt-ink);
        font-size: var(--mt-text-14);
        font-weight: 400;
        line-height: 1.3;
        transform: none;
    }

    html body .medi-listing__rail .medi-category-quick-links__item a::after {
        content: none;
    }

    html body .medi-listing__rail .medi-category-quick-links__item a:hover {
        background: var(--mt-green-soft);
        color: var(--mt-green-text);
    }

    html body .medi-listing__rail .medi-category-quick-links__item--current .medi-category-quick-links__card {
        background: var(--mt-green-soft);
        color: var(--mt-green-text);
        font-weight: 700;
    }

    html body .medi-listing__rail .medi-category-filter-search {
        display: block;
        margin: 0 0 var(--mt-space-2);
    }

    /* filters: stacked groups instead of side-scrolling columns */
    html body .medi-listing__rail .medi-horizontal-filters {
        min-height: 0;
        margin: 0;
        padding: var(--mt-space-4) 0 0;
        border: 0;
        border-top: 1px solid var(--mt-line);
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    html body .medi-listing__rail .medi-horizontal-filters__note {
        display: none;
    }

    html body .medi-listing__rail .medi-horizontal-filters__title {
        font-size: var(--mt-text-15);
    }

    html body .medi-listing__rail .medi-horizontal-filters__scroller {
        display: block;
        overflow: visible;
        padding: 0;
    }

    html body .medi-listing__rail .medi-horizontal-filters.is-collapsed .medi-horizontal-filters__scroller {
        display: none;
    }

    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget,
    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget + .widget {
        flex: none;
        width: auto;
        padding: var(--mt-space-3) 0;
        border: 0;
        border-top: 1px solid var(--mt-line);
    }

    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget:first-child {
        border-top: 0;
        padding-top: 0;
    }

    /* long value lists scroll inside their group */
    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget ul,
    html body .medi-listing__rail .medi-horizontal-filters__scroller .pwb-filter-products {
        max-height: 212px;
    }

    /* the list column: rows a little tighter (the image column stays) */
    html body .medi-listing__main .medi-view-switch {
        margin-top: 0;
    }
}

@media (min-width: 1024px) {
    /* "Katalog kategorii" as the rail's button, "Poziom wyżej" as a text link beside it */
    html body .medi-listing__rail .medi-catalog-toolbar {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }

    html body .medi-listing__rail .medi-catalog-toolbar__parent-link {
        display: inline-flex;
        align-items: center;
        height: var(--mt-control-h-sm);
        padding: 0 var(--mt-space-1);
        border: 0;
        background: none;
        box-shadow: none;
        color: var(--mt-green-text);
        font-size: var(--mt-text-14);
        font-weight: 700;
        white-space: nowrap;
        text-decoration: underline;
        text-decoration-color: var(--mt-line-strong);
        text-underline-offset: 3px;
    }

    html body .medi-listing__rail .medi-horizontal-filters__count {
        display: block;
        margin: 2px 0 0;
        padding: 0;
        color: var(--mt-muted);
        font-size: var(--mt-text-13);
        font-weight: 400;
    }
}

@media (min-width: 1024px) {
    html body .medi-listing__rail .medi-catalog-trigger {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget,
    html body .medi-listing__rail .medi-horizontal-filters__scroller > .widget ul {
        min-height: 0;
        height: auto;
    }
}

@media (min-width: 1024px) {
    html body .medi-listing__rail .medi-catalog-toolbar {
        flex-wrap: wrap;
        justify-content: flex-start;
        column-gap: var(--mt-space-3);
    }

    /* the subcategory list already offers "← Wróć do …" */
    html body .medi-listing__rail:has(.medi-category-quick-links__parent) .medi-catalog-toolbar__parent-link {
        display: none;
    }

    /* the stock filter nests a widget in a widget: no second margin */
    html body .medi-listing__rail .widget .widget {
        margin: 0;
        padding: 0;
        border: 0;
    }
}

@media (min-width: 1024px) {
    /* with filters on: title and toggle on one line, "Wyczyść wszystkie filtry" under them */
    html body .medi-listing__rail .medi-horizontal-filters__header {
        flex-wrap: wrap;
        gap: var(--mt-space-1) var(--mt-space-3);
    }

    html body .medi-listing__rail .medi-horizontal-filters__toggle {
        flex: 1 1 100%;
    }

    html body .medi-listing__rail .medi-horizontal-filters__header > .medi-horizontal-filters__reset {
        order: 2;
        height: auto;
        min-height: 0;
        padding: 3px 0;
        border: 0;
        background: none;
        box-shadow: none;
        color: var(--mt-green-text);
        font-size: var(--mt-text-14);
        font-weight: 700;
        text-decoration: underline;
        text-decoration-color: var(--mt-line-strong);
        text-underline-offset: 3px;
    }
}

@media (min-width: 1024px) {
    /* brand pages: the brand's category tree as a list in the rail */
    html body .medi-listing__rail .medi-brand-category-nav__header {
        display: block;
        margin: 0 0 var(--mt-space-2);
    }

    html body .medi-listing__rail .medi-brand-category-nav__eyebrow,
    html body .medi-listing__rail .medi-brand-category-nav__intro {
        display: none;
    }

    html body .medi-listing__rail .medi-brand-category-nav__title {
        margin: 0;
        color: var(--mt-ink);
        font-size: var(--mt-text-15);
        font-weight: 700;
        line-height: 1.3;
    }

    html body .medi-listing__rail .medi-brand-category-nav__tree > .medi-brand-category-nav__list,
    html body .medi-listing__rail .medi-brand-category-nav__list {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin: 0;
        padding: 0;
        columns: auto;
    }

    html body .medi-listing__rail .medi-brand-category-nav__list--depth-1,
    html body .medi-listing__rail .medi-brand-category-nav__list--depth-2,
    html body .medi-listing__rail .medi-brand-category-nav__list--depth-3,
    html body .medi-listing__rail .medi-brand-category-nav__list--depth-4 {
        margin: 2px 0 4px var(--mt-space-3);
        padding-left: var(--mt-space-2);
        border-left: 1px solid var(--mt-line);
    }

    html body .medi-listing__rail .medi-brand-category-nav__item {
        margin: 0;
    }

    html body .medi-listing__rail .medi-brand-category-nav__link,
    html body .medi-listing__rail .medi-brand-category-nav__item.has-children > .medi-brand-category-nav__link {
        min-height: var(--mt-control-h-sm);
        padding: 6px var(--mt-space-2);
        border: 0;
        border-radius: var(--mt-radius-control);
        background: none;
        box-shadow: none;
        color: var(--mt-ink);
        transform: none;
    }

    html body .medi-listing__rail .medi-brand-category-nav__item.has-children > .medi-brand-category-nav__link {
        margin-right: 40px;
    }

    html body .medi-listing__rail .medi-brand-category-nav__link:hover {
        background: var(--mt-green-soft);
        color: var(--mt-green-text);
    }

    html body .medi-listing__rail .medi-brand-category-nav__name {
        font-size: var(--mt-text-14);
        font-weight: 400;
    }

    html body .medi-listing__rail .medi-brand-category-nav__count {
        padding: 0;
        border: 0;
        background: none;
        color: var(--mt-muted);
        font-size: var(--mt-text-13);
        font-variant-numeric: tabular-nums;
    }

    html body .medi-listing__rail .medi-brand-category-nav__toggle {
        width: var(--mt-control-h-sm);
        height: var(--mt-control-h-sm);
        border: 0;
        border-radius: var(--mt-radius-control);
        background: none;
    }

    html body .medi-listing__rail .medi-brand-category-nav__toggle:hover {
        background: var(--mt-green-soft);
    }
}

@media (min-width: 1024px) {
    /* the first block of the rail needs no hairline above it (brand pages start with the tree) */
    html body .medi-listing__rail > :first-child {
        padding-top: 0;
        border-top: 0;
    }
}


/* "Tabela": as many parameter columns as fit beside the rail (container widths from
   782px + 84px per column: photo, name, price, availability, quantity, cart, gaps and padding) */
@container medi-listing (min-width: 910px) { html[data-medi-view="table"] body .medi-listing__main * { --medi-n: var(--medi-cols-c2, 1); } }
@container medi-listing (min-width: 994px) { html[data-medi-view="table"] body .medi-listing__main * { --medi-n: var(--medi-cols-c3, 1); } }
@container medi-listing (min-width: 1078px) { html[data-medi-view="table"] body .medi-listing__main * { --medi-n: var(--medi-cols-c4, 1); } }
@container medi-listing (min-width: 1162px) { html[data-medi-view="table"] body .medi-listing__main * { --medi-n: var(--medi-cols-c5, 1); } }
@container medi-listing (min-width: 1246px) { html[data-medi-view="table"] body .medi-listing__main * { --medi-n: var(--medi-cols-c6, 1); } }

@container medi-listing (max-width: 909.98px) {
    html[data-medi-view="table"] body .medi-product-row__cell:nth-child(n+2),
    html[data-medi-view="table"] body .medi-table-head__param:nth-child(n+4) { display: none; }
}
@container medi-listing (min-width: 910px) and (max-width: 993.98px) {
    html[data-medi-view="table"] body .medi-product-row__cell:nth-child(n+3),
    html[data-medi-view="table"] body .medi-table-head__param:nth-child(n+5) { display: none; }
}
@container medi-listing (min-width: 994px) and (max-width: 1077.98px) {
    html[data-medi-view="table"] body .medi-product-row__cell:nth-child(n+4),
    html[data-medi-view="table"] body .medi-table-head__param:nth-child(n+6) { display: none; }
}
@container medi-listing (min-width: 1078px) and (max-width: 1161.98px) {
    html[data-medi-view="table"] body .medi-product-row__cell:nth-child(n+5),
    html[data-medi-view="table"] body .medi-table-head__param:nth-child(n+7) { display: none; }
}
@container medi-listing (min-width: 1162px) and (max-width: 1245.98px) {
    html[data-medi-view="table"] body .medi-product-row__cell:nth-child(n+6),
    html[data-medi-view="table"] body .medi-table-head__param:nth-child(n+8) { display: none; }
}

/* ---------- Descriptions above the list: a few lines, then "Pokaż więcej" (owner request
   2026-11-28) — the category's (two lines) and the producer's (Perfect Brands block) ---------- */
html body .medi-category-description.is-collapsible:not(.is-expanded) .medi-category-description__content {
    -webkit-line-clamp: 2;
}

html body .pwb-brand-description {
    position: relative;
    margin: 0 0 var(--mt-space-2);
}

html body .pwb-brand-description h1 {
    margin: 0 0 var(--mt-space-2);
    font-size: var(--mt-text-21);
    line-height: 1.3;
}

html body .pwb-brand-description.medi-is-clamped:not(.medi-is-expanded) {
    max-height: 124px;
    overflow: hidden;
}

html body .pwb-brand-description.medi-is-clamped:not(.medi-is-expanded)::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 44px;
    background: linear-gradient(180deg, transparent, var(--mt-bg));
    pointer-events: none;
}

html body .medi-clamp-toggle {
    display: inline-flex;
    align-items: center;
    min-height: var(--mt-control-h-sm);
    margin: 0 0 var(--mt-space-4);
    padding: 0;
    border: 0;
    background: none;
    color: var(--mt-green-text);
    font-size: var(--mt-text-14);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: underline;
    text-decoration-color: var(--mt-line-strong);
    text-underline-offset: 3px;
}

html body .medi-clamp-toggle:hover {
    text-decoration-color: currentColor;
}

/* ---------- "Filtry" on phones and tablets: the rail as a full-screen sheet ---------- */
html body .medi-listing__sheet-head,
html body .medi-listing__sheet-foot,
html body .medi-filters-open {
    display: none;
}

@media (max-width: 1023.98px) {
    /* closed: only "Katalog kategorii / Poziom wyżej" stay above the list */
    html:not(.medi-rail-open) body .medi-listing__rail > .medi-category-quick-links,
    html:not(.medi-rail-open) body .medi-listing__rail > .medi-brand-category-nav,
    html:not(.medi-rail-open) body .medi-listing__rail > .medi-horizontal-filters {
        display: none;
    }

    html body .medi-listing__rail .medi-catalog-toolbar {
        margin-bottom: var(--mt-space-3);
    }

    html body .medi-filters-open {
        display: inline-flex;
        gap: 6px;
        align-items: center;
        min-height: var(--mt-control-h);
        margin: 0 auto 0 0;
        padding: 0 var(--mt-space-4);
        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-15);
        font-weight: 700;
        letter-spacing: 0;
        line-height: 1;
        text-transform: none;
    }

    html body .medi-filters-open svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    html body .medi-filters-open__count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: var(--mt-radius-pill);
        background: var(--mt-green-text);
        color: var(--mt-surface);
        font-size: var(--mt-text-13);
        font-variant-numeric: tabular-nums;
    }

    html body .medi-filters-open__count[hidden] {
        display: none;
    }

    html body .medi-view-switch {
        flex-wrap: wrap;
    }

    html body .medi-view-switch__btn {
        min-height: var(--mt-control-h);
    }

    /* open */
    html.medi-rail-open,
    html.medi-rail-open body {
        overflow: hidden;
    }

    html.medi-rail-open body .medi-listing__rail {
        position: fixed;
        inset: 0;
        z-index: 2000;
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 var(--mt-space-4);
        background: var(--mt-bg);
    }

    html.medi-rail-open body .medi-listing__rail .medi-catalog-toolbar {
        display: none;
    }

    html.medi-rail-open body .medi-listing__sheet-head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 calc(-1 * var(--mt-space-4)) var(--mt-space-3);
        padding: var(--mt-space-2) var(--mt-space-2) var(--mt-space-2) var(--mt-space-4);
        border-bottom: 1px solid var(--mt-line);
        background: var(--mt-surface);
    }

    html body .medi-listing__sheet-title {
        color: var(--mt-ink);
        font-size: var(--mt-text-17);
        font-weight: 700;
    }

    html body .medi-listing__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--mt-control-h);
        height: var(--mt-control-h);
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: var(--mt-radius-control);
        background: none;
        color: var(--mt-ink);
    }

    html body .medi-listing__close svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    html body .medi-listing__close:focus-visible {
        outline: 0;
        box-shadow: var(--mt-focus);
    }

    html.medi-rail-open body .medi-listing__sheet-foot {
        position: sticky;
        bottom: 0;
        z-index: 2;
        display: block;
        margin: var(--mt-space-3) calc(-1 * var(--mt-space-4)) 0;
        padding: var(--mt-space-3) var(--mt-space-4);
        border-top: 1px solid var(--mt-line);
        background: var(--mt-surface);
    }

    html.medi-rail-open body .medi-listing__sheet-foot .button {
        width: 100%;
        min-height: var(--mt-control-h);
        margin: 0;
    }

    /* inside the sheet the filters stand one under another, like the desktop rail */
    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters {
        min-height: 0;
    }

    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters__note {
        display: none;
    }

    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters__scroller {
        display: block;
        overflow: visible;
        padding: 0;
    }

    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters.is-collapsed .medi-horizontal-filters__scroller {
        display: none;
    }

    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters__scroller > .widget,
    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters__scroller > .widget + .widget {
        flex: none;
        width: auto;
        min-height: 0;
        height: auto;
        padding: var(--mt-space-3) 0;
        border: 0;
        border-top: 1px solid var(--mt-line);
    }

    html.medi-rail-open body .medi-listing__rail .medi-horizontal-filters__scroller > .widget:first-child {
        border-top: 0;
    }

    html.medi-rail-open body .medi-listing__rail .widget .widget {
        margin: 0;
        padding: 0;
        border: 0;
    }
}

@media (max-width: 1023.98px) {
    /* above the floating "Katalog kategorii" button and the header */
    html.medi-rail-open body .medi-listing__rail {
        z-index: 100000;
    }

    /* "Katalog kategorii" and "Poziom wyżej" side by side */
    html body .medi-listing__rail .medi-catalog-toolbar {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--mt-space-2);
    }

    html body .medi-listing__rail .medi-catalog-toolbar > * {
        flex: 1 1 0;
        min-width: 0;
        min-height: var(--mt-control-h);
        margin: 0;
    }
}

/* phones: a long parameter value wraps inside the row instead of running past it */
@media (max-width: 848px) {
    html body .medi-product-row__specs {
        min-width: 0;
        max-width: 100%;
    }

    html body .medi-product-row__spec {
        flex-wrap: wrap;
        max-width: 100%;
    }

    html body .medi-product-row__spec dd {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (min-width: 1024px) {
    /* table rows: code and producer under the name; MPN stays in the list, the cards and the product page */
    html[data-medi-view="table"] body .medi-product-row__meta li:nth-child(n+3) {
        display: none;
    }
}

/* ---------- One bar over the list: [Filtry] [Sortuj] ........ [Widok] (owner request 2026-11-28) ---------- */
html body .medi-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2) var(--mt-space-4);
    align-items: center;
    margin: 0 0 var(--mt-space-3);
}

html body .medi-list-toolbar .medi-view-switch {
    margin: 0 0 0 auto;
}

html body .medi-list-sort {
    display: flex;
    gap: var(--mt-space-2);
    align-items: center;
}

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

html body .medi-list-sort .woocommerce-ordering {
    margin: 0;
}

html body .medi-list-sort .woocommerce-ordering select.orderby {
    height: var(--mt-control-h-sm);
    min-height: 0;
    margin: 0;
    padding: 0 34px 0 12px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-control);
    background-color: var(--mt-surface);
    box-shadow: none;
    color: var(--mt-ink);
    font-size: var(--mt-text-14);
    font-weight: 400;
}

html body .medi-list-sort .woocommerce-ordering select.orderby:hover {
    border-color: var(--mt-line-strong);
}

html body .medi-list-sort .woocommerce-ordering select.orderby:focus-visible {
    outline: 0;
    box-shadow: var(--mt-focus);
}

@media (max-width: 1023.98px) {
    html body .medi-list-toolbar {
        gap: var(--mt-space-2);
    }

    html body .medi-filters-open {
        margin: 0;
    }

    html body .medi-list-sort {
        flex: 1 1 160px;
    }

    html body .medi-list-sort__label {
        display: none;
    }

    html body .medi-list-sort .woocommerce-ordering,
    html body .medi-list-sort .woocommerce-ordering select.orderby {
        width: 100%;
    }

    html body .medi-list-sort .woocommerce-ordering select.orderby {
        height: var(--mt-control-h);
        font-size: var(--mt-text-input);
    }

    html body .medi-list-toolbar .medi-view-switch {
        flex: 1 1 100%;
        margin: 0;
    }

    html body .medi-list-toolbar .medi-view-switch__btn {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* ---------- Phones: the green title bar is just the title (owner request 2026-11-28) — no
   breadcrumb ("Poziom wyżej" is over the list; the breadcrumb data stays in Yoast's JSON-LD)
   and no sorting (moved over the list) ---------- */
@media (max-width: 849px) {
    /* the page's h1 sits inside the breadcrumb nav: everything but the h1 goes */
    html body .category-page-title .woocommerce-breadcrumb > :not(.medi-breadcrumb-page-title) {
        display: none;
    }

    html body .category-page-title .woocommerce-breadcrumb {
        font-size: 0; /* the text separators between crumbs */
    }

    html body .category-page-title .page-title-inner {
        min-height: 0;
        padding-top: var(--mt-space-3);
        padding-bottom: var(--mt-space-3);
    }

    html body .category-page-title .flex-col {
        text-align: left;
    }

    html body .category-page-title h1,
    html body .category-page-title .medi-breadcrumb-page-title {
        margin: 0;
        font-size: var(--mt-text-21);
        line-height: 1.25;
        text-align: left;
    }
}

/* ---------- Description: "Pokaż więcej" beside the two lines, not under them (owner request
   2026-11-28) ---------- */
@media (min-width: 850px) {
    html body .medi-category-description.is-collapsible {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--mt-space-5);
        align-items: end;
    }

    html body .medi-category-description.is-collapsible:not(.is-expanded) .medi-category-description__content {
        margin-bottom: 0;
    }

    html body .medi-category-description.is-collapsible:not(.is-expanded)::after {
        content: none;
    }

    html body .medi-category-description.is-collapsible .medi-category-description__toggle {
        align-self: end;
        min-height: var(--mt-control-h-sm);
        margin: 0;
        padding: 0 var(--mt-space-3);
        white-space: nowrap;
    }
}

/* ---------- Rail and list on one line at the top and at the bottom (owner request 2026-11-28):
   the bar is over both columns; the rail is at least one window tall, so at the end of the list
   its bottom meets the list's bottom instead of stopping short ---------- */
@media (min-width: 1024px) {
    html body .medi-listing__rail {
        min-height: calc(100vh - 127px);
    }

    html body .medi-list-toolbar {
        margin-bottom: var(--mt-space-3);
    }
}

@media (max-width: 1023.98px) {
    /* closed: the rail is out of the way ("Katalog kategorii" floats at the bottom of the
       screen); open: the sheet starts with "Katalog kategorii | Poziom wyżej" */
    html:not(.medi-rail-open) body .medi-listing__rail {
        display: none;
    }

    html.medi-rail-open body .medi-listing__rail .medi-catalog-toolbar {
        display: flex;
        margin-bottom: var(--mt-space-3);
    }
}

/* the quick preview's stepper: the same drawn "−" / "+" as the mini-cart (flatsome-bridge.css) */
html body .medi-quick__step {
    color: var(--mt-green-text);
}

html body .medi-quick__step::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10M7 2v10'/%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 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10M7 2v10'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .medi-quick__step:first-child::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10'/%3E%3C/svg%3E");
}

/* the sheet's close (×) follows the Icon Button Rule: a 44px circle on a hairline */
@media (max-width: 1023.98px) {
    html body .medi-listing__close {
        border: 1px solid var(--mt-line);
        border-radius: var(--mt-radius-pill);
        background: var(--mt-surface);
        color: var(--mt-ink);
    }

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

    html body .medi-listing__close svg {
        width: 18px;
        height: 18px;
    }
}

/* ---------- Kafle: one line for the photo, one for the facts, one for price and button —
   shared by every card in a row (subgrid), so prices, statuses and buttons line up whatever
   each card says above them (owner report 2026-11-28) ---------- */
html[data-medi-view="grid"] body .products {
    row-gap: 0;
}

html[data-medi-view="grid"] body .category-page-row .products .medi-product-row,
html[data-medi-view="grid"] body .products .medi-product-row {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: var(--mt-space-3);
    margin-bottom: var(--mt-space-3);
}

html[data-medi-view="grid"] body .medi-product-row__specs {
    min-height: 0;
}

/* codes on a card: "Indeks:" stays, the code shows as much as fits, then "…", then the copy
   button — the button never drops out */
html[data-medi-view="grid"] body .medi-product-row__meta li {
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
    overflow: visible;
    white-space: nowrap;
}

html[data-medi-view="grid"] body .medi-product-row__meta-label {
    flex: none;
}

html[data-medi-view="grid"] body .medi-product-row__meta-value {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

html[data-medi-view="grid"] body .medi-product-row__meta-value .medi-code-group {
    min-width: 0;
    max-width: 100%;
}

/* ---------- Quick preview stands out from the cards under it (owner report 2026-11-28):
   a floating layer gets more depth than the cards it covers — a stronger, offset shadow and a
   firmer border — and the page behind it dims a little (a scrim under the card, not a modal:
   the pointer leaving still closes it) ---------- */
html body .medi-quick {
    border-color: var(--mt-line-strong);
    box-shadow: var(--mt-shadow-overlay);
}

html body .medi-quick-scrim {
    position: fixed;
    inset: 0;
    z-index: 59; /* under the card (60) */
    background: color-mix(in srgb, var(--mt-ink) 14%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity .26s cubic-bezier(.4, 0, .2, 1);
    will-change: opacity;
}

html body .medi-quick-scrim.is-on {
    opacity: 1;
    transition-duration: .22s;
}

/* the card fades with the page; it was 0.14s against the dimming's 0.16s and they flickered */
html body .medi-quick {
    transition: opacity .22s cubic-bezier(.4, 0, .2, 1), transform .26s cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-reduced-motion: reduce) {
    html body .medi-quick-scrim {
        transition: none;
    }
}

/* a long code no longer pushes its line wider than the card (the copy button was clipped) */
html[data-medi-view="grid"] body .medi-product-row__meta {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
}

html[data-medi-view="grid"] body .medi-product-row__meta li {
    max-width: 100%;
}

html[data-medi-view="grid"] body .medi-product-row__body {
    min-width: 0;
}

/* quick preview: "Indeks: CODE ⧉" on one line, like the card */
html body .medi-quick__meta li {
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
}

html body .medi-quick__meta .medi-product-row__meta-label {
    flex: none;
}

html body .medi-quick__meta .medi-product-row__meta-value {
    display: flex;
    min-width: 0;
    overflow: hidden;
}

html body .medi-quick__stock {
    align-items: center;
}

/* ---------- Kafle: availability as icons beside the price, no words (owner request
   2026-11-28, Speckable pattern): [price ........ bars · shop · supplier]. The words stay for
   screen readers and in each icon's title; the list and the table keep them visible. ---------- */
html[data-medi-view="grid"] body .medi-product-row__buy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto 1fr;
    column-gap: var(--mt-space-2);
    row-gap: var(--mt-space-3);
    align-items: center;
}

html[data-medi-view="grid"] body .medi-product-row__price-slot {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

html[data-medi-view="grid"] body .medi-product-row__stock {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
    min-height: 0;
}

html[data-medi-view="grid"] body .medi-product-row__stock .medi-stock-bars {
    margin: 0;
}

html[data-medi-view="grid"] body .medi-product-row__stock .medi-stock-bars svg {
    width: 22px;
    height: 20px;
}

html[data-medi-view="grid"] body .medi-product-row__stock .medi-stock-bars.is-last svg {
    width: 31px;
}

html[data-medi-view="grid"] body .medi-product-row__stock-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html[data-medi-view="grid"] body .medi-product-row__availability {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    gap: 4px;
    align-self: center;
}

html[data-medi-view="grid"] body .medi-product-row__availability--empty {
    display: none;
}

html[data-medi-view="grid"] body .medi-product-row__availability-chip {
    position: relative;
    display: inline-flex;
    width: 20px;
    height: 20px;
    overflow: hidden;
    color: var(--mt-green-text);
}

html[data-medi-view="grid"] body .medi-product-row__chip-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html[data-medi-view="grid"] body .medi-product-row__availability-chip + .medi-product-row__availability-chip::before {
    content: none;
}

html[data-medi-view="grid"] body .medi-product-row__availability-chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: currentColor;
    -webkit-mask: var(--medi-chip-icon) center / contain no-repeat;
    mask: var(--medi-chip-icon) center / contain no-repeat;
}

/* shop front: the Warsaw shop has it */
html[data-medi-view="grid"] body .medi-product-row__availability-chip--store {
    --medi-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 9.5l1.6-5h13.8l1.6 5'/%3E%3Cpath d='M3.5 9.5a2.8 2.8 0 0 0 5.5 0a2.8 2.8 0 0 0 5.5 0a2.8 2.8 0 0 0 5.5 0'/%3E%3Cpath d='M5 11.5V20h14v-8.5'/%3E%3Cpath d='M10 20v-5h4v5'/%3E%3C/svg%3E");
}

/* truck: the supplier has it */
html[data-medi-view="grid"] body .medi-product-row__availability-chip--supplier {
    --medi-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6h11v10h-11z'/%3E%3Cpath d='M13.5 9.5h4l3 3.5V16h-7'/%3E%3Ccircle cx='6.5' cy='17.5' r='1.8'/%3E%3Ccircle cx='17' cy='17.5' r='1.8'/%3E%3C/svg%3E");
}

html[data-medi-view="grid"] body .medi-product-row__cta {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: end;
    margin-top: 0;
}

/* the price takes two lines at most (net over gross) */
html[data-medi-view="grid"] body .medi-product-row__price-slot .price {
    margin: 0;
}


/* ---------- Kafle: the button as an icon (owner request 2026-11-28, Speckable pattern) — the
   header's cart (--mt-icon-cart, drawn once in tokens.css, nothing extra to download) for
   "Dodaj do koszyka", an arrow for "Zobacz produkt"; the words stay as the accessible name.
   One line: [price ...... bars · shop · button]; phones put the button under it, full width. ---------- */
html[data-medi-view="grid"] body .medi-product-row__buy {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto;
}

html[data-medi-view="grid"] body .medi-product-row__cta {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    padding: 0;
}

html[data-medi-view="grid"] body .medi-product-row__buy .button,
html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mt-control-h);
    min-width: 0;
    height: var(--mt-control-h);
    min-height: 0;
    margin: 0 0 0 var(--mt-space-1);
    padding: 0;
    overflow: hidden;
    color: transparent !important;
    text-indent: 200%;
    white-space: nowrap;
}

html[data-medi-view="grid"] body .medi-product-row__buy .button::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    background: var(--mt-surface);
    -webkit-mask: var(--mt-icon-cart) center / contain no-repeat;
    mask: var(--mt-icon-cart) center / contain no-repeat;
}

html[data-medi-view="grid"] body .medi-product-row__buy .button:not(.add_to_cart_button) {
    border: 1px solid var(--mt-green-text);
    background: var(--mt-surface);
}

html[data-medi-view="grid"] body .medi-product-row__buy .button:not(.add_to_cart_button)::before {
    background: var(--mt-green-text);
    -webkit-mask-image: var(--mt-icon-arrow-right);
    mask-image: var(--mt-icon-arrow-right);
}

html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button.added::before {
    -webkit-mask-image: var(--mt-icon-check);
    mask-image: var(--mt-icon-check);
}

html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button.loading::before {
    opacity: .4;
}

html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button::after,
html[data-medi-view="grid"] body .medi-product-row__cta .added_to_cart {
    display: none;
}

@media (max-width: 548px) {
    html[data-medi-view="grid"] body .medi-product-row__buy {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto auto;
    }

    html[data-medi-view="grid"] body .medi-product-row__cta {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
    }

    html[data-medi-view="grid"] body .medi-product-row__buy .button,
    html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button {
        width: 100%;
        margin: 0;
    }
}

/* sorting sits right over the rail: same width, so its edges line up with the rail's */
@media (min-width: 1024px) {
    html body .medi-list-sort {
        flex: 0 0 272px;
        width: 272px;
    }

    html body .medi-list-sort .woocommerce-ordering {
        flex: 1 1 auto;
        min-width: 0;
    }

    html body .medi-list-sort .woocommerce-ordering select.orderby {
        width: 100%;
    }
}

/* an availability status is one line in every view (owner report 2026-11-28): bars + words
   never wrap; the table's availability column is wide enough for "Do potwierdzenia" */
html body .medi-product-row__stock,
html body .medi-product-row__stock-text,
html body .medi-related-card__stock,
html body .medi-quick__stock {
    white-space: nowrap;
}

/* rows on phones: a long code shows what fits, "…", and keeps its copy button inside the card */
@media (max-width: 848px) {
    html body .medi-product-row__meta {
        min-width: 0;
        max-width: 100%;
    }

    html body .medi-product-row__meta li {
        display: flex;
        gap: 4px;
        align-items: center;
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
    }

    html body .medi-product-row__meta-label {
        flex: none;
    }

    html body .medi-product-row__meta-value {
        display: flex;
        min-width: 0;
        overflow: hidden;
    }

    html body .medi-product-row__body {
        min-width: 0;
    }
}

/* ---------- Quantity beside "Dodaj do koszyka" (owner request 2026-11-28, Speckable pattern
   in the mt look — the mini-cart's stepper) ---------- */
html body .medi-loop-qty {
    display: inline-flex;
    align-items: stretch;
    height: var(--mt-control-h);
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
}

html body .medi-loop-qty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--mt-radius-control);
    background: transparent;
    color: var(--mt-green-text);
    cursor: pointer;
}

html body .medi-loop-qty__btn::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10M7 2v10'/%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 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10M7 2v10'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .medi-loop-qty__btn[data-step="-1"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7h10'/%3E%3C/svg%3E");
}

html body .medi-loop-qty__btn:hover:not(:disabled) {
    background: var(--mt-green-soft);
}

html body .medi-loop-qty__btn:disabled {
    color: var(--mt-disabled);
    cursor: default;
}

html body .medi-loop-qty__input[type="number"] {
    width: 40px;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--mt-line);
    border-left: 1px solid var(--mt-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--mt-ink);
    font-size: var(--mt-text-input);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

html body .medi-loop-qty__input::-webkit-inner-spin-button,
html body .medi-loop-qty__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

html body .medi-loop-qty__btn:focus-visible,
html body .medi-loop-qty__input:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    box-shadow: var(--mt-focus);
}

/* list rows: stepper and button side by side at the bottom of the buy column */
html:not([data-medi-view]) body .medi-product-row__buy .medi-loop-qty {
    margin-top: 6px;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) {
    grid-template-columns: auto minmax(0, 1fr);
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) > :not(.medi-loop-qty):not(.medi-product-row__cta) {
    grid-column: 1 / -1;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-loop-qty {
    grid-column: 1;
    align-self: end;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-product-row__cta {
    grid-column: 2;
    align-self: end;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button {
    padding-right: 8px;
    padding-left: 8px;
}

/* the table: the stepper in its own "Ilość" column before the cart icon (owner request
   2026-11-29 — the quantity could not be changed in the table); narrower buttons */
html[data-medi-view="table"] body .medi-loop-qty {
    grid-column: -3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: stretch;
    min-width: 0;
}

html[data-medi-view="table"] body .medi-loop-qty__btn {
    width: 28px;
    flex: none;
}

html[data-medi-view="table"] body .medi-loop-qty__input[type="number"] {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}

/* Kafle: [price ...... bars · shop] then [stepper ......... cart] */
html[data-medi-view="grid"] body .medi-product-row__buy:has(.medi-loop-qty) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
}

html[data-medi-view="grid"] body .medi-product-row__buy .medi-loop-qty {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
}

html[data-medi-view="grid"] body .medi-product-row__buy:has(.medi-loop-qty) .medi-product-row__cta {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: end;
}

/* every card's button sits on the second line, right — the cart beside the stepper and the
   "Zobacz produkt" arrow alike — so the buttons of a row line up */
html[data-medi-view="grid"] body .medi-product-row__buy:not(:has(.medi-loop-qty)) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
}

html[data-medi-view="grid"] body .medi-product-row__buy:not(:has(.medi-loop-qty)) .medi-product-row__cta {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
}

html[data-medi-view="grid"] body .medi-product-row__buy:not(:has(.medi-loop-qty)) .button {
    width: var(--mt-control-h);
}

@media (max-width: 548px) {
    html[data-medi-view="grid"] body .medi-product-row__buy:has(.medi-loop-qty) .medi-product-row__cta {
        grid-column: 2 / -1;
        grid-row: 2;
        justify-self: end;
    }

    html[data-medi-view="grid"] body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button {
        width: var(--mt-control-h);
    }

    html body .medi-loop-qty__btn {
        width: 30px;
    }

    html body .medi-loop-qty__input[type="number"] {
        width: 34px;
    }
}

/* list rows with a stepper: the cart button is the same 44px cart icon as on the cards
   ("Dodaj do koszyka" did not fit beside the stepper and wrapped) */
html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-product-row__cta {
    justify-self: end;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button {
    position: relative;
    display: inline-flex;
    width: var(--mt-control-h);
    min-width: 0;
    height: var(--mt-control-h);
    min-height: 0;
    margin: 6px 0 0;
    padding: 0;
    overflow: hidden;
    color: transparent !important;
    text-indent: 200%;
    white-space: nowrap;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    background: var(--mt-surface);
    -webkit-mask: var(--mt-icon-cart) center / contain no-repeat;
    mask: var(--mt-icon-cart) center / contain no-repeat;
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button.added::before {
    -webkit-mask-image: var(--mt-icon-check);
    mask-image: var(--mt-icon-check);
}

html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .add_to_cart_button::after,
html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .added_to_cart {
    display: none;
}

@media (max-width: 848px) {
    /* phone rows: [price | status] [price | channels] [stepper | cart] */
    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
    }

    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) > .medi-product-row__price-slot {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) > .medi-product-row__stock {
        grid-column: 2;
        grid-row: 1;
    }

    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) > .medi-product-row__availability {
        grid-column: 2;
        grid-row: 2;
    }

    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-loop-qty {
        grid-column: 1;
        grid-row: 3;
    }

    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-product-row__cta {
        grid-column: 2;
        grid-row: 3;
    }
}

@media (max-width: 848px) {
    html:not([data-medi-view]) body .medi-product-row__buy:has(.medi-loop-qty) .medi-loop-qty {
        justify-self: start;
    }
}

/* stepper and cart on one level: both centred in their line, no stray offsets */
html[data-medi-view="grid"] body .medi-product-row__buy .medi-loop-qty,
html[data-medi-view="grid"] body .medi-product-row__buy .medi-product-row__cta {
    align-self: center;
}

html[data-medi-view="grid"] body .medi-product-row__cta {
    display: flex;
    padding: 0;
    line-height: 0;
}

html[data-medi-view="grid"] body .medi-product-row__cta > *,
html[data-medi-view="grid"] body .medi-product-row__cta form {
    display: flex;
    margin: 0;
}

html[data-medi-view="grid"] body .medi-product-row__buy .button,
html[data-medi-view="grid"] body .medi-product-row__buy .add_to_cart_button {
    margin: 0;
}

/* "Tabela" without parameter columns (search, brands, the shop: functions.php gives columns to
   categories only; the list says so in data-medi-cols="[]"): name, price, availability, cart */
@media (min-width: 1024px) {
    html[data-medi-view="table"] body .medi-listing__main:has(.products[data-medi-cols="[]"]) .medi-table-head,
    html[data-medi-view="table"] body .medi-listing__main:has(.products[data-medi-cols="[]"]) .products .medi-product-row {
        grid-template-columns: 56px minmax(180px, 1fr) 112px 156px 44px;
    }
}
