/* APS Parts Compare — compact workspace (mockup-aligned) */

.aps-compare-page {
    --aps-compare-ink: #163e42;
    --aps-compare-teal: #00666a;
    --aps-compare-muted: #718185;
    --aps-compare-pale: #eaf5f3;
    --aps-compare-line: #dfe8e7;
    --aps-compare-bg: #f4f7f6;
    --aps-compare-white: #fff;
    --aps-compare-mint: #00ffb5;
    --aps-compare-font-body: 'Roboto', sans-serif;
    --aps-compare-font-display: 'Wix Madefor Display', sans-serif;
    background: var(--aps-compare-bg);
    color: var(--aps-compare-ink);
    font-family: var(--aps-compare-font-body);
    font-size: 0.9375rem;
    line-height: 1.5;
    min-height: 70vh;
    padding-bottom: 8rem;
}

.aps-compare-page h1,
.aps-compare-page h2,
.aps-compare-page h3,
.aps-compare-page__title,
.aps-compare-empty__title,
.aps-compare-table__title,
.aps-compare-toolbar__label,
.aps-compare-table__group td {
    font-family: var(--aps-compare-font-display);
}

.aps-compare-page__shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

@media (min-width: 768px) {
    .aps-compare-page__shell {
        padding: 1.75rem 1.5rem 2.5rem;
    }
}

.aps-compare-back {
    margin: 0 0 0.85rem;
}

.aps-compare-back__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--aps-compare-teal);
    font-family: var(--aps-compare-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.aps-compare-back__link:hover {
    text-decoration: underline;
    color: #004d4f;
}

.aps-compare-crumb {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--aps-compare-muted);
}

.aps-compare-crumb__link {
    color: var(--aps-compare-teal);
    font-weight: 600;
    text-decoration: none;
}

.aps-compare-crumb__link:hover {
    text-decoration: underline;
}

.aps-compare-crumb__sep {
    margin: 0 0.35rem;
    color: #9aa8ab;
}

.aps-compare-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.aps-compare-page__title {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--aps-compare-ink);
}

.aps-compare-page__subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.875rem;
    color: var(--aps-compare-muted);
    max-width: 38rem;
}

.aps-compare-btn {
    border: 1px solid var(--aps-compare-line);
    background: #fff;
    color: var(--aps-compare-ink);
    border-radius: 9px;
    padding: 0.6rem 1rem;
    font-family: var(--aps-compare-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.aps-compare-btn:hover {
    border-color: #82aaa7;
    background: #f2f8f7;
}

.aps-compare-btn--secondary {
    background: #fff;
}

.aps-compare-workspace {
    background: var(--aps-compare-white);
    border: 1px solid var(--aps-compare-line);
    border-radius: 16px;
    padding: 1.1rem 1rem 1.25rem;
    box-shadow: 0 5px 20px rgba(36, 67, 61, 0.03);
}

@media (min-width: 768px) {
    .aps-compare-workspace {
        padding: 1.5rem 1.5rem 1.6rem;
    }
}

.aps-compare-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 0.65rem;
    padding-top: 1rem;
    border-top: 1px solid var(--aps-compare-line);
    font-size: 0.875rem;
}

.aps-compare-toolbar__label {
    font-weight: 700;
    color: var(--aps-compare-ink);
    font-size: 0.9375rem;
}

.aps-compare-toolbar__muted {
    font-family: var(--aps-compare-font-body);
    font-weight: 500;
    color: var(--aps-compare-muted);
}

.aps-compare-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.aps-compare-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: #536d6c;
    font-weight: 500;
    font-size: 0.875rem;
}

.aps-compare-diff-toggle input {
    accent-color: var(--aps-compare-teal);
}

.aps-compare-link-btn {
    border: 0;
    background: transparent;
    color: var(--aps-compare-teal);
    text-decoration: underline;
    font-family: var(--aps-compare-font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.aps-compare-scroll-hint {
    display: none;
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    color: #789089;
}

@media (max-width: 700px) {
    .aps-compare-scroll-hint {
        display: block;
    }
}

.aps-compare-fineprint {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--aps-compare-muted);
}

/* Empty */
.aps-compare-empty {
    background: #f6f8f7;
    border: 1px dashed #bccfc7;
    border-radius: 12px;
    padding: 2.75rem 1.25rem;
    text-align: center;
}

.aps-compare-empty__icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aps-compare-pale);
    color: var(--aps-compare-teal);
}

