.dealers-stocks-link
{
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    line-height: 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Helvetica Neue', sans-serif;

    margin-top: 32px;
}

.stocks-button {
    border: 0;
    color: var(--color-link-blue);
    font-size: 16px;
    font-weight: 400;
    text-decoration: underline;
}

.stocks-button:focus-visible {
    outline: 1px dashed var(--color-link-blue);
    outline-offset: 2px;
}

.stocks-drawer-container {
    inset: 0 0 0 0;
    position: fixed;
    background-color: #00000000;
    display: none;
    transition: background-color 0.3s;
    z-index: 20;
}

.stocks-drawer-content.empty {
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-base);

    .stocks-drawer-body {
        display: none;
    }

    .css-spinner {
        display: block;
    }
}

.stocks-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;

    > h2 {
        font-size: 20px;
        font-weight: 500;
        line-height: 24px;
        padding: 50px 50px 0;
    }
}

.stocks-drawer-content {
    inset: 0 0 0 auto;
    width: 991px;
    position: fixed;
    transform: translateX(100%);
    transition: transform .3s;
    background-color: #fff;
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 50px;

    color: var(--color-text-primary);

    display: flex;
    flex-direction: column;

    .css-spinner {
        display: none;
    }


    .close-button {
        width: 20px;
        height: 20px;
        position: fixed;
        inset: 16px 16px auto auto;
        display: flex;
        justify-content: center;
        align-items: center;

        &:focus-visible {
            outline: 1px dashed var(--color-link-blue);
            outline-offset: 2px;
        }
    }
}

.stocks-drawer-container.open {
    background-color: #00000050;

    .stocks-drawer-content {
        transform: translateX(0);
    }
}

