/* Dialog windows: "Задайте свой вопрос", "Магазины с товаром в наличии", просмотр отзыва (Figma, 1920 and 393) */
body.mbx-modal-open {
    overflow: hidden;
}

.mbx-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow-y: auto;
}

.mbx-modal[hidden] {
    display: none;
}

.mbx-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(29, 27, 27, 0.45);
}

.mbx-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-height: calc(100vh - 30px);
    padding: 15px;
    overflow-y: auto;
    background: var(--belyy);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    color: var(--chernyy);
}

.mbx-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.mbx-modal__title {
    margin: 0;
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
}

.mbx-modal__title--stores {
    font-weight: 500;
    text-transform: uppercase;
}

.mbx-modal__close {
    flex: none;
    display: flex;
    padding: 4px;
    margin: -4px -4px 0 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.mbx-modal__close img {
    width: 14px;
    height: 14px;
}

/* ---- ask a question ---- */
.ask-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ask-form__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ask-form__label {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
}

.ask-form__label--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.ask-form__phone {
    display: flex;
    align-items: stretch;
}

.ask-form__input {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--temno-belyy);
    border-radius: 0;
    background: var(--belyy);
    font: 500 15px/140% var(--font-family);
    color: var(--chernyy);
    -webkit-appearance: none;
    appearance: none;
}

.ask-form__input::placeholder {
    color: var(--seryy);
}

.ask-form__input:focus {
    outline: none;
    border-color: var(--seryy);
}

.ask-form__input.is-invalid {
    border-color: var(--firmennyy);
}

.ask-form__textarea {
    min-height: 143px;
    resize: vertical;
}

.ask-form__check {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: var(--firmennyy);
}

.ask-form__check img {
    width: 13px;
    height: auto;
}

.ask-form__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ask-form__error {
    margin: 0;
    padding: 10px 12px;
    background: #fdecec;
    border-left: 4px solid var(--firmennyy);
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
}

.ask-form__error[hidden] {
    display: none;
}

.ask-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 51px;
    padding: 15px;
    border: 0;
    background: var(--firmennyy);
    color: var(--belyy);
    font: 500 15px/140% var(--font-family);
    cursor: pointer;
}

.ask-form__submit:hover {
    background: var(--firmennyy-2);
}

