/* Substitution comparison modal */
#substitute-popup {
    z-index: 2400 !important;
    padding: 16px !important;
    font-family: "Inter", Arial, sans-serif;
    color: var(--wex-black, #111);
}

#substitute-popup.in {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

body.substitution-modal-open {
    overflow: hidden !important;
}

#substitute-popup .substitution__modal-dialog {
    width: min(1200px, calc(100vw - 32px)) !important;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: 0 auto;
}

#substitute-popup .modal-content {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border: 0;
    border-radius: 18px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
    overflow: hidden;
}

#substitute-popup .modal-header {
    min-height: 86px;
    padding: 21px 22px 7px;
    border: 0;
}

#substitute-popup .modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -1px 0 0;
    border-radius: 50%;
    color: #8d9098;
    background: #f1f2f5;
    opacity: 1;
    text-shadow: none;
    transition: color .15s ease, background-color .15s ease;
}

#substitute-popup .modal-header .close .material-symbols-rounded {
    font-size: 21px;
}

#substitute-popup .modal-header .close:hover,
#substitute-popup .modal-header .close:focus {
    color: #33363c;
    background: #e5e6ea;
    outline: 0;
}

#substitute-label {
    margin: 0 0 5px;
    border: 0;
    color: var(--wex-black, #111);
    font: 400 22px / 1.25 "Jost", Arial, sans-serif;
}

#substitute-popup .substitution__notice {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--wex-color-gray1, #636366);
    font: 400 14px / 1.4 "Inter", Arial, sans-serif!important;
}


#substitute-popup .substitution__notice .material-symbols-rounded {
    color: #111;
    font-size: 18px;
}

#substitute-popup .modal-body {
    padding: 13px 22px 22px;
}

#substitute-popup #substitute-body-content.substitute-body-content {
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    margin: 0;
    overflow: hidden;
}

#substitute-popup .substitution__loader {
    display: flex;
    min-height: 280px;
    align-items: center;
    justify-content: center;
    background: var(--wex-white, #fff);
}

#substitute-popup .substitution__loader::before {
    width: 30%;
    aspect-ratio: 78 / 38;
    flex: 0 0 auto;
    background: linear-gradient(100deg, var(--wex-color-f2f2f5, #f2f2f5) 25%, var(--wex-color-fcfcfd, #fcfcfd) 40%, var(--wex-color-f2f2f9, #f2f2f9) 55%);
    background-size: 200% 100%;
    content: "";
    -webkit-mask: url('../svg/wexler.svg') center / contain no-repeat;
    mask: url('../svg/wexler.svg') center / contain no-repeat;
    animation: wex-product-image-loading 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    #substitute-popup .substitution__loader::before {
        animation: none;
    }
}

#substitute-popup .substitute-row {
    flex: 0 0 auto;
    margin: 0 0 27px;
}

#substitute-popup .substitution-container {
    max-height: none;
    padding: 9px 10px;
    border: 1px solid #eff0f3;
    border-radius: 7px;
    background: #f3f3f6;
}

#substitute-popup .substitution-controls {
    display: block;
}

#substitute-popup .substitution__dropdown {
    position: relative;
    width: 100%;
}

#substitute-popup .substitution-select {
    display: block;
    width: 100%;
    height: 40px;
    padding: 8px 42px 8px 14px;
    border: 1px solid var(--wex-color-gray2, #d1d1d6);
    border-radius: 6px;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--wex-white, #fff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%23636366' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px 8px;
    color: var(--wex-black, #111);
    font: 400 16px/22px "Inter", Arial, sans-serif;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

#substitute-popup .substitution-select:hover {
    border-color: #aeb1b8;
}

#substitute-popup .substitution-select:focus {
    border-color: var(--wex-blue, #1261a0);
    box-shadow: 0 0 0 3px rgba(18, 97, 160, .12);
}

#substitute-popup .substitution-button-container {
    display: none;
}

#substitute-popup .select2-container {
    width: 100% !important;
    font-family: "Inter", Arial, sans-serif;
}

