.to-order-plugin__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
}

.to-order-plugin__overlay[hidden] {
    display: none !important;
}

.to-order-plugin__modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
}

.to-order-plugin__modal[hidden] {
    display: none !important;
}

.to-order-plugin__dialog {
    pointer-events: auto;
    position: relative;
    width: min(700px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--main-background-color, #fff);
    border: 1px solid var(--border-color, #eaeaea);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.to-order-plugin__dialog * {
    box-sizing: border-box;
}

.to-order-plugin__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--secondary-border-color, #e9e8f1);
    border-radius: 10px 10px 0 0;
}

.to-order-plugin__title {
    margin: 0;
    padding: 0;
    font-size: var(--text-h2, 2.4rem);
    line-height: 1.25;
    font-weight: 500;
    color: var(--main-text-color, #343434);
}

.to-order-plugin__close-wrap {
    flex-shrink: 0;
}

.to-order-plugin__close {
    position: relative;
    width: 24px;
    height: 24px;
    border: 0;
    background: none;
    cursor: pointer;
    padding: 0;
}

.to-order-plugin__close::before,
.to-order-plugin__close::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 18px;
    background: var(--main-text-color, #343434);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.to-order-plugin__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.to-order-plugin__close:hover::before,
.to-order-plugin__close:hover::after {
    background: var(--accent-color, #ef8b2e);
}

.to-order-plugin__product-title {
    padding: 0 2rem;
}

.to-order-plugin__product-title h3 {
    margin: 0;
    padding: 2rem 0 0;
    font-size: var(--text-h2, 2.4rem);
    line-height: 1.25;
    font-weight: 500;
    color: var(--accent-color, #ef8b2e);
}

.to-order-plugin__product-title-link h3:hover {
    opacity: 0.8;
}

.to-order-plugin__content {
    padding: 2rem;
    overflow: hidden;
}

.to-order-plugin__product-info {
    width: 275px;
    margin: 0 2rem 0 0;
    float: left;
}

.to-order-plugin__product-image-wrap {
    max-width: 400px;
    position: relative;
    text-align: center;
    font-size: 0;
    padding: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
}

.to-order-plugin__dialog .product-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 275px;
    object-fit: contain;
    object-position: center;
    border-radius: 5px;
}

.to-order-plugin__product-price {
    clear: both;
    text-align: center;
    margin: 1rem 0 0;
    color: var(--main-text-color, #343434);
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 400;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.to-order-plugin__product-price span {
    color: var(--accent-color, #ef8b2e);
}

.to-order-plugin__product-variant {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.4rem;
    color: var(--main-text-color, #343434);
}

.to-order-plugin__product-variant[hidden] {
    display: none !important;
}

.to-order-plugin__fields-wrap {
    overflow: hidden;
    padding: 2px 8px 2px 5px;
}

.to-order-plugin__fields {
    margin: 0;
    padding: 0;
    list-style: none;
}

.to-order-plugin__field-item {
    margin: 0 0 1.5rem;
}

.to-order-plugin__field-item[hidden] {
    display: none !important;
}

.to-order-plugin__field-item .personal-float-field {
    display: block;
    margin: 0;
    min-width: 0;
    max-width: 100%;
}

.to-order-plugin__field-item .personal-float-field__control {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.to-order-plugin__field-item .personal-float-field__label {
    position: absolute;
    left: 1.6rem;
    top: 50%;
    z-index: 1;
    max-width: calc(100% - 3.2rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text-muted, #767676);
    pointer-events: none;
    transform: translateY(-50%);
    transition:
        top 0.15s ease,
        transform 0.15s ease,
        font-size 0.15s ease,
        color 0.15s ease;
}

.to-order-plugin__label--required::before,
.to-order-plugin__required::before {
    content: '*';
    color: #e92c2c;
    padding-right: 0.3rem;
}

.to-order-plugin__field-item .personal-float-field__control:has(textarea) > .personal-float-field__label {
    top: 1.6rem;
    transform: none;
}

.to-order-plugin__field-item .personal-float-field__control:focus-within > .personal-float-field__label,
.to-order-plugin__field-item .personal-float-field__control:has(input:not(:placeholder-shown)) > .personal-float-field__label,
.to-order-plugin__field-item .personal-float-field__control:has(textarea:not(:placeholder-shown)) > .personal-float-field__label,
.to-order-plugin__field-item .personal-float-field.is-filled .personal-float-field__label {
    top: 0.8rem;
    transform: none;
    font-size: 1.2rem;
    color: var(--color-text-muted, #767676);
}

.to-order-plugin__field-item .personal-float-field input,
.to-order-plugin__field-item .personal-float-field textarea {
    display: block;
    width: 100%;
    border: 1px solid var(--border-color, #eaeaea);
    border-radius: 5px;
    padding: 2.2rem 1.6rem 0.8rem;
    background-color: #f7f8fb;
    color: var(--main-text-color, #343434);
    font:
        400 1.6rem / 2.4rem 'Roboto',
        Arial,
        Helvetica,
        sans-serif;
    box-shadow: none;
    margin: 0;
    height: 5.6rem;
    min-height: 5.6rem;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: box-shadow 0.25s, border-color 0.15s ease;
}

.to-order-plugin__field-item .personal-float-field textarea {
    height: auto;
    min-height: 10rem;
    resize: vertical;
    padding-top: 2.6rem;
}

.to-order-plugin__field-item--count .personal-float-field,
.to-order-plugin__field-item--count .personal-float-field input[type='number'] {
    max-width: 12rem;
}

.to-order-plugin__field-item--captcha {
    margin-top: 1rem;
}

.to-order-plugin .checkCapcha {
    margin-top: 0;
    text-align: center;
}

.to-order-plugin .checkCapcha .captcha-img-wrap {
    display: block;
    margin: 0 auto 1rem;
    max-width: 100%;
    position: relative;
}

.to-order-plugin .checkCapcha .captcha-img-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    pointer-events: none;
}

.to-order-plugin .checkCapcha .captcha-img-wrap.is-loading .captcha-img {
    opacity: 0;
}

.to-order-plugin .checkCapcha .captcha-img-wrap:not(.is-loading) .captcha-img-loading {
    display: none;
}

.to-order-plugin .checkCapcha .e-form__title {
    display: block;
    margin: 0 0 0.7rem;
    font-size: 1.4rem;
    line-height: 1.2;
    font-weight: 400;
    text-align: center;
    color: var(--main-text-color, #343434);
}

.to-order-plugin .checkCapcha .feedback__label_require::before {
    content: '*';
    color: #e92c2c;
    padding-right: 0.3rem;
}

.to-order-plugin__field-item--captcha .checkCapcha {
    margin-top: 0;
}

.to-order-plugin__field-item .personal-float-field input:focus,
.to-order-plugin__field-item .personal-float-field textarea:focus {
    outline: none;
    background-color: #f7f8fb;
    box-shadow:
        inset 0 0 0 1000px #f7f8fb,
        0 0 0 2px var(--accent-color, #ef8b2e);
}

.to-order-plugin__field-item .personal-float-field input:-webkit-autofill,
.to-order-plugin__field-item .personal-float-field input:-webkit-autofill:hover,
.to-order-plugin__field-item .personal-float-field input:-webkit-autofill:focus,
.to-order-plugin__field-item .personal-float-field textarea:-webkit-autofill,
.to-order-plugin__field-item .personal-float-field textarea:-webkit-autofill:hover,
.to-order-plugin__field-item .personal-float-field textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--main-text-color, #343434);
    caret-color: var(--main-text-color, #343434);
    box-shadow: inset 0 0 0 1000px #f7f8fb;
    transition: background-color 99999s ease-out;
}

.to-order-plugin__field-item .personal-float-field input:-webkit-autofill:focus,
.to-order-plugin__field-item .personal-float-field textarea:-webkit-autofill:focus {
    box-shadow:
        inset 0 0 0 1000px #f7f8fb,
        0 0 0 2px var(--accent-color, #ef8b2e);
}

.to-order-plugin__field-item.field-error .personal-float-field input,
.to-order-plugin__field-item.field-error .personal-float-field textarea,
.to-order-plugin__field-item .personal-float-field input.to-order-plugin__field-error,
.to-order-plugin__field-item .personal-float-field textarea.to-order-plugin__field-error {
    border: 1px solid #f44336;
    background-color: #ffebee;
}

.to-order-plugin__field-item.field-error .personal-float-field input:focus,
.to-order-plugin__field-item.field-error .personal-float-field textarea:focus,
.to-order-plugin__field-item .personal-float-field input.to-order-plugin__field-error:focus,
.to-order-plugin__field-item .personal-float-field textarea.to-order-plugin__field-error:focus {
    background-color: #ffebee;
    box-shadow:
        inset 0 0 0 1000px #ffebee,
        0 0 0 2px #f44336;
}

.to-order-plugin__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    border-top: 1px solid var(--secondary-border-color, #e9e8f1);
    border-radius: 0 0 10px 10px;
}

.to-order-plugin__agreements {
    flex: 1 1 280px;
    min-width: 0;
    text-align: left;
}

.to-order-plugin__agreements[hidden] {
    display: none !important;
}

.to-order-plugin__agreements > section.agreement {
    margin: 0;
}

.to-order-plugin__agreements .agreement__label {
    justify-content: flex-start;
    flex-wrap: nowrap;
    font-size: 1.4rem;
    line-height: 1.5;
}

.to-order-plugin__agreements .agreement__label span {
    white-space: normal;
    min-width: 0;
}

.to-order-plugin__agreements .agreement__label.agreement__label_error > span,
.to-order-plugin__agreements .agreement__label.agreement__label_error .agreement__btn {
    color: #dc3545 !important;
}

.to-order-plugin__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    margin-left: auto;
}

.to-order-plugin__actions .to-order-plugin__submit-btn {
    margin: 0;
}

.to-order-plugin__loading-indicator {
    display: flex;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.to-order-plugin__loading-indicator.is-visible {
    visibility: visible;
    opacity: 1;
}

.to-order-plugin__spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent-color, #ef8b2e);
    border-radius: 50%;
    animation: to-order-spin 0.8s linear infinite;
}

@keyframes to-order-spin {
    to {
        transform: rotate(360deg);
    }
}

.to-order-plugin__success {
    display: block;
    margin: 1rem 2rem;
    padding: 1.5rem;
    border-radius: 5px;
    font-size: 1.4rem;
    line-height: 1.5;
    text-align: center;
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #81c784;
}

.to-order-plugin__success[hidden] {
    display: none !important;
}

.to-order-plugin__actions .default-btn.loading,
.to-order-plugin__actions .default-btn[disabled] {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.to-order-plugin__captcha .cap-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.to-order-plugin__captcha .cap-left img {
    border-radius: 5px;
    border: 1px solid var(--border-color, #eaeaea);
    cursor: pointer;
}

[data-to-order-wrapper][hidden] {
    display: none !important;
}

.wrapper-to-order {
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.product-page__buy-buttons .wrapper-to-order {
    align-self: center;
}

@media (max-width: 768px) {
    .to-order-plugin__modal {
        padding: 10px;
    }

    .to-order-plugin__header {
        padding: 1.5rem;
    }

    .to-order-plugin__product-title {
        padding: 0 1.5rem;
    }

    .to-order-plugin__content {
        padding: 1.5rem;
    }

    .to-order-plugin__footer {
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .to-order-plugin__actions {
        justify-content: flex-end;
        margin-left: auto;
    }
}

@media (max-width: 560px) {
    .to-order-plugin__product-info {
        float: none;
        width: 100%;
        margin: 0 auto 1.5rem;
    }

    .to-order-plugin__product-title h3 {
        padding-top: 1.5rem;
        font-size: var(--text, 1.6rem);
    }
}