.stocks-drawer-aside {
    display: flex;
    gap: 16px;
    position: sticky;
    background-color: #fff;
    top: 0;
    padding: 16px 50px;
    z-index: 10;

    &.stuck {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

.stocks-view-mode {
    border: 1px solid var(--color-light-grey);
    border-radius: 500px;
    width: 80px;
    height: 44px;
    padding: 3px;
    cursor: pointer;
    position: relative;

    label {
        display: flex;
        justify-content: space-between;
        align-items: center;
        pointer-events: none;
    }

    .indicator {
        position: absolute;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: #6CC9F2;
        left: calc(50% - 18px);
        top: 3px;
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(-50%);
        transition: transform 0.3s;
    }

    input[type=checkbox]:checked ~ .indicator {
        transform: translateX(50%);
    }

    svg {
        border-radius: 500px;
        width: 36px;
        height: 36px;
        color: var(--color-dark-grey);
        transition: color 0.3s;
        z-index: 2;

        rect {
            fill: none;
        }
    }

    svg.active {
        color: #fff;
    }

    &:focus-visible {
        outline: 1px dashed var(--color-link-blue);
        outline-offset: 2px;
    }
}

.stocks-dropdown {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
    border: 1px solid var(--color-light-grey);
    font-size: 14px;
    font-weight: 400;
    position: relative;

    input, button {
        border: 0;
        height: 20px;
    }

    &.city {
        width: 240px;

        button {
            width: 100%;
            height: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 0;

            &:focus-visible {
            / / @todo: не забывай про клавиатурную навигацию !
            }

            svg {
                transition: transform .3s;
            }
        }

        button:has(+ .visible) {
            svg {
                transform: rotate(180deg);
            }
        }
    }

    &.dealer {
        width: 348px;
    }
}

.stocks-available-button {
    width: 175px;
    height: 44px;
    border-radius: 500px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--color-light-grey);
    color: var(--color-dark-grey);
    font-size: 14px;

    svg path:last-child {
        stroke: #ffffff00;
    }

    &.active {
        display: flex;
        color: var(--color-text-primary);
        /*border-color: #6CC9F2;*/
        /*color: #6CC9F2;*/

        svg path:last-child {
            stroke: var(--color-text-primary);
        }
    }
}

.stocks-tab {
    &[hidden] {
        display: none;
    }
}

.stocks-dealers-table {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.stocks-dealers-map {
    position: relative;
    padding: 8px 50px 0;
    display: block;
    flex: 1;

    .ymaps {
        width: 100%;
        height: 100%;
    }
}

.stocks-dealer-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
    border-right: 1px solid var(--color-light-grey);
    border-top: 1px solid var(--color-light-grey);

    &:nth-last-of-type(1), &:nth-last-of-type(2), &:nth-last-of-type(3) {
        border-bottom: 1px solid var(--color-light-grey);
    }

    &:nth-of-type(3n + 1) {
        border-left: 1px solid var(--color-light-grey);
    }

    .close {
        display: none;
        position: absolute;
        top: 8px;
        right: 8px;
        cursor: pointer;
        color: #B9B9B9;
        border: none;
        font-size: 16px;
    }

    .card-header {
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        gap: 4px;

        & > div {
            display: flex;
            justify-content: space-between;
            gap: 6px;
        }

        h3 {
            flex: 1;
            font-weight: 700;
            font-size: 14px;
            line-height: 20px;
        }

        .lut {
            font-size: 12px;
            grid-column: 1 / -1;
            color: var(--color-link-blue);
            border: 0;
        }
    }

    .info {
        display: grid;
        grid-template-columns: 16px 1fr;
        grid-column-gap: 8px;
        grid-row-gap: 10px;

        span {
            line-height: 16px;
        }
    }

    .card-footer {
        display: flex;
        flex-direction: column;
        gap: 4px;

        .av {
            font-weight: 500;
            color: var(--color-green);
            line-height: 17px;

            &.av-empty {
                color: #B9B9B9
            }
        }

        .compl {
            font-size: 12px;
            line-height: 14px;
            color: var(--color-dark-grey);
        }
    }
}

.stocks-dealer-card.stocks-dealer-card-map {
    position: absolute;
    top: 198px;
    background: #fff;
    right: 74px;
    border-radius: 16px;
    border: unset;
    width: 297px;
    /*max-height: 266px;*/
    /*z-index: 11;*/
    opacity: 0;
    transition: opacity 0.3s;

    &.hidden {
        display: none;
    }

    &.visible {
        opacity: 1;
    }

    .card-header {
        grid-template-columns: auto 20px 20px;
    }

    .close {
        display: block;
    }
}

.stocks-dropdown-select-wrapper {
    position: absolute;
    flex-direction: column;
    inset: 50px 0 auto 0;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07),
    0 25px 25px rgba(0, 0, 0, 0.06),
    0 57px 34px rgba(0, 0, 0, 0.03),
    0 102px 41px rgba(0, 0, 0, 0.01);

    transform: translateY(-50%) scaleY(0);
    transition: transform 0.3s;
    display: none;
    background: #fff;
    overflow-y: scroll;
    z-index: 5;

    &.visible {
        transform: translateY(0) scaleY(100%);
    }

    & > div {
        position: sticky;
        inset: 0;
        padding: 16px 16px 12px 16px;
        background: #fff;
        z-index: 1;

        input {
            width: 100%;
            height: 36px;
            border: 1px solid var(--color-light-grey);
            padding: 8px 12px;
        }
    }

    ul {
        display: flex;
        flex-direction: column;
        gap: 5px;
        color: var(--color-text-primary);
        max-height: 245px;
        padding: 0 16px 16px 16px;

        li {
            position: relative;
            width: 100%;
            font-size: 14px;
            line-height: 20px;
            font-weight: 400;
            cursor: pointer;

            &[aria-selected="true"] {
                font-weight: 700;

                &::after {
                    content: url("data:image/svg+xml;utf8,<svg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M16.6666 5L7.49992 14.1667L3.33325 10' stroke='%23292D32' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/></svg>");
                    position: absolute;
                    right: 0;
                    top: 0;
                    width: 20px;
                    height: 20px;
                }
            }


        }
    }
}

.stocks__stores-list-tab {
    padding: 8px 50px 0;
}

.stock-map-marker {
    width: 32px;
    height: 32px;
    transform: translate(-50%, -100%);
    cursor: pointer;
    color: #6CC9F2;
}

.stock-map-marker.active {
    color: #292D32;
}

.stocks-dealers-more {
    display: flex;
    margin-top: 24px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background: #6CC9F2;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    font-weight: bold;
}

.stocks-dealers-table-empty {
    display: flex;
    flex-direction: column;

    &.hidden {
        display: none;
    }

    > h6 {
        font-weight: 700;
        font-size: 14px;
        line-height: 20px;
        color: #292D32;

    }

    > span {
        font-weight: 400;
        font-size: 14px;
        line-height: 100%;
        color: #6CC9F2;
    }

    > button {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 24px;
        background: #EDF6FC;
        width: 180px;
        height: 44px;
        font-weight: 700;
        font-size: 12px;
        line-height: 20px;
        color: #292D32;
    }
}