.aps-compare-empty__title {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.aps-compare-empty__text {
    margin: 0 auto 1.1rem;
    max-width: 26rem;
    font-size: 0.9375rem;
    color: var(--aps-compare-muted);
}

.aps-compare-empty__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.aps-compare-empty__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: var(--aps-compare-teal);
    color: #fff;
    border-radius: 9999px;
    padding: 0.7rem 1.2rem;
    font-family: var(--aps-compare-font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.aps-compare-empty__secondary:hover {
    opacity: 0.92;
    color: #fff;
}

.aps-compare-empty__secondary[hidden] {
    display: none !important;
}

/* Compact table */
.aps-compare-table-wrap {
    overflow: auto;
    border: 1px solid var(--aps-compare-line);
    border-radius: 11px;
    background: #fbfcfb; /* fills rounded-corner slits behind sticky labels */
    -webkit-overflow-scrolling: touch;
}

.aps-compare-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
    min-width: 740px;
    font-family: var(--aps-compare-font-body);
    font-size: 0.875rem;
}

.aps-compare-table[data-cols="1"] { min-width: 420px; }
.aps-compare-table[data-cols="2"] { min-width: 620px; }
.aps-compare-table[data-cols="3"] { min-width: 820px; }

.aps-compare-table th,
.aps-compare-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e9eeec;
    border-right: 1px solid #edf1ef;
}

.aps-compare-table th:last-child,
.aps-compare-table td:last-child {
    border-right: 0;
}

.aps-compare-table tr:last-child td,
.aps-compare-table tr:last-child th {
    border-bottom: 0;
}

.aps-compare-table__attr-head,
.aps-compare-table__attr {
    width: 11rem;
    background: #fbfcfb;
    color: #748580;
    font-weight: 400;
    font-size: 0.8125rem;
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 3px rgba(25, 62, 64, 0.04);
}

.aps-compare-table__attr-head::before,
.aps-compare-table__attr::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    right: -2px;
    background: inherit;
    z-index: -1;
    pointer-events: none;
}

.aps-compare-table__attr-head {
    background: #fff;
    vertical-align: top;
    height: 1px; /* fill header row height with part cards */
    padding: 1rem 0.75rem;
    font-family: var(--aps-compare-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--aps-compare-ink);
}

.aps-compare-table__attr-head-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    height: 100%;
    min-height: 100%;
}

.aps-compare-table__attr-head-copy {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    /* Match cart button block so label sits on the same baseline */
    min-height: 2.5rem;
    justify-content: center;
}

.aps-compare-table__attr-head-title {
    display: block;
    line-height: 1.3;
    color: var(--aps-compare-ink);
    font-weight: 600;
}

.aps-compare-table__attr-sub {
    display: block;
    color: var(--aps-compare-muted);
    font-family: var(--aps-compare-font-body);
    font-weight: 400;
    font-size: 0.75rem;
    line-height: 1.3;
}

.aps-compare-table__group td {
    background: #f2f6f4;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.55rem 0.75rem;
    color: #50736e;
}

.aps-compare-table__group td:first-child {
    position: static;
    box-shadow: none;
}

.aps-compare-table__col-head {
    background: #fff;
    font-weight: 400;
    padding: 1rem 0.75rem;
    vertical-align: top;
    height: 1px; /* lets head-card fill equal-height table cells */
}

.aps-compare-table__head-card {
    position: relative;
    padding-right: 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 100%;
}

.aps-compare-table__remove {
    position: absolute;
    right: -0.15rem;
    top: -0.2rem;
    width: 1.55rem;
    height: 1.55rem;
    border: 0;
    background: transparent;
    color: #84938f;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}

.aps-compare-table__remove:hover {
    color: var(--aps-compare-ink);
}

.aps-compare-table__head-top {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding-right: 1.35rem;
    margin-bottom: 0.45rem;
}

.aps-compare-table__thumb-link {
    display: inline-flex;
    flex-shrink: 0;
    margin-bottom: 0;
}

.aps-compare-table__thumb {
    width: 3.3rem;
    height: 2.8rem;
    object-fit: cover;
    border-radius: 7px;
    background: #f2f5f4;
}

.aps-compare-table__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #93a7a1;
    font-size: 0.95rem;
}

