.x-oc-modal {
    display: none;
}

.x-oc-modal.is-open {
    display: block;
}

.x-oc-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 28, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9998;
}

.x-oc-modal__scroll {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 72px - 42px - 34px); /* 100vh - верхний отступ панели - верхний padding - нижний padding */
    /* При необходимости можно задать max-height в пикселях или процентах, подберите под ваш дизайн */
}

.x-oc-modal__panel {
    position: fixed;
    left: 50%;
    top: 36px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 72px);
    background: #fff;
    border-radius: 32px;
    padding: 42px 34px 34px;
    z-index: 9999;
}

.x-oc-modal__close {
    position: absolute;
    top: -24px;
    right: -24px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 0;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
}

.x-oc-product {
    max-width: 560px;
    margin: 0 auto 28px;
    background: #f3f4f7;
    border-radius: 24px;
    padding: 34px 24px 28px;
}

.x-oc-product__media {
    text-align: center;
    margin-bottom: 22px;
}

.x-oc-product__media img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.x-oc-product__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #3f3f46;
    margin-bottom: 16px;
}

.x-oc-product__price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.x-oc-product__price-current {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.x-oc-product__price-old {
    font-size: 16px;
    color: #9ca3af;
    text-decoration: line-through;
}

.x-oc-product__discount {
    background: #ff5b6e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
    padding: 4px 6px;
}
.x-oc-product__discount:empty {
    display: none;
}

.x-oc-form {
    max-width: 560px;
    margin: 0 auto;
}

.x-oc-field {
    position: relative;
    margin-bottom: 22px;
}

.x-oc-field label {
    position: absolute;
    left: 32px;
    top: -9px;
    padding: 0 10px;
    background: #fff;
    z-index: 2;
    font-size: 16px;
    color: #606060;
    line-height: 16px;
}

.x-oc-field input {
    width: 100%;
    height: 54px;
    border-radius: 999px;
    border: 1px solid #c7c7c7;
    background: #fff;
    padding: 0 22px;
    font-size: 18px;
    color: #0b1220;
    outline: none;
}

.x-oc-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 26px;
    font-size: 14px;
    color: #606060;
}

.x-oc-submit {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.x-oc-submit:disabled {
    background: #c4ccd6;
    cursor: default;
}

.x-oc-error,
.x-oc-success {
    margin-bottom: 14px;
    font-size: 14px;
}

.x-oc-error {
    color: #e11d48;
}

.x-oc-success {
    color: #16a34a;
}

.x-oc-success-screen {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.x-oc-success-screen__title {
    font-size: 18px;
    font-weight: 500;
    color: #000;
    letter-spacing: -1px;
    margin-bottom: 36px;
}

.x-oc-success-screen__text {
    font-size: 16px;
    color: #8ea0b2;
    letter-spacing: -1px;
}

@media (max-width: 768px) {
    .x-oc-modal__panel {
        top: 18px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 36px);
        padding: 24px 16px 20px;
        border-radius: 24px;
    }

    .x-oc-modal__close {
        top: -12px;
        right: -12px;
    }

    .x-oc-product {
        padding: 20px 14px 18px;
        border-radius: 18px;
    }

    .x-oc-field label {
        left: 22px;
        font-size: 14px;
    }

    .x-oc-field input,
    .x-oc-submit {
        height: 50px;
        font-size: 16px;
    }
}