#substitute-popup .select2-container--bootstrap .select2-selection--single {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--wex-color-gray2, #d1d1d6);
    border-radius: 6px;
    background: var(--wex-white, #fff);
    font: 400 16px/22px "Inter", Arial, sans-serif;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

#substitute-popup .select2-container--bootstrap .select2-selection--single:hover {
    border-color: #aeb1b8;
}

#substitute-popup .select2-container--bootstrap.select2-container--focus .select2-selection,
#substitute-popup .select2-container--bootstrap.select2-container--open .select2-selection {
    border: 1px solid var(--wex-blue, #1261a0) !important;
    box-shadow: inset 0 0 0 1px var(--wex-blue, #1261a0) !important;
}

#substitute-popup .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: 0;
    color: var(--wex-black, #111)!important;
    line-height: 22px;
}

#substitute-popup .select2-selection__placeholder {
    color: var(--wex-color-gray1, #636366) !important;
}

#substitute-popup .select2-selection__arrow {
    top: 0;
    right: 10px;
    bottom: 0;
    width: 20px;
    height: auto;
}

#substitute-popup .select2-selection__arrow b { display: none; }
#substitute-popup .select2-selection__arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--wex-color-gray1, #636366);
    border-bottom: 2px solid var(--wex-color-gray1, #636366);
    transform: translate(-50%, -70%) rotate(45deg);
}
#substitute-popup .select2-container--open .select2-selection__arrow::before {
    transform: translate(-50%, -30%) rotate(225deg);
}
#substitute-popup .select2-dropdown {
    border: 1px solid var(--wex-color-gray2, #d1d1d6);
    border-radius: 6px;
    background: var(--wex-white, #fff);
    overflow: hidden;
    box-shadow: none;
    font: 400 16px/22px "Inter", Arial, sans-serif;
}
#substitute-popup .select2-container--open .select2-dropdown--below {
    margin-top: 6px;
}
#substitute-popup .select2-container--open .select2-dropdown--above {
    margin-top: -6px;
}
#substitute-popup .substitution__inline-selection {
    position: relative;
}
#substitute-popup .substitution__inline-search {
    position: absolute;
    z-index: 2;
    top: 1px;
    right: 34px;
    bottom: 1px;
    left: 12px;
    display: none;
    width: calc(100% - 46px);
    margin: 0;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    background: var(--wex-white, #fff) !important;
    box-shadow: none !important;
    color: var(--wex-black, #111);
    font: 400 16px/22px "Inter", Arial, sans-serif;
}
#substitute-popup .substitution__inline-search::placeholder {
    color: var(--wex-color-gray1, #636366);
    opacity: 1;
}
#substitute-popup .substitution__inline-selection--open .select2-selection__rendered {
    visibility: hidden;
}
#substitute-popup .substitution__inline-selection--open .substitution__inline-search {
    display: block;
}
#substitute-popup .substitution__inline-dropdown .select2-search--dropdown,
#substitute-popup .substitution__select-menu .select2-search--dropdown {
    display: none !important;
}
#substitute-popup .select2-results__options { max-height: 280px; }
#substitute-popup .select2-results__option {
    padding: 10px 12px;
    cursor: pointer;
}
#substitute-popup .select2-results__option[aria-selected=true] {
    color: var(--wex-blue, #1261a0);
    background: var(--wex-white, #fff);
}
#substitute-popup .select2-results__option--highlighted[aria-selected] {
    color: var(--wex-blue, #1261a0);
    background: var(--wex-color-gray3, #e7e7ea);
}

#substitute-popup .responsive-table {
    display: flex;
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    flex-direction: column;
    overflow: hidden;
}

#substitute-popup .substitution__table-frame {
    position: relative;
    display: flex;
    min-height: 0;
    max-width: 100%;
    flex: 1 1 auto;
}

#substitute-popup .substitution__table-frame::after {
    content: "";
    position: absolute;
    z-index: 7;
    top: 0;
    bottom: 10px;
    left: 400px;
    width: 10px;
    background: linear-gradient(90deg, rgba(0, 0, 0, .12), transparent);
    pointer-events: none;
}