.aps-compare-table__head-identity {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.1rem;
}

.aps-compare-table__title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--aps-compare-ink);
    text-decoration: none;
    line-height: 1.3;
}

.aps-compare-table__title:hover {
    color: var(--aps-compare-teal);
}

.aps-compare-table__ymm {
    margin: 0;
    font-size: 0.7rem;
    color: var(--aps-compare-muted);
    line-height: 1.3;
}

.aps-compare-table__yard {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--aps-compare-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.aps-compare-table__head-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.55rem;
}

.aps-compare-head-warranty {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aps-compare-head-warranty__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--aps-compare-muted);
}

.aps-compare-warranty-select {
    width: 100%;
    border: 1px solid var(--aps-compare-line);
    border-radius: 8px;
    background: var(--aps-compare-white);
    color: var(--aps-compare-ink);
    font-family: var(--aps-compare-font-body);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    padding: 0.45rem 0.55rem;
    min-height: 2.25rem;
}

.aps-compare-warranty-select:focus {
    outline: 2px solid rgba(0, 102, 106, 0.25);
    border-color: var(--aps-compare-teal);
}

.aps-compare-cart-btn {
    width: 100%;
    margin-top: 0;
    border: 1px solid var(--aps-compare-teal);
    background: var(--aps-compare-teal);
    color: #fff;
    border-radius: 9px;
    padding: 0.55rem 0.7rem;
    font-family: var(--aps-compare-font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 2.5rem;
}

.aps-compare-cart-btn:hover {
    opacity: 0.92;
}

.aps-compare-cart-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.aps-compare-table__row.is-diff .aps-compare-table__attr,
.aps-compare-table__row.is-diff .aps-compare-table__cell {
    background: #f3f9f8;
}

.aps-compare-table__value,
.aps-compare-price,
.aps-compare-money,
.aps-compare-grade,
.aps-compare-status {
    font-weight: 600;
    color: var(--aps-compare-ink);
}

.aps-compare-table__muted {
    color: var(--aps-compare-muted);
}

.aps-compare-table__empty-diff {
    text-align: center;
    color: var(--aps-compare-muted);
    padding: 1.25rem !important;
}

.aps-compare-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.aps-compare-pill--yes {
    color: #1f6b4a;
}

.aps-compare-pill--no {
    color: #748580;
}

.aps-compare-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.aps-compare-winner-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    min-height: 1.35rem;
}

.aps-compare-winner-row--head {
    margin: 0.45rem 0;
    flex-shrink: 0;
}

.aps-compare-winner {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    background: var(--aps-compare-pale);
    color: var(--aps-compare-teal);
}

.aps-compare-warranty-cell {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: left;
}

.aps-compare-warranty-cell__selected {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--aps-compare-ink);
}

.aps-compare-warranty-extras {
    border: 1px dashed #c5d6d2;
    border-radius: 8px;
    background: #f8fbfa;
    padding: 0.55rem 0.6rem;
}

.aps-compare-warranty-extras__title {
    margin: 0 0 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--aps-compare-muted);
}

.aps-compare-warranty-extras__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.aps-compare-warranty-extras__btn {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    padding: 0.3rem 0.35rem;
    text-align: left;
    cursor: pointer;
    font-family: var(--aps-compare-font-body);
}

.aps-compare-warranty-extras__btn:hover {
    background: #fff;
    border-color: var(--aps-compare-line);
}

.aps-compare-warranty-extras__item.is-selected .aps-compare-warranty-extras__btn {
    background: #fff;
    border-color: var(--aps-compare-teal);
}

.aps-compare-warranty-extras__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--aps-compare-ink);
    line-height: 1.35;
}

.aps-compare-warranty-extras__fee {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--aps-compare-teal);
    white-space: nowrap;
}

