.certificate-page {
    display: grid;
    grid-template-columns: minmax(auto, 309px) 1fr 400px;
    gap: 16px;
    align-items: start;
}

.certificate-design__title {
    color: var(--main-color);
    font-family: 'Ysabeau Infant';
    font-size: 18px;
    line-height: 1;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.certificate-design__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.certificate-design__item {
    display: flex;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.2);
    caret-color: transparent;
}

.certificate-design__item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s;
    border-radius: 2px;
}

.certificate-design__item--selected::after {
    background: rgba(0, 0, 0, 0.4);
}

.certificate-design__item:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

.certificate-design__item--selected::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 14px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L5 9L13 1' stroke='%23E3E3E3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    z-index: 2;
}

.certificate-design__image {
    min-width: 118px;
    max-height: 76px;
    object-fit: contain;
    padding: 10px 0;
}

.certificate-design__image--full {
    width: 100%;
    object-fit: cover;
    padding: 0;
}

.certificate-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(247, 246, 246, 1);
    min-height: 100%;
    padding: 0 16px;
}

.certificate-preview__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 40px 40px 40px 60px;
    max-width: 640px;
    width: 100%;
    margin-bottom: 10vh;
    aspect-ratio: 4 / 3;
}
.certificate-preview__card.certificate-preview__card--TYPE_1 {
    padding: 0;
}
.certificate-preview__card--TYPE_1 .certificate-preview__info{
    position: absolute;
    z-index: 1;
    left: 50%;
    transform: translateX(-50%);
    margin-right: 0;
}
.certificate-preview__card--TYPE_1 .certificate-preview__desc,
.certificate-preview__card--TYPE_1 .certificate-preview__value{
    color: #fff;
}
.certificate-preview__card--TYPE_1 .certificate-preview__image {
    flex-basis: 100%;
    height: 100%;
}
.certificate-preview__card--TYPE_1 .certificate-preview__img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.certificate-preview__info {
    min-width: 180px;
    margin-right: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    caret-color: transparent;
}

.certificate-preview__desc {
    font-size: 24px;
    font-weight: 500;
    color: #3e2d2b;
    display: block;
    margin-top: 16px;
}

.certificate-preview__value {
    font-size: 39px;
    font-weight: 600;
    line-height: 1;
    color: #3e2d2b;
    margin-top: 8px;
}

.certificate-preview__image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-basis: 50%;
}

.certificate-preview__img {
    max-width: 270px;
    border-radius: 6px;
}


.certificate-form {
    max-width: 388px;
    margin: 0 auto;
    color: #3e2d2b;
    font-family: 'Ysabeau Infant';
    padding-left: 24px;
}

.certificate-form__header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 50px;
    color: rgba(129, 129, 129, 1);
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.certificate-form__back-button {
    display: block;
    content: '';
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.5 15L7.5 10L12.5 5' stroke='%2334261f' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    background-size: 16px 16px;
    background-position: center;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.certificate-form__section {
    margin-bottom: 36px;
}

.certificate-form__title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.1;
    caret-color: transparent;
    letter-spacing: 0.1px;
}

.certificate-form__subtitle {
    display: block;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
    color: rgba(52, 37, 30, 1);
    line-height: 1.25;
    caret-color: transparent;
    letter-spacing: 0.2px;
}

.certificate-form__amounts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.certificate-form__amount {
    display: flex;
    align-items: end;
    border: 1px solid #b9b9b9;
    padding: 16px 16px;
    border-radius: 2px;
    cursor: pointer;
    background-color: #f7f7f7;
    font-size: 15px;
    min-height: 67px;
    position: relative;
}

.certificate-form__amount--selected {
    border: 1px solid rgba(52, 37, 30, 1);
}

.certificate-form__radio {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 13px;
    height: 13px;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    display: flex !important;
}


.certificate-form__radio-custom {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(222, 226, 230, 1);
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
    z-index: 1;
}

.certificate-form__radio:checked ~ .certificate-form__radio-custom::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--main-color);
    position: absolute;
    right: 4px;
    top: 3.5px;
}

.certificate-form__custom-amount {
    grid-column: 1 / -1;
    padding: 12px 16px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    font-size: 16px;
    color: var(--main-color);
    margin-top: 8px;
}

.certificate-form__recipient {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    cursor: pointer;
}

.certificate-form__recipient-radio {
    position: absolute;
    opacity: 0;
    width: 13px;
    height: 13px;
}

.certificate-form__recipient-custom {
    width: 13px;
    height: 13px;
    border: 1px solid rgba(129, 129, 129, 1);
    border-radius: 50%;
    background: #fff;
    margin-right: 9px;
    display: inline-block;
    position: relative;
    transform: translateY(1px);
}

.certificate-form__recipient-radio:checked + .certificate-form__recipient-custom::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 3.5px;
    width: 4px;
    height: 4px;
    background: #40312b;
    border-radius: 50%;
}

.certificate-form__recipient-label {
    font-size: 15px;
    color: #40312b;
    caret-color: transparent;
}