@media (width < 992px) {
    .stocks-drawer-content {
        inset: 0 0 0 0;
        padding: 18px;
        width: 100%;
        min-height: 100vh;

        h2 {
            padding: 0;
            margin: 0 5px;
        }

        .close-button {
            width: 32px;
            height: 32px;
            border: 1px solid var(--color-light-grey);
            border-radius: 16px;
            position: absolute;
            right: 18px;
            top: 18px;
        }
    }

    .stocks-drawer-aside {
        padding: 0;
        position: relative;
        display: grid;
        grid-template-columns: 80px 1fr 175px;
        grid-template-rows: repeat(2, 44px);
        grid-template-areas: "C C C" "D D D" "M S A";

        &.stuck {
            box-shadow: unset;
        }
    }

    .stocks-dropdown.city {
        grid-area: C;
        width: 100%;
    }

    .stocks-dropdown.dealer {
        grid-area: D;
        width: 100%;
    }

    .stocks-available-button {
        grid-area: A;
    }

    .stocks-view-mode {
        grid-area: M;
    }

    .stocks__stores-list-tab {
        padding: 8px 0 0;
    }

    .stocks-dealers-table {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
    }

    .stocks-dealers-map {
        padding: 8px 0 0;
    }

    .stocks-dealers-map {
        padding: 8px 0 0;
        margin: 0 -16px -16px -16px;

        .ymaps {
            width: 100%;
            height: 100%;
        }
    }

    .stocks-dealer-card.stocks-dealer-card-map {
        position: absolute;
        border: none;
        inset: auto 18px 18px;
        width: unset;
    }
}

@media (width < 768px) {
    .stocks-dealers-table {
        grid-template-columns: 1fr 1fr;
    }

    .stocks-dealer-card {
        &:nth-last-of-type(3) {
            border-bottom: 0;
        }

        &:nth-last-of-type(3n - 1) {
            border-left: 0;
        }

        &:nth-last-of-type(2n + 1) {
            border-left: 1px solid var(--color-light-grey);
        }

    }
}

@media (width < 594px) {
    .stocks-dealers-table {
        grid-template-columns: 1fr;
    }

    .stocks-dealer-card {
        &:nth-last-of-type(2) {
            border-bottom: 0;
        }

        &:nth-last-of-type(2n + 1), &:nth-last-of-type(3n - 1) {
            border-left: 1px solid var(--color-light-grey);
        }
    }
}


.inaccuracy-drawer-container {
    inset: 0 0 0 0;
    position: fixed;
    background-color: #00000000;
    display: none;
    transition: background-color 0.3s;
    z-index: 20;
}

.inaccuracy-drawer-container.open {
    background-color: #00000050;

    .inaccuracy-drawer-content {
        transform: translateX(0);
    }
}

.inaccuracy-drawer-content {
    inset: 0 0 0 auto;
    width: 420px;
    position: fixed;
    transform: translateX(100%);
    transition: transform .3s;
    background-color: #fff;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 50px;
    gap: 24px;

    color: var(--color-text-primary);

    display: flex;
    flex-direction: column;
    height: 100vh;

    h2 {
        font-size: 20px;
        font-weight: 500;
        line-height: 24px;
    }

    .close-button {
        width: 20px;
        height: 20px;
        position: fixed;
        inset: 16px 16px auto auto;
        display: flex;
        justify-content: center;
        align-items: center;

        &:focus-visible {
            outline: 1px dashed var(--color-link-blue);
            outline-offset: 2px;
        }
    }
}

.inaccuracy-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.inaccuracy-form__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inaccuracy-form__field {
    position: relative;
}

.inaccuracy-form__field--error .inaccuracy-form__input,
.inaccuracy-form__field--error .inaccuracy-form__textarea {
    border-color: #e54848;
}

.inaccuracy-form__field--error .inaccuracy-form__label {
    color: #e54848;
}

.inaccuracy-form__input,
.inaccuracy-form__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E2E2;
    font-size: 14px;
    color: #333;
    background: #fff;
}

.inaccuracy-form__input:focus,
.inaccuracy-form__textarea:focus {
    border-color: #77cdf2;
    outline: none;
}

.inaccuracy-form__input::placeholder,
.inaccuracy-form__textarea::placeholder {
    opacity: 0;
}

.inaccuracy-form__input:focus + .inaccuracy-form__label,
.inaccuracy-form__textarea:focus + .inaccuracy-form__label,
.inaccuracy-form__input:not(:placeholder-shown) + .inaccuracy-form__label,
.inaccuracy-form__textarea:not(:placeholder-shown) + .inaccuracy-form__label {
    top: 4px;
    font-size: 10px;
}

.inaccuracy-form__textarea {
    min-height: 130px;
    resize: vertical;
}

.inaccuracy-form__label {
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 14px;
    color: #999;
    pointer-events: none;
    transition: all 0.2s ease;
}

.inaccuracy-form__error {
    margin-top: 4px;
    font-size: 12px;
    color: #e54848;
    min-height: 14px;
}

.inaccuracy-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background: #6CC9F2;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    font-weight: bold;
}


.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    transform: translateX(120%);
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;

    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 9999;
    max-width: 320px;
}

.toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.toast--success {
    background-color: #2ecc71;
}

.toast--error {
    background-color: #e74c3c;
}
  