@media (max-width: 700px) {
    .aps-compare-title-row {
        align-items: center;
        gap: 0.65rem;
    }

    .aps-compare-page__title {
        font-size: 1.5rem;
    }

    .aps-compare-page__subtitle {
        font-size: 0.8125rem;
        max-width: 14rem;
    }

    .aps-compare-btn {
        font-size: 0.8125rem;
        padding: 0.55rem 0.75rem;
    }

    .aps-compare-workspace {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }

    .aps-compare-table-wrap {
        container-type: inline-size;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 7.75rem;
    }

    .aps-compare-table,
    .aps-compare-table[data-cols="1"],
    .aps-compare-table[data-cols="2"],
    .aps-compare-table[data-cols="3"] {
        /* Column widths drive table size — one part fills the visible area */
        min-width: 0;
        width: max-content;
    }

    .aps-compare-table__attr-head,
    .aps-compare-table__attr {
        width: 7.75rem;
        min-width: 7.75rem;
        max-width: 7.75rem;
        font-size: 0.8125rem;
    }

    /* Exactly one part column visible beside sticky labels */
    .aps-compare-table__col-head,
    .aps-compare-table__cell {
        width: calc(100cqw - 7.75rem);
        min-width: calc(100cqw - 7.75rem);
        max-width: calc(100cqw - 7.75rem);
        box-sizing: border-box;
    }

    .aps-compare-table__col-head {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* Header compare control */
.aps-header-compare {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none;
}

.aps-header-compare:hover {
    background: rgba(0, 255, 181, 0.25);
    color: #fff;
}

.aps-header-compare:focus-visible {
    outline: 2px solid var(--aps-compare-mint);
    outline-offset: 2px;
}

.aps-header-compare__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 9999px;
    background: #00ffb5;
    color: #002d2f;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #054f59;
}

.aps-header-compare--solid {
    background: #00ffb5;
    color: #002d2f;
}

.aps-header-compare--solid:hover {
    background: #00d4a8;
    color: #002d2f;
}

.aps-header-compare--solid .aps-header-compare__badge {
    box-shadow: 0 0 0 2px rgba(0, 45, 47, 0.12);
}

/* Listing / PDP toggle — soft checkbox + label */
.aps-compare-toggle {
    --aps-compare-check: #00b894;
    --aps-compare-check-ink: #005c5f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: auto;
    height: auto;
    min-height: 2.05rem;
    padding: 0.32rem 0.7rem 0.32rem 0.38rem;
    border-radius: 0.6rem;
    border: 1px solid #c5d4d6;
    background: #fff;
    color: #3d5a5d;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 1px rgba(0, 45, 47, 0.03);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.aps-compare-toggle:hover {
    background: #f6fbfa;
    border-color: #8fb0b3;
    color: #004d4f;
    box-shadow: 0 1px 4px rgba(0, 77, 79, 0.07);
}

.aps-compare-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 196, 160, 0.28);
}

.aps-compare-toggle:disabled,
.aps-compare-toggle.pointer-events-none {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.aps-compare-toggle:disabled:hover,
.aps-compare-toggle.pointer-events-none:hover {
    background: #fff;
    border-color: #c5d4d6;
    color: #3d5a5d;
}

.aps-compare-toggle.is-in-compare {
    background: #eefaf6;
    border-color: #7dccb8;
    color: #005c5f;
    box-shadow: 0 1px 2px rgba(0, 184, 148, 0.1);
}

.aps-compare-toggle.is-in-compare:hover {
    background: #e4f7f0;
    border-color: #00b894;
}

.aps-compare-toggle.is-in-compare:disabled:hover,
.aps-compare-toggle.is-in-compare.pointer-events-none:hover {
    background: #e9faf5;
}

.aps-compare-toggle__box {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    border-radius: 0.28rem;
    border: 1.5px solid #7a9497;
    background: #fff;
    box-shadow: none;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.16s ease;
}

.aps-compare-toggle__box::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2L6.4 11.1L12.5 4.8' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% 80% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2L6.4 11.1L12.5 4.8' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% 80% no-repeat;
    opacity: 0;
    transform: scale(0.65);
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1.15);
}

