.compare-section {
    --compare-ink: #222;
    --compare-muted: #777;
    --compare-line: #e8e8e8;
    --compare-accent: #f10c33;
    margin: 32px 0 50px;
    color: var(--compare-ink);
}

.compare-heading {
    margin: 0 0 16px;
}

.compare-title {
    margin: 0 0 16px;
    color: #111;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.3;
}

.compare-table-wrap {
    overflow: auto;
    border: 1px solid var(--compare-line);
    border-radius: 8px;
    background: #fff;
    scrollbar-color: #bac4d1 #f4f6f8;
    scrollbar-width: thin;
}

.compare-table-wrap:focus-visible {
    outline: 3px solid rgba(241, 12, 51, .25);
    outline-offset: 3px;
}

.compare-table {
    width: 100%;
    min-width: 680px;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.compare-table th,
.compare-table td {
    width: 220px;
    padding: 16px 18px;
    border-right: 1px solid var(--compare-line);
    border-bottom: 1px solid var(--compare-line);
    text-align: center;
    vertical-align: middle;
}

.compare-table tr > :last-child {
    border-right: 0;
}

.compare-table tbody tr:last-child > * {
    border-bottom: 0;
}

.compare-table .compare-feature-heading,
.compare-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 190px;
    text-align: left;
}

.compare-table .compare-feature-heading {
    z-index: 3;
    background: #f7f7f7;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.compare-table tbody th {
    background: #f7f7f7;
    color: #333;
    font-size: 13px;
    font-weight: 650;
}

.compare-table tbody td {
    color: var(--compare-ink);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.compare-table tbody tr:nth-child(even) td {
    background: #f7f7f7;
}

.compare-table tbody tr:hover td {
    background: #fafafa;
}

.compare-table tbody tr:hover th {
    background: #f2f2f2;
}

.compare-table .compare-product-heading {
    padding: 24px 18px 20px;
    background: #fff;
}

.compare-product {
    position: relative;
    display: flex;
    min-height: 250px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.compare-product-link {
    display: grid;
    width: 100%;
    min-height: 180px;
    place-items: center;
    text-decoration: none;
}

.compare-product-image {
    display: block;
    width: min(100%, 180px);
    height: 180px;
    object-fit: contain;
    transition: transform .2s ease;
}

.compare-product-link:hover .compare-product-image {
    transform: translateY(-3px);
}

.compare-image-placeholder {
    display: grid;
    width: 140px;
    height: 140px;
    place-items: center;
    border-radius: 12px;
    background: #f3f5f7;
    color: var(--compare-muted);
    font-size: 12px;
}

.compare-product-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: var(--compare-ink);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.compare-product-name:hover {
    color: var(--compare-accent);
    text-decoration: underline;
}

.compare-current-label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff0f3;
    color: #f10c33;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.compare-price {
    color: #f10c33 !important;
    font-size: 17px !important;
    font-weight: 700;
}

.compare-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 650;
}

.compare-rating svg {
    width: 17px;
    height: 17px;
    fill: #f4b400;
}

.compare-extra-row {
    display: none;
}

.compare-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.compare-toggle-input:checked ~ .compare-table-wrap .compare-extra-row {
    display: table-row;
}

.compare-toggle {
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 18px auto 0;
    padding: 10px 18px;
    border: 1px solid #d7e0e5;
    border-radius: 4px;
    background: #fff;
    color: var(--compare-accent);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.compare-toggle:hover {
    transform: translateY(-1px);
    border-color: #a9c1c8;
    background: #f5fafb;
}

.compare-toggle-input:focus-visible + .compare-table-wrap + .compare-toggle {
    outline: 3px solid rgba(241, 12, 51, .25);
    outline-offset: 3px;
}

.compare-toggle-less {
    display: none;
}

.compare-toggle-input:checked ~ .compare-toggle .compare-toggle-more {
    display: none;
}

.compare-toggle-input:checked ~ .compare-toggle .compare-toggle-less {
    display: inline;
}

@media (max-width: 640px) {
    .compare-section {
        margin: 28px 0 40px;
    }

    .compare-table {
        min-width: 610px;
    }

    .compare-table th,
    .compare-table td {
        width: 190px;
        padding: 13px 14px;
    }

    .compare-table .compare-feature-heading,
    .compare-table tbody th {
        width: 150px;
    }

    .compare-table .compare-product-heading {
        padding: 18px 12px 16px;
    }

    .compare-product {
        min-height: 205px;
        gap: 8px;
    }

    .compare-product-link {
        min-height: 140px;
    }

    .compare-product-image {
        height: 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .compare-product-image,
    .compare-toggle {
        transition: none;
    }
}