.ask-form__submit[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.ask-form__done {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ask-form__done[hidden] {
    display: none;
}

.ask-form__done-text {
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
}

/* ---- stores ---- */
.stores-modal__list {
    display: grid;
    gap: 5px;
}

.stores-modal__list .location-block {
    margin: 0;
}

/* ---- review ---- */
.rv-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.rv-modal__who {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
}

.rv-modal__author {
    font-weight: 500;
    font-size: 16px;
    line-height: 140%;
}

.rv-modal__date {
    font-weight: 500;
    font-size: 16px;
    line-height: 140%;
    color: var(--seryy);
}

.rv-modal__stars {
    flex-basis: 100%;
}

.rv-modal__stars .review__rating-wrapper {
    display: flex;
    gap: 2px;
}

.rv-modal__stars .review__rating-star img {
    width: 20px;
    height: 20px;
}

.rv-modal__section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rv-modal__section[hidden] {
    display: none;
}

.rv-modal__label {
    font-weight: 700;
    font-size: 16px;
    line-height: 140%;
}

.rv-modal__text {
    margin: 0;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.rv-modal__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rv-modal__photos img {
    width: 56px;
    height: 56px;
    object-fit: cover;
}

/* a card that opens the review */
.review[data-review-card] {
    cursor: pointer;
}

.review[data-review-card]:focus-visible {
    outline: 2px solid var(--firmennyy);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .mbx-modal__dialog {
        gap: 20px;
        padding: 30px;
        max-width: 908px;
    }

    .mbx-modal__title {
        font-size: 30px;
    }

    .mbx-modal__title--stores {
        font-size: 18px;
        font-weight: 500;
        text-transform: none;
        line-height: 140%;
    }

    .mbx-modal__close img {
        width: 22px;
        height: 22px;
    }

    .ask-form {
        gap: 20px;
    }

    .ask-form__label {
        font-size: 18px;
    }

    .ask-form__input {
        padding: 20px;
        font-size: 18px;
    }

    .ask-form__textarea {
        min-height: 223px;
        padding: 15px;
    }

    .ask-form__check {
        width: 65px;
    }

    .ask-form__check img {
        width: 18px;
    }

    .ask-form__submit {
        align-self: center;
        width: 425px;
        max-width: 100%;
        min-height: 65px;
        font-size: 18px;
    }

    .legal-consent {
        font-size: 15px;
    }

    .mbx-modal__dialog--stores {
        max-width: 1010px;
        border-radius: 15px;
    }

    .stores-modal__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .stores-modal__list .location-block {
        padding: 20px;
        gap: 15px 10px;
    }

    .mbx-modal__dialog--review {
        max-width: 1100px;
    }

    .rv-modal__author,
    .rv-modal__date,
    .rv-modal__label,
    .rv-modal__text {
        font-size: 18px;
    }

    .rv-modal__stars .review__rating-star img {
        width: 24px;
        height: 24px;
    }

    .rv-modal__photos img {
        width: 80px;
        height: 80px;
    }
}

/* triggers */
.location__ask {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 51px;
    margin-top: 20px;
    padding: 0 30px;
    border: 0;
    background: var(--firmennyy);
    color: var(--belyy);
    font: 500 16px/140% var(--font-family);
    cursor: pointer;
}

.location__ask:hover {
    background: var(--firmennyy-2);
}

.conditions__stores-link {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    font: 500 15px/140% var(--font-family);
    color: var(--firmennyy);
    text-decoration: underline;
    cursor: pointer;
}

@media (min-width: 768px) {
    .location__ask {
        margin-top: 30px;
    }
}

.stores-modal__list .location-block a {
    color: inherit;
    text-decoration: none;
}

/* ---- Вход / Регистрация (Figma "Вход в аккаунт", "Регистрация": 724px, padding 30; "М. Вход": full screen) ---- */
.auth-modal {
    gap: 20px;
}

.mbx-modal--auth .mbx-modal__close {
    align-self: flex-end;
}

.auth-modal__title {
    margin: 0;
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
    text-transform: uppercase;
    text-align: center;
}

.auth-modal__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-modal__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-modal__label {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
    color: var(--seryy);
}

.auth-modal__input {
    height: 48px;
    padding: 0 15px;
    border: 1px solid var(--temno-belyy);
    background: var(--belyy);
    font: 500 15px/140% var(--font-family);
    color: var(--chernyy);
}

.auth-modal__input:focus {
    outline: none;
    border-color: var(--chernyy);
}

.auth-modal__link {
    font-weight: 500;
    color: var(--firmennyy);
    text-decoration: none;
}

.auth-modal__recover {
    align-self: flex-start;
    font-size: 15px;
    line-height: 140%;
    margin-top: -10px;
}

.auth-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font: 500 14px/21px var(--font3);
    color: var(--seryy);
}

.auth-modal__consent input {
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--firmennyy);
}

.auth-modal__consent a {
    color: var(--seryy);
    text-decoration: underline;
}

.auth-modal__submit {
    align-self: center;
    padding: 20px 50px;
    border: 0;
    background: var(--firmennyy);
    color: var(--belyy);
    font: 500 16px/21px var(--font3);
    cursor: pointer;
}

.auth-modal__submit:hover {
    background: var(--firmennyy-2);
}

.auth-modal__switch {
    margin: 0;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
}

/* phones: the dialog is the whole screen, like the account page */
@media (max-width: 767px) {
    .mbx-modal--auth {
        padding: 0;
        align-items: stretch;
    }

    .mbx-modal--auth .auth-modal {
        max-height: none;
        min-height: 100%;
        padding: 15px 15px 30px;
    }
}

@media (min-width: 768px) {
    .mbx-modal--auth .auth-modal {
        max-width: 724px;
        padding: 30px;
    }

    .auth-modal__title {
        font-size: 30px;
    }

    .auth-modal__label,
    .auth-modal__recover,
    .auth-modal__switch {
        font-size: 18px;
    }

    .auth-modal__input {
        height: 55px;
        font-size: 18px;
    }

    .auth-modal__consent {
        font-size: 16px;
    }
}