.aps-compare-toggle:hover .aps-compare-toggle__box {
    border-color: #00666a;
}

.aps-compare-toggle.is-in-compare .aps-compare-toggle__box {
    background: var(--aps-compare-check);
    border-color: #00a884;
    box-shadow: 0 1px 2px rgba(0, 168, 132, 0.25);
    transform: none;
}

.aps-compare-toggle.is-in-compare .aps-compare-toggle__box::after {
    opacity: 1;
    transform: scale(1);
}

.aps-compare-toggle__icon {
    display: none;
}

.aps-compare-toggle__label {
    display: inline;
    line-height: 1.1;
    font-weight: 500;
    color: inherit;
}

.aps-compare-toggle.is-in-compare .aps-compare-toggle__label {
    font-weight: 600;
}

/* Header compare fitment tip — anchor right so it grows left (Options-style, no viewport clip) */
.aps-compare-fitment-tooltip {
    left: auto !important;
    right: 0 !important;
    width: auto !important;
    max-width: min(14rem, calc(100vw - 1.5rem));
    transform: none !important;
    white-space: nowrap;
    z-index: 30;
}

/* PDP summary bar — full-width soft checkbox control */
.aps-compare-toggle--pdp {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 1.15rem;
    gap: 0.55rem;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid #c5d4d6;
    background: #fff;
    color: #3d5a5d;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 1px 1px rgba(0, 45, 47, 0.03);
}

.aps-compare-toggle--pdp .aps-compare-toggle__box {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.3rem;
}

.aps-compare-toggle--pdp:hover {
    background: #f6fbfa;
    border-color: #8fb0b3;
}

.aps-compare-toggle--pdp.is-in-compare {
    background: #eefaf6;
    border-color: #7dccb8;
    color: #005c5f;
    box-shadow: 0 1px 2px rgba(0, 184, 148, 0.1);
}

.aps-compare-toggle--pdp.is-in-compare:hover {
    background: #e4f7f0;
}

.listing-card-actions {
    flex-wrap: wrap;
}

/* Edit / swap modal */
body.aps-compare-replace-open {
    overflow: hidden;
}

.aps-compare-replace {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.aps-compare-replace.is-open {
    opacity: 1;
    pointer-events: auto;
}

.aps-compare-replace__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 45, 47, 0.45);
}

.aps-compare-replace__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    max-height: min(88vh, 40rem);
    overflow: auto;
    background: #fff;
    border-radius: 1.25rem 1.25rem 1rem 1rem;
    box-shadow: 0 18px 50px rgba(0, 45, 47, 0.22);
    padding: 1.25rem 1.25rem 1rem;
    transform: translateY(0.75rem);
    transition: transform 0.22s ease;
}

.aps-compare-replace.is-open .aps-compare-replace__panel {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .aps-compare-replace {
        align-items: center;
    }

    .aps-compare-replace__panel {
        border-radius: 1.25rem;
        transform: translateY(0) scale(0.98);
    }

    .aps-compare-replace.is-open .aps-compare-replace__panel {
        transform: translateY(0) scale(1);
    }
}

.aps-compare-replace__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: #f3f6f6;
    color: #5b6b6e;
    cursor: pointer;
}

.aps-compare-replace__close:hover {
    background: #e8efef;
    color: #002d2f;
}

.aps-compare-replace__title {
    margin: 0 2rem 0.35rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #002d2f;
}

.aps-compare-replace__lead {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #5b6b6e;
}

.aps-compare-replace__lead strong {
    color: #004d4f;
    font-weight: 600;
}

.aps-compare-replace__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.aps-compare-replace__card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border: 1px solid rgba(0, 45, 47, 0.08);
    border-radius: 0.9rem;
    background: #f7fafa;
}

.aps-compare-replace__thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.65rem;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8f0f0;
}

.aps-compare-replace__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a9a9c;
    font-size: 0.95rem;
}

.aps-compare-replace__meta {
    flex: 1;
    min-width: 0;
}

.aps-compare-replace__slot {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #004d4f;
    margin-bottom: 0.1rem;
}

