.iba-all-machines {
    --iba-orange: #f36b21;
    --iba-orange-dark: #d95d17;
    --iba-ink: #22272b;
    --iba-muted: #687078;
    --iba-line: #e2e5e8;
    --iba-surface: #f7f8f9;

    width: 100%;
    min-width: 0;
    margin-top: 21px !important;
    padding: 14px 0 70px;
    color: var(--iba-ink);
}

.iba-all-machines * {
    box-sizing: border-box;
}

.iba-all-machines .iba-all-machines__container {
    width: calc(100% + 30px);
    max-width: 1130px;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
}

.iba-all-machines .iba-all-machines__header {
    border-bottom: 1px solid var(--iba-line);
    margin: 0 0 26px;
    padding: 0 0 22px;
    position: relative;
}

.iba-all-machines .iba-all-machines__header::before {
    background: var(--iba-orange);
    border-radius: 2px;
    content: "";
    display: block;
    height: 3px;
    margin-bottom: 13px;
    width: 44px;
}

.iba-all-machines .iba-all-machines__title {
    color: var(--iba-ink);
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin: 0 0 8px;
}

.iba-all-machines .iba-all-machines__intro {
    color: var(--iba-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    max-width: 720px;
}

.iba-all-machines .iba-all-machines__layout {
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: 250px minmax(0, 1fr);
    min-width: 0;
}

.iba-all-machines .iba-all-machines__filters {
    min-width: 0;
    position: sticky;
    top: 104px;
}

.iba-all-machines .iba-all-machines__filter-form {
    background: var(--iba-surface);
    border: 1px solid #efb18e;
    border-radius: 9px;
    box-shadow: 0 5px 18px rgb(25 31 36 / 6%);
    padding: 24px 22px;
}

.iba-all-machines .iba-all-machines__filter-heading {
    align-items: baseline;
    border-bottom: 1px solid var(--iba-line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 21px;
    padding: 0 0 15px;
}

.iba-all-machines .iba-all-machines__filter-heading h2,
.iba-all-machines .iba-all-machines__results-header h2 {
    color: var(--iba-ink);
    line-height: 1.3;
    margin: 0;
}

.iba-all-machines .iba-all-machines__filter-heading h2 {
    font-size: 1.08rem;
    font-weight: 700;
}

.iba-all-machines .iba-all-machines__filter-heading a {
    color: var(--iba-muted);
    flex: 0 0 auto;
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.iba-all-machines .iba-all-machines__filter-heading a:hover {
    color: var(--iba-orange-dark);
}

.iba-all-machines .iba-all-machines__field {
    margin: 0 0 19px;
    min-width: 0;
}

.iba-all-machines .iba-all-machines__field label {
    color: #3d4348;
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    margin: 0 0 7px;
    text-transform: uppercase;
}

.iba-all-machines .iba-all-machines__field input,
.iba-all-machines .iba-all-machines__field select {
    background-color: #fff;
    border: 1px solid #cbd1d6;
    border-radius: 6px;
    box-shadow: none;
    color: var(--iba-ink);
    font-family: inherit;
    font-size: 0.92rem;
    height: 46px;
    line-height: normal;
    margin: 0;
    max-width: 100%;
    padding: 0 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    width: 100%;
}

.iba-all-machines .iba-all-machines__field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #6d747a 50%), linear-gradient(135deg, #6d747a 50%, transparent 50%);
    background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    cursor: pointer;
    padding-right: 34px;
}

.iba-all-machines .iba-all-machines__field input:focus,
.iba-all-machines .iba-all-machines__field select:focus {
    border-color: var(--iba-orange);
    box-shadow: 0 0 0 3px rgb(243 107 33 / 13%);
    outline: 0;
}

.iba-all-machines .iba-all-machines__filter-row {
    display: grid;
    grid-template-columns: 1fr;
}

.iba-all-machines .iba-all-machines__apply,
.iba-all-machines .iba-machine-list-card__button,
.iba-all-machines .iba-all-machines__empty a {
    align-items: center;
    background: var(--iba-orange);
    border: 1px solid var(--iba-orange);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    min-height: 46px;
    padding: 11px 24px;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.iba-all-machines .iba-all-machines__apply {
    cursor: pointer;
    margin-top: 2px;
    width: 100%;
}

.iba-all-machines .iba-all-machines__apply:hover,
.iba-all-machines .iba-all-machines__apply:focus,
.iba-all-machines .iba-machine-list-card__button:hover,
.iba-all-machines .iba-machine-list-card__button:focus,
.iba-all-machines .iba-all-machines__empty a:hover,
.iba-all-machines .iba-all-machines__empty a:focus {
    background: var(--iba-orange-dark);
    border-color: var(--iba-orange-dark);
    color: #fff;
    transform: translateY(-1px);
}

.iba-all-machines .iba-all-machines__clear {
    align-items: center;
    background: transparent;
    border: 1px solid #cbd1d6;
    border-radius: 6px;
    color: #4e565d;
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    justify-content: center;
    min-height: 44px;
    margin-top: 10px;
    padding: 9px 16px;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.iba-all-machines .iba-all-machines__clear:hover,
.iba-all-machines .iba-all-machines__clear:focus {
    background: #fff;
    border-color: #aeb5ba;
    color: var(--iba-orange-dark);
}

.iba-all-machines .iba-all-machines__results {
    min-width: 0;
}

.iba-all-machines .iba-all-machines__results-header {
    align-items: center;
    background: #fafafa;
    border: 1px solid var(--iba-line);
    border-radius: 7px;
    display: flex;
    justify-content: space-between;
    min-height: 58px;
    padding: 14px 20px;
}

.iba-all-machines .iba-all-machines__results-header::after {
    content: "";
    display: block;
    min-width: 110px;
}

.iba-all-machines .iba-all-machines__results-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.iba-all-machines .iba-all-machines__active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 13px 0 0;
}

.iba-all-machines .iba-all-machines__active-filters a {
    align-items: center;
    background: #fff5ee;
    border: 1px solid #ffd5bc;
    border-radius: 999px;
    color: #864019;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 8px;
    line-height: 1.2;
    padding: 7px 10px 7px 12px;
    text-decoration: none;
}

.iba-all-machines .iba-all-machines__active-filters a:hover,
.iba-all-machines .iba-all-machines__active-filters a:focus {
    background: #ffeadc;
    color: #6e3211;
}

.iba-all-machines .iba-all-machines__list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
    min-width: 0;
}

.iba-all-machines .iba-machine-list-card {
    background: #fff;
    border: 1px solid var(--iba-line);
    border-radius: 9px;
    box-shadow: 0 4px 15px rgb(25 31 36 / 6%);
    display: grid;
    grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
    min-height: 225px;
    min-width: 0;
    overflow: hidden;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    width: 100%;
}

.iba-all-machines .iba-machine-list-card:hover {
    border-color: #efb18e;
    box-shadow: 0 10px 26px rgb(25 31 36 / 10%);
    transform: translateY(-2px);
}

.iba-all-machines .iba-machine-list-card__image {
    background: #eceff1;
    display: block;
    min-height: 225px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.iba-all-machines .iba-machine-list-card__image img {
    display: block;
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.iba-all-machines .iba-machine-list-card__placeholder {
    align-items: center;
    background: linear-gradient(145deg, #f1f3f4, #e1e5e7);
    color: #858d93;
    display: flex;
    font-size: 0.78rem;
    inset: 0;
    justify-content: center;
    letter-spacing: 0.05em;
    position: absolute;
    text-transform: uppercase;
}

/* Match the existing project badge styles from archive-products.css. */
.iba-all-machines .iba-machine-new-badge,
.iba-all-machines .iba-machine-sold-badge {
    align-items: center;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    min-height: 30px;
    min-width: 82px;
    padding: 6px 14px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    text-transform: uppercase;
    top: 0;
    z-index: 3;
}

.iba-all-machines .iba-machine-new-badge {
    background: #27ae60;
    right: 0;
}

.iba-all-machines .iba-machine-sold-badge {
    background: #dc2626;
    left: 0;
}

.iba-all-machines .iba-machine-list-card__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px 25px 21px;
}

.iba-all-machines .iba-machine-list-card__title {
    color: var(--iba-ink);
    font-size: clamp(1.18rem, 1.8vw, 1.42rem);
    font-weight: 700;
    line-height: 1.24;
    margin: 0 0 13px;
    overflow-wrap: anywhere;
}

.iba-all-machines .iba-machine-list-card__title a {
    color: inherit;
    text-decoration: none;
}

.iba-all-machines .iba-machine-list-card__title a:hover,
.iba-all-machines .iba-machine-list-card__title a:focus {
    color: var(--iba-orange-dark);
}

.iba-all-machines .iba-machine-list-card__facts {
    display: grid;
    margin: 0;
    min-width: 0;
}

.iba-all-machines .iba-machine-list-card__fact {
    border-top: 1px solid #edf0f2;
    display: grid;
    font-size: 0.9rem;
    gap: 16px;
    grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
    line-height: 1.35;
    min-height: 32px;
    padding: 7px 0;
}

.iba-all-machines .iba-machine-list-card__fact:first-child {
    border-top: 0;
}

.iba-all-machines .iba-machine-list-card__fact dt {
    color: var(--iba-muted);
    font-weight: 400;
}

.iba-all-machines .iba-machine-list-card__fact dd {
    color: #2d3338;
    font-weight: 600;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.iba-all-machines .iba-machine-list-card__fact.is-empty dd {
    color: #9aa0a5;
}

.iba-all-machines .iba-machine-list-card__footer {
    display: flex;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: 20px; 
}

.iba-all-machines .iba-machine-list-card__button {
    min-width: 138px;
    white-space: nowrap;
}

.iba-all-machines .iba-all-machines__pagination {
    margin-top: 30px;
}

/* PHP pagination stays in the HTML and is hidden only after JS initializes. */
.iba-all-machines.is-ajax-ready .iba-all-machines__pagination {
    display: none;
}

.iba-all-machines [hidden] {
    display: none !important;
}

.iba-all-machines .iba-all-machines__loading {
    color: var(--iba-muted);
    font-size: 0.86rem;
    margin-left: auto;
}

.iba-all-machines.is-loading .iba-all-machines__list {
    opacity: 0.55;
    transition: opacity 160ms ease;
}

.iba-all-machines .iba-all-machines__ajax-error {
    background: #fff1f0;
    border: 1px solid #f0b8b3;
    border-radius: 6px;
    color: #8b2720;
    margin-top: 14px;
    padding: 10px 13px;
}

.iba-all-machines .iba-all-machines__load-more-wrap {
    margin-top: 30px;
    margin-bottom: 48px;
    text-align: center;
}

.iba-all-machines .iba-all-machines__load-more {
    background: var(--iba-orange);
    border: 1px solid var(--iba-orange);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    min-height: 44px;
    min-width: 150px;
    padding: 10px 22px;
}

.iba-all-machines .iba-all-machines__load-more:hover,
.iba-all-machines .iba-all-machines__load-more:focus {
    background: var(--iba-orange-dark);
    border-color: var(--iba-orange-dark);
}

.iba-all-machines .iba-all-machines__load-more:disabled,
.iba-all-machines .iba-all-machines__apply:disabled {
    cursor: wait;
    opacity: 0.65;
}

.iba-all-machines .iba-all-machines__pagination .page-numbers {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.iba-all-machines .iba-all-machines__pagination .page-numbers li {
    margin: 0;
}

.iba-all-machines .iba-all-machines__pagination a.page-numbers,
.iba-all-machines .iba-all-machines__pagination span.page-numbers {
    align-items: center;
    border: 1px solid var(--iba-line);
    border-radius: 5px;
    color: var(--iba-ink);
    display: inline-flex;
    font-size: 0.86rem;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    padding: 7px 11px;
    text-decoration: none;
}

.iba-all-machines .iba-all-machines__pagination span.current,
.iba-all-machines .iba-all-machines__pagination a.page-numbers:hover,
.iba-all-machines .iba-all-machines__pagination a.page-numbers:focus {
    background: var(--iba-orange);
    border-color: var(--iba-orange);
    color: #fff;
}

.iba-all-machines .iba-all-machines__empty {
    background: var(--iba-surface);
    border: 1px solid var(--iba-line);
    border-radius: 9px;
    margin-top: 18px;
    padding: 52px 24px;
    text-align: center;
}

.iba-all-machines .iba-all-machines__empty h2 {
    color: var(--iba-ink);
    font-size: 1.45rem;
    margin: 0 0 8px;
}

.iba-all-machines .iba-all-machines__empty p {
    color: var(--iba-muted);
    margin: 0 0 20px;
}


/**
 * Align All Machines breadcrumbs with page heading
 */
body:has(main.iba-all-machines) .ast-breadcrumbs-wrapper {
    width: 100%;
    max-width: 1100px;
    margin-right: auto;
    margin-left: auto;
}

body:has(main.iba-all-machines) .ast-breadcrumbs {
    margin-left: 0;
}

@media (max-width: 1024px) {
    .iba-all-machines .iba-all-machines__layout {
        gap: 22px;
        grid-template-columns: 235px minmax(0, 1fr);
    }

    .iba-all-machines .iba-all-machines__filter-form {
        padding: 21px 18px;
    }

    .iba-all-machines .iba-machine-list-card {
        grid-template-columns: minmax(205px, 33%) minmax(0, 1fr);
    }

    .iba-all-machines .iba-machine-list-card__content {
        padding-left: 21px;
        padding-right: 21px;
    }
}

@media (max-width: 820px) {

    main#primary.iba-all-machines {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .iba-all-machines {
        margin-top: -10px;
        padding-bottom: 54px;
        padding-top: 8px;
    }

    .iba-all-machines .iba-all-machines__layout {
        grid-template-columns: 1fr;
    }

    .iba-all-machines .iba-all-machines__filters {
        position: static;
    }

    .iba-all-machines .iba-all-machines__filter-row {
        gap: 14px;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {

    .iba-all-machines .iba-all-machines__header {
        margin-bottom: 22px;
    }

    .iba-all-machines .iba-all-machines__filter-form {
        padding: 20px 18px;
    }

    .iba-all-machines .iba-all-machines__filter-row {
        gap: 0;
        grid-template-columns: 1fr;
    }

    .iba-all-machines .iba-all-machines__results-header {
        min-height: 54px;
        padding: 13px 16px;
    }

    .iba-all-machines .iba-all-machines__results-header::after {
        min-width: 20px;
    }

    .iba-all-machines .iba-machine-list-card {
        display: block;
        min-height: 0;
    }

    .iba-all-machines .iba-machine-list-card__image {
        aspect-ratio: 16 / 10;
        min-height: 0;
        width: 100%;
    }

    .iba-all-machines .iba-machine-list-card__content {
        padding: 20px 18px;
    }

    .iba-all-machines .iba-machine-list-card__fact {
        gap: 12px;
        grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
    }

    .iba-all-machines .iba-machine-list-card__footer {
        padding-top: 18px;
    }

    .iba-all-machines .iba-machine-list-card__button {
        width: 100%;
    }

    .iba-all-machines .iba-all-machines__pagination .page-numbers {
        justify-content: center;
    }

    .iba-all-machines .iba-all-machines__pagination a.page-numbers,
    .iba-all-machines .iba-all-machines__pagination span.page-numbers {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 420px) {
    .iba-all-machines .iba-machine-list-card__fact {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}
