.add-product-to-compare-button {
    padding: 0.625rem;
}

.add-product-to-compare-button:hover {
    background-color: color-mix(in oklab, var(--clr-gray-200), transparent 75%);
}

.add-product-to-compare-button:is(.add-product-to-compare-button--active) {
    color: var(--clr-primary);
}

.add-product-to-compare-button > svg {
    width: 1.5rem;
}

.products-comparison-bar {
    --gap: 1.5rem;
    --product-size: 3.5rem;

    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-index-products-comparison-bar);
    background-color: var(--clr-gray-0);
    box-shadow: var(--box-shadow-top);
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
    height: calc(var(--product-size) + (2 * (var(--gap) / 3)));
}

.products-comparison-bar:is(.products-comparison-bar--active) {
    display: block;
}

.products-comparison-bar:is(.products-comparison-bar--hidden) {
    display: none;
}

.products-comparison-bar__content {
    display: flex;
    flex-wrap: nowrap;
    margin-left: auto;
    width: fit-content;
    padding: calc(var(--gap) / 3) calc(var(--gap) / 3) calc(var(--gap) / 3) 3rem;
    gap: var(--gap);
}

.products-comparison-bar__products {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.products-comparison-bar__buttons {
    height: var(--product-size);
    display: inline-flex;
    align-items: center;
    gap: calc(var(--gap) / 3);
}

.products-comparison-bar__button {
    --padding-vertical: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.products-comparison-bar__button::before {
    inset: -0.5rem;
}

.products-comparison-bar__button:is(.products-comparison-bar__button--clear) {
    --padding-horizontal: 0.75rem;
}

.products-comparison-bar__button > svg {
    height: 1.5rem;
}

.products-comparison-bar__button__text:is(.products-comparison-bar__button__text--products-count) {
    height: 1.5rem;
    display: grid;
    place-items: center;
    transform: translateY(-1px);
}

.products-comparison-bar-product-wrapper {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--gap) / 3);
}

.products-comparison-bar-product-wrapper:first-child {
    margin-left: auto;
}

.products-comparison-bar-product {
    position: relative;
    display: inline-block;
    height: var(--product-size);
    aspect-ratio: 1/1;
    border: 1px solid var(--clr-gray-100);
    border-radius: var(--br-sm);
}

.products-comparison-bar-product:hover .products-comparison-bar-product__image {
    transform: scale(1.25);
}

.products-comparison-bar-product__button {
    --size: 1rem;

    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    width: var(--size);
    height: var(--size);
    background-color: var(--clr-error-400);
    color: var(--clr-gray-0);
    border-radius: 100%;
    display: grid;
    place-items: center;
    padding: 0.125rem;
}

.products-comparison-bar-product__image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
}

.products-comparison-bar-product__image {
    height: auto;
    max-height: 75%;
    object-fit: cover;
    transition: transform var(--transition-duration) ease-in-out;
}

@media screen and (max-width: 500px) {
    .products-comparison-bar__content {
        width: 100%;
        padding: calc(var(--gap) / 3);
    }

    .products-comparison-bar__products {
        display: none;
    }

    .products-comparison-bar__buttons {
        flex: 1;
    }

    .products-comparison-bar__button:is(.products-comparison-bar__button--compare) {
        flex: 1;
    }
}