.aps-compare-replace__name {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #002d2f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-compare-replace__ymm {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: #5b6b6e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-compare-replace__swap {
    flex-shrink: 0;
    border: none;
    border-radius: 9999px;
    background: #004d4f;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

.aps-compare-replace__swap:hover {
    background: #003a3c;
}

.aps-compare-replace__swap--remove {
    background: #fff;
    color: #004d4f;
    border: 1px solid rgba(0, 77, 79, 0.28);
}

.aps-compare-replace__swap--remove:hover {
    background: #f3f6f6;
    color: #002d2f;
}

.aps-compare-replace__cancel {
    display: block;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.7rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #5b6b6e;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.aps-compare-replace__cancel:hover {
    color: #002d2f;
    background: #f3f6f6;
}

/* Floating selection tray */
#aps-compare-tray-host {
    position: relative;
    z-index: 55;
}

.aps-compare-tray {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 55;
    width: min(1000px, calc(100% - 1.5rem));
    background: #fff;
    border: 1px solid #cbdcd7;
    box-shadow: 0 8px 38px rgba(22, 62, 66, 0.11);
    border-radius: 13px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 65dvh;
    overflow-x: visible;
    overflow-y: auto;
}

body.aps-home-sticky-nav.aps-bottom-nav-visible .aps-compare-tray {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

.aps-compare-tray__summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow: visible;
}

.aps-compare-tray__toggle {
    border: 0;
    background: transparent;
    padding: 0.2rem 0.15rem 0.15rem 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-align: left;
    min-width: 0;
    flex: 1;
    cursor: pointer;
    color: inherit;
    overflow: visible;
}

.aps-compare-tray__icon-wrap {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    overflow: visible;
}

.aps-compare-tray__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 9px;
    background: #eaf5f3;
    color: #00666a;
    overflow: visible;
}

.aps-compare-tray__badge {
    position: absolute;
    right: -0.35rem;
    top: -0.35rem;
    z-index: 2;
    box-sizing: border-box;
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    min-height: 1.15rem;
    max-width: 1.15rem;
    max-height: 1.15rem;
    padding: 0;
    margin: 0;
    border-radius: 9999px;
    background: #00666a;
    color: #fff;
    border: 2px solid #fff;
    font-size: 0.5625rem;
    font-style: normal;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    line-height: 1;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.aps-compare-tray__copy b {
    display: block;
    font-size: 0.75rem;
    color: #163e42;
}

.aps-compare-tray__copy small {
    display: block;
    font-size: 0.625rem;
    color: #718185;
    margin-top: 0.1rem;
}

.aps-compare-tray__mobile-hint {
    display: none;
}

.aps-compare-tray__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex-shrink: 0;
}

.aps-compare-tray__edit,
.aps-compare-tray__view {
    border-radius: 9px;
    padding: 0.45rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
}

.aps-compare-tray__edit {
    border: 1px solid #00666a;
    background: #00666a;
    color: #fff;
}

.aps-compare-tray__edit:hover {
    opacity: 0.92;
}

.aps-compare-tray__view {
    border: 1px solid #dfe8e7;
    background: #fff;
    color: #163e42;
}

.aps-compare-tray__view:hover {
    background: #f2f8f7;
}

.aps-compare-tray__items {
    display: flex;
    gap: 0.55rem;
    margin-top: 0;
    overflow: auto;
    max-height: 40dvh;
    min-width: 0;
}

@media (min-width: 701px) {
    .aps-compare-tray {
        flex-direction: row;
        align-items: center;
        gap: 0.85rem;
    }

    .aps-compare-tray__summary {
        display: contents;
    }

    .aps-compare-tray__toggle {
        flex: 0 0 auto;
        min-width: 9.5rem;
        max-width: 11rem;
        cursor: default;
    }

    .aps-compare-tray__items {
        display: flex !important;
        flex: 1 1 auto;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        order: 2;
        min-width: 0;
    }

    .aps-compare-tray__actions {
        order: 3;
        min-width: 7.75rem;
    }
}

.aps-compare-tray__item {
    flex: 1 1 0;
    min-width: 11.5rem;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) 1.35rem;
    align-items: center;
    column-gap: 0.55rem;
    background: #f3f6f4;
    border-radius: 8px;
    padding: 0.5rem 0.45rem 0.5rem 0.5rem;
}