.certificate-form__phone {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    font-size: 16px;
    color: #3e2d2b;
    transition: border-color 0.3s;
}

.certificate-form__phone--error {
    border-color: #d9534f;
}

.certificate-form__phone-error {
    color: #d9534f;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.25;
    letter-spacing: 0.2px;
}

.certificate-form__terms {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.certificate-form__terms-text {
    color: #834C24;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.25;
    text-transform: uppercase;
    caret-color: transparent;

}

.certificate-form__terms-icon {
    width: 24px;
    height: 24px;
    stroke: #834C24;
}


.certificate-form__submit {
    width: 100%;
    padding: 16px 0;
    background-color: rgba(129, 129, 129, 1);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.certificate-form__submit:hover {
    background-color: #6b5c53;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.certificate-form__submit--active {
    background-color: #6b5c53;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.certificate-form__submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.certificate-form__note {
    margin-top: 16px;
    font-size: 15px;
    color: rgba(52, 37, 30, 0.5);
    line-height: 1.25;
    letter-spacing: 0.2px;
    caret-color: transparent;
}


.certificate-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    overflow-y: auto;
    height: 100vh;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
    box-sizing: border-box;
    border-left: 1px solid #E3E3E3;
}

.certificate-sidebar.active {
    transform: translateX(0);
}

.certificate-sidebar__close {
    position: absolute;
    top: 24px;
    right: 24px;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 5L5 15' stroke='%2334261f' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 5L15 15' stroke='%2334261f' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: center;
    z-index: 99;
}

.certificate-sidebar__content {
    margin: 50px 40px;
}

.certificate-sidebar__content h2 {
    font-size: 24px;
    font-weight: 500;
    color: rgba(52, 37, 30, 1);
    letter-spacing: 0.2px;
    line-height: 1.1;
    margin-bottom: 24px;
}

.certificate-sidebar__content li {
    list-style: num;
    font-weight: 500;
    line-height: 1.25;
    font-size: 15px;
    margin-bottom: 16px;
    margin-left: 16px;
}

.certificate-terms-sidebar__continue {
    font-weight: 500;
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: 0.2px;
    color: rgba(129, 67, 33, 1);
    text-decoration: underline;
    margin-top: 12px;
}

.certificate-design__title--mob {
    display: none;
}

@media screen and (max-width: 1399.98px) {
    .certificate-preview__card {
        min-width: unset;
        padding: 40px;

    }

    .certificate-preview__img {
        width: 100%;
    }
    .certificate-preview__card--TYPE_1 .certificate-preview__image {
        flex-basis: 100%;
    }

    .certificate-preview__desc {
        text-align: center;
        white-space: nowrap;
    }

    .certificate-page {
        grid-template-columns: minmax(auto, 309px) 1fr clamp(300px, 29vw, 400px);
    }

    .certificate-form {
        padding-left: 0;
    }
}

@media screen and (max-width: 1199.98px) {
    .certificate-design__list {
        grid-template-columns: repeat(1, 1fr);
    }

    .certificate-page {
        grid-template-columns: minmax(auto, 140px) 1fr clamp(210px, 24vw, 400px);
    }
}

@media screen and (max-width: 991.98px) {
    .certificate-preview {
        padding: 8px;
        background-color: #fff;
    }

    .certificate-preview__desc {
        font-size: clamp(16px, 2vw, 24px);
    }

    .certificate-preview__value {
        font-size: clamp(18px, 2.4vw, 39px);
    }

    .certificate-preview__info {
        margin-right: 0;
    }

    .certificate-preview__card {
        padding: clamp(10px, 2vw, 40px);
        margin-bottom: 48vh;
    }

    .certificate-page {
        grid-template-columns: minmax(auto, 115px) 1fr clamp(210px, 24vw, 400px);
    }

    .certificate-form__amount {
        padding: 8px;
    }

    .certificate-form__section {
        margin-bottom: 32px;
    }

    .certificate-form__note {
        margin-right: 0;
    }
}

@media screen and (max-width: 767.98px) {
    .certificate-page {
        grid-template-columns: repeat(1, 1fr);
    }

    .certificate-preview {
        order: -1;
        min-height: unset;
        padding: 24px 0;
    }

    .certificate-preview__card {
        margin-bottom: 0;
        padding: 20px;
    }

    .certificate-form {
        max-width: unset;
    }

    .certificate-form__header {
        display: none;
    }

    .certificate-sidebar {
        width: 100vw;
    }

    .certificate-design__list {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .certificate-design__image {
        max-width: 80px;
        max-height: clamp(48px, 13vw, 170px);
        min-width: unset;
    }

    .certificate-design__image--full {
        max-width: 100%;
    }

    .certificate-form__title {
        display: none;
    }

    .certificate-form__section--first {
        margin-bottom: 24px;
    }

    .certificate-design__title--mob {
        display: block;
        margin: 24px 0 32px;
        font-weight: 500;
        font-size: 24px;
        line-height: 1.25;
        color: rgba(52, 37, 30, 1);
        letter-spacing: 0.1px;
    }
}