#substitute-popup .substitution__table-scroll {
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    flex: 1 1 auto;
    overflow-x: scroll;
    overflow-y: auto;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    scrollbar-color: var(--wex-color-gray1, #63636a) var(--wex-color-gray3, #e7e7ea);
    scrollbar-width: thin;
    cursor: grab;
}

#substitute-popup .substitution__table-scroll.is-dragging,
#substitute-popup .substitution__table-scroll.is-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

#substitute-popup .substitution__table-scroll::-webkit-scrollbar {
    height: 10px;
}

#substitute-popup .substitution__table-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--wex-color-gray3, #e7e7ea);
}

#substitute-popup .substitution__table-scroll::-webkit-scrollbar-thumb {
    border: 2px solid var(--wex-color-gray3, #e7e7ea);
    border-radius: 999px;
    background: var(--wex-color-gray1, #63636a);
}

#substitute-popup .substitutuion-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #cfd1d8;
    border-radius: 7px;
    table-layout: fixed;
    overflow: visible;
}

#substitute-popup .substitutuion-table tr:first-child {
    height: 176px;
}

#substitute-popup .substitutuion-table td {
    box-sizing: border-box;
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    padding: 9px 10px;
    border: 0;
    border-right: 1px solid #d5d7dd;
    color: #242529;
    font-size: 16px;
    line-height: 1.4;
    text-align: left !important;
    vertical-align: middle !important;
}

#substitute-popup .substitutuion-table td:first-child {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    font-weight: 500;
}

#substitute-popup .substitutuion-table tr:not(.substitution__specification-heading) > td:first-child,
#substitute-popup .substitutuion-table tr:not(.substitution__specification-heading) > td:nth-child(2) {
    position: sticky;
}

#substitute-popup .substitutuion-table tr:not(.substitution__specification-heading) > td:first-child {
    left: 0;
    z-index: 4;
}

#substitute-popup .substitutuion-table tr:not(.substitution__specification-heading) > td:nth-child(2) {
    left: 150px;
    z-index: 3;
}

#substitute-popup .substitutuion-table td:last-child {
    border-right: 0;
}

#substitute-popup .substitutuion-table .substitution__description-row > td {
    vertical-align: top !important;
}

#substitute-popup .substitutuion-table tr:nth-child(even) {
    background: #f2f2f5;
}

#substitute-popup .substitutuion-table tr:nth-child(even) > td:first-child,
#substitute-popup .substitutuion-table tr:nth-child(even) > td:nth-child(2) {
    background: #f2f2f5;
}

#substitute-popup .substitutuion-table tr:nth-child(odd) {
    background: #fff;
}

#substitute-popup .substitutuion-table tr:nth-child(odd) > td:first-child,
#substitute-popup .substitutuion-table tr:nth-child(odd) > td:nth-child(2) {
    background: #fff;
}

#substitute-popup .substitutuion-table tr:first-child > td {
    background: #fff;
    vertical-align: top !important;
}

#substitute-popup .substitutuion-table tr:first-child > td:first-child,
#substitute-popup .substitutuion-table tr:first-child > td:nth-child(2) {
    z-index: 6;
}

#substitute-popup .substitutuion-table tr:first-child > td:first-child {
    background: #fff;
}

#substitute-popup .substitution__product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 155px;
}

#substitute-popup .substitution__drag {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    color: #111;
    font-size: 20px;
}

#substitute-popup .substitution__img-item {
    display: block;
    width: 100%;
    height: 102px;
    object-fit: contain;
}

#substitute-popup .substitution__product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

#substitute-popup .substitution__original {
    color: #17181b;
    font-size: 14px;
    font-weight: 600;
}

#substitute-popup .substitution__item-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#substitute-popup .substitution__product-link {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--wex-blue, #1261a0);
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}