.aps-compare-tray__thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.45rem;
    flex-shrink: 0;
    overflow: hidden;
    background: #e8f0f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.aps-compare-tray__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aps-compare-tray__thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #8ca4a3;
    font-size: 0.85rem;
}

.aps-compare-tray__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.aps-compare-tray__name,
.aps-compare-tray__meta b {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #163e42;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-compare-tray__sub,
.aps-compare-tray__meta small {
    display: block;
    width: 100%;
    font-size: 0.625rem;
    color: #718185;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-compare-tray__price,
.aps-compare-tray__meta strong {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #163e42;
    line-height: 1.25;
}

.aps-compare-tray__remove {
    border: 0;
    background: transparent;
    color: #82908d;
    font-size: 1.05rem;
    width: 1.35rem;
    height: 1.75rem;
    cursor: pointer;
    flex-shrink: 0;
    align-self: start;
    padding: 0;
    line-height: 1;
}

@media (max-width: 700px) {
    .aps-compare-tray__badge {
        width: 1.2rem;
        height: 1.2rem;
        min-width: 1.2rem;
        min-height: 1.2rem;
        max-width: 1.2rem;
        max-height: 1.2rem;
        border-radius: 9999px;
    }

    .aps-compare-tray__mobile-hint {
        display: inline;
    }

    .aps-compare-tray__items {
        display: none;
        flex-direction: column;
    }

    .aps-compare-tray.is-expanded .aps-compare-tray__items {
        display: flex;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #dfe8e7;
    }

    .aps-compare-tray__item {
        min-width: 0;
        flex: none;
    }

    .aps-compare-tray__meta small {
        max-width: none;
    }
}

body.aps-compare-tray-visible .aps-compare-page {
    padding-bottom: calc(var(--aps-compare-tray-space, 9rem) + 1rem);
}

/* Part detail + listing: scroll clearance so tray does not cover fitment / last cards */
body.aps-compare-tray-visible .part-detail-wrapper,
body.aps-compare-tray-visible .parts-main {
    padding-bottom: calc(var(--aps-compare-tray-space, 8rem) + 1.25rem) !important;
}

body.aps-compare-tray-visible.aps-compare-tray-footer-hidden .part-detail-wrapper,
body.aps-compare-tray-visible.aps-compare-tray-footer-hidden .parts-main,
body.aps-compare-tray-visible.aps-compare-tray-footer-hidden .aps-compare-page {
    padding-bottom: 1.5rem !important;
}

/* Mobile/tablet: tuck tray away when footer is in view (no footer padding hacks) */
@media (max-width: 1024px) {
    .aps-compare-tray.aps-compare-tray--footer-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Ghost host for Options modal on /compare (off-screen; keeps breakdown data for InStorePickup) */
.aps-compare-fulfillment-ghost {
    position: absolute !important;
    left: -9999px !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Fulfillment option cards (modal) — compare page does not load part-listing.css */
.aps-fulfillment-option-cards {
    width: 100%;
}

.aps-fulfillment-option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aps-fulfillment-option-card:hover:not(:disabled) {
    border-color: #9fd4cf;
}

.aps-fulfillment-option-card.is-selected {
    border-color: #00f5c4;
    box-shadow: 0 0 0 1px rgba(0, 245, 196, 0.35);
}

.aps-fulfillment-option-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aps-fulfillment-option-card__radio {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    border: 2px solid #b8e8df;
    border-radius: 9999px;
    background: #fff;
    position: relative;
}

.aps-fulfillment-option-card.is-selected .aps-fulfillment-option-card__radio {
    border-color: #00c9a0;
}

.aps-fulfillment-option-card.is-selected .aps-fulfillment-option-card__radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 9999px;
    background: #00c9a0;
}

.aps-fulfillment-option-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.aps-fulfillment-option-card__label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #004d4f;
}

.aps-fulfillment-option-card__detail {
    font-size: 0.75rem;
    line-height: 1.35;
    color: #6b7280;
}

.js-fulfillment-options-add-to-cart:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
