.rd__dialog {
    box-shadow: 0px 4px 15px 0px rgba(116, 116, 116, 0.1);
    max-width: 700px;
    width: 100%;
    min-width: 300px;
    min-height: 250px;
    background: rgba(255, 255, 255, 1);
    border: none;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: clip;
}

.rd__dialog-content-wrapper {
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    padding: 30px 20px 50px 20px;
}

.rd__dialog:not([open]) {
    display: none;
}

.rd__dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.rd__body-no-scroll {
    position: fixed;
    overflow-y:scroll;
}

.rd__dialog .rd__dialog-close,
.rd__dialog .rd__dialog-close:hover {
    all: unset;
    position: sticky; /* Sticky */
    top: 0;           /* Прилипает к верху при прокрутке */
    margin-left: auto; /* Сдвигаем вправо */
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd__dialog .rd__dialog-close::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
}

.rd__dialog-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-direction: row-reverse;
}

/* Всплывающее уведомление поверх страницы */
.rd__dialog-alert {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 9999999999999;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, top 0.3s;
}

.rd__dialog-alert--visible {
    opacity: 1;
}

.rd__dialog-alert.success {
    background-color: #28a745;
}
.rd__dialog-alert.error   {
    background-color: #dc3545;
}
.rd__dialog-alert.info    {
    background-color: #007bff;
}

.rd__input-error {
    border-color: #d93025;
    background-color: #FCDFDE;
}

.rd__error-message  {
    color: #EA1C15;
    font-weight: 500;
    font-size: 12px;
    margin-top: 5px;
}

.rd__nav-arrow {
    cursor: pointer;
}

.rd__nav-prev {
    transform: rotate(0deg);
}

.rd__nav-next {
    transform: rotate(180deg);
}

.rd__nav-text {
    font-weight: 500;
    white-space: nowrap;
}

.rd__slider-nav {
    position: absolute;
    top: -40px;
    display: flex;
    align-items: center;
    width: 100%;
}

.rd__nav-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: end;
    visibility: hidden;
}

.rd__nav-arrow:hover {
    opacity: 0.7;
}

.rd__nav-counter {
    font-size: 14px;
    white-space: nowrap;
}

.rd__product-qty {
    margin-top: 8px;
}

.rd__quantity-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #EEEEEE;
    color: black;
    border-radius: 16px;
    max-width: 130px;
    margin: 0;
    height: 40px;
}

.rd__quantity-btn:hover {
    background: #EEEEEE;
}

.rd__quantity-btn .qty-btn span {
    flex: 1;
    text-align: center;
    line-height: 36px;
    height: 36px;
}

.rd__quantity-wrapper {
    display: flex;
    align-items: center;

    justify-content: space-between;
}

.rd__product-delete {
    display: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.rd__quantity-minus,
.rd__quantity-plus {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    font-size: 28px;
}

.rd__quantity-minus::before,
.rd__quantity-plus::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -15px;
    right: -15px;
}

.rd__quantity-number {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

@media (max-width: 700px) {
    .rd__dialog {
        max-width: 96%;
    }
}

@media (max-width: 600px) {
    .rd__dialog-content-wrapper {
        padding: 0 10px 0 10px;
        min-height: auto;
    }

    .rd__dialog .rd__dialog-title {
        font-size: 24px;
        line-height: 1.2;
        text-align: center;
    }

    .rd__dialog .rd__dialog-text {
        font-size: 14px;
        line-height: 1.4;
        text-align: center;
        margin-bottom: 40px;
    }

    .rd__dialog-content {
        flex-direction: column;
        gap: 20px;
        position: relative;
    }

    .rd__dialog-image {
        display: flex;
        align-items: unset;
        flex-direction: row;
        gap: 15px;
        position: unset;
        width: 100%;
    }

    .rd__nav-arrow {
        width: auto !important;
    }

    .rd__dialog #modal-product-image {
        max-height: 100px;
        height: auto;
        max-width: 100px;
    }

    .rd__consent-text {
        font-size: 14px;
    }

    .rd__form-field input[type="checkbox"] {
        width: 40px;
    }

    .rd__dialog-form {
        width: 100%;
    }

    .rd__slider-nav {
        top: -35px;
        left: 0;
    }

    .rd__dialog .widget.module255 {
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        margin-top: 0;
    }

    .rd__dialog .widget.module255 .widget-title .main-title {
        margin: 0;
    }

    .rd__dialog-product-info {
        gap: 0;
    }

    .rd__dialog .widget.module255 .nav-tabs {
        background: none;
        overflow-x: auto;
        display: flex;
        scrollbar-width: none;
        padding: 0 24px;
        margin: 0 -24px 20px -24px;
        width: auto;
    }

    .rd__dialog .widget.module255 .nav-tabs li {
        margin-right: 4px;
    }
}