#substitute-popup .substitution__product-link:hover,
#substitute-popup .substitution__product-link:focus {
    color: var(--wex-regular-btn-hover, #2053bb);
    background: var(--wex-color-gray3, #e7e7ea);
    text-decoration: none;
    outline: 0;
}

#substitute-popup .substitution__product-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(21, 82, 173, .18);
}

#substitute-popup .substitution__product-link .material-symbols-rounded {
    font-size: 18px;
}

#substitute-popup .substitution__product-actions .substitution__change {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 123px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 24px;
    border: 1px solid var(--wex-color-gray2, #d1d1d6);
    border-radius: 999px;
    color: var(--wex-blue, #1261a0);
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    font: 500 14px/1 "Jost", Arial, sans-serif;
    text-transform: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

#substitute-popup .substitution__product-actions .substitution__change:hover,
#substitute-popup .substitution__product-actions .substitution__change:focus {
    color: #fff;
    border-color: var(--wex-regular-btn-hover, #2053bb);
    background: var(--wex-regular-btn-hover, #2053bb);
    text-decoration: none;
    outline: 0;
}

#substitute-popup .substitution__change:focus-visible {
    box-shadow: 0 0 0 3px rgba(21, 82, 173, .18);
}

#substitute-popup .substitution__change:active {
    transform: translateY(1px);
}

#substitute-popup .substitution__product-actions .substitution__change.is-selected {
    color: #fff;
    border-color: var(--wex-regular-btn, #1a4398);
    background: var(--wex-regular-btn, #1a4398);
}

#substitute-popup .substitution__change.is-selected::before {
    content: "\2713";
    margin-right: 8px;
    font-size: 14px;
    line-height: 1;
}

#substitute-popup .substitution__rating {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#substitute-popup .substitution__product-actions .substitution__rate {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--wex-color-gray2, #d1d1d6);
    border-radius: 50%;
    color: var(--wex-color-gray1, #636366);
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

#substitute-popup .substitution__product-actions .substitution__rate:hover,
#substitute-popup .substitution__product-actions .substitution__rate:focus {
    color: #1552ad;
    border-color: #1552ad;
    outline: 0;
    transform: none;
}

#substitute-popup .substitution__rate:focus-visible {
    box-shadow: 0 0 0 3px rgba(21, 82, 173, .14);
}

#substitute-popup .substitution__rate:active {
    transform: translateY(1px);
}

#substitute-popup .substitution__rate .material-symbols-rounded {
    font-size: 18px;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

#substitute-popup .substitution__product-actions .substitution__like.is-active {
    border-color: #16a34a;
    color: #16a34a;
    background: #effbf2;
}

#substitute-popup .substitution__product-actions .substitution__like.is-active:hover,
#substitute-popup .substitution__product-actions .substitution__like.is-active:focus {
    border-color: #11813a;
    color: #11813a;
    background: #e5f8ea;
}

#substitute-popup .substitution__product-actions .substitution__dislike.is-active {
    border-color: #ef3038;
    color: #ef3038;
    background: #fff1f1;
}

#substitute-popup .substitution__product-actions .substitution__dislike.is-active:hover,
#substitute-popup .substitution__product-actions .substitution__dislike.is-active:focus {
    border-color: #d9232b;
    color: #d9232b;
    background: #ffe7e8;
}

#substitute-popup .substitution__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#substitute-popup .substitution__specification-heading td {
    padding: 9px 10px;
    color: #15161a;
    background: #f2f2f5 !important;
    font-weight: 600;
}

#substitute-popup .substitution__specification-heading-label {
    position: sticky;
    left: 10px;
    display: inline-block;
}

@media (max-width: 767px) {
    #substitute-popup {
        padding: 8px !important;
    }

    #substitute-popup .substitution__modal-dialog {
        width: calc(100vw - 16px) !important;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        margin: 0 auto;
    }

    #substitute-popup .modal-header,
    #substitute-popup .modal-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    #substitute-popup .modal-header {
        min-height: 90px;
    }

    #substitute-popup .substitution__notice {
        padding-right: 30px;
    }
}
