* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #111111;
    --color-surface: #ffffff;
    --color-bg: #e7e7e7;
    --color-border: #c8c8c8;
    --color-muted: #b8b8b8;
}

body {
    min-height: 100vh;
    font-family: "Open Sans", sans-serif;
    color: var(--color-primary);
}

.order-page {
    width: 100%;
    padding: 48px 24px;
}

.order-form {
    max-width: 1080px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 56px 52px;
}

.order-form__back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 28px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 24px;
    line-height: 31px;
    font-weight: 600;
}

.order-form__back-link:hover {
    text-decoration: underline;
}

.order-form__content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.order-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.order-section__title {
    font-size: 32.74px;
    line-height: 43.65px;
    font-weight: 600;
}

.order-product-selector {
    display: flex;
    align-items: stretch;
    gap: 26px;
}

.order-product-selector__option {
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    background: #efefef;
    width: 442px;
    height: 399px;
    padding: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.order-product-selector__option img {
    width: 100%;
    max-width: 230px;
    height: auto;
    object-fit: contain;
}

.order-product-selector__option--selected {
    border: 3px solid #000000;
}

.order-delivery-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-delivery-selector__option {
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #ededed;
    color: #252525;
    min-height: 61px;
    padding: 14px 18px;
    text-align: left;
    font-size: 23px;
    line-height: 30px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.2s ease;
    height: 101px;
}

.order-delivery-selector__option--selected {
    border: 3px solid #000000;
}

.order-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.order-fields__item {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.order-fields__item[hidden] {
    display: none;
}

.order-fields__label {
    font-size: 27.76px;
    line-height: 37.02px;
    font-weight: 600;
}

.order-fields__control {
    width: 100%;
    max-width: 442px;
    height: 101px;
    min-height: 101px;
    border: 1.58px solid #d5d5d5;
    border-radius: 8px;
    background: #f3f3f5;
    padding: 12px 20px;
    font-family: "Open Sans", sans-serif;
    font-size: 29.13px;
    line-height: 36.41px;
    font-weight: 400;
    color: #4a4a4a;
}

.order-fields__control::placeholder {
    font-size: 29.13px;
    line-height: 36.41px;
    font-weight: 400;
    color: var(--color-muted);
}

.order-fields__error {
    display: none;
    margin-top: -2px;
    font-family: "Open Sans", sans-serif;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    text-transform: uppercase;
    color: #ff0000;
}

.order-fields__item.is-invalid .order-fields__error {
    display: block;
}

.order-dropdown {
    position: relative;
    display: block;
}

.order-dropdown__trigger {
    width: 100%;
    max-width: 442px;
    height: 101px;
    min-height: 101px;
    border: 1.58px solid #d5d5d5;
    border-radius: 13px;
    background: #f3f3f5;
    padding: 12px 44px 12px 16px;
    text-align: left;
    font-family: "Open Sans", sans-serif;
    font-size: 29.13px;
    line-height: 36.41px;
    font-weight: 400;
    color: #4a4a4a;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #6a6a6a 50%), linear-gradient(135deg, #6a6a6a 50%, transparent 50%);
    background-position: calc(100% - 22px) calc(50% + 1px), calc(100% - 16px) calc(50% + 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.order-dropdown--open .order-dropdown__trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.order-dropdown__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 1px);
    display: none;
    z-index: 30;
    border: 1.58px solid #d5d5d5;
    border-top: none;
    border-bottom-left-radius: 13px;
    border-bottom-right-radius: 13px;
    background: #f3f3f5;
    overflow: hidden;
}

.order-dropdown--open .order-dropdown__menu {
    display: block;
}

.order-dropdown__option {
    width: 100%;
    border: 0;
    border-top: 1.58px solid #d5d5d5;
    background: #f3f3f5;
    padding: 12px 16px;
    text-align: left;
    font-family: "Open Sans", sans-serif;
    font-size: 29.13px;
    line-height: 36.41px;
    font-weight: 400;
    color: #252525;
    cursor: pointer;
}

.order-dropdown__option:first-child {
    border-top: 0;
}

.order-dropdown__option--selected {
    background: #818181;
    color: #ffffff;
}

.order-city-search {
    position: relative;
    display: block;
    width: 100%;
    max-width: 442px;
}

.order-city-search__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 1px);
    z-index: 35;
    border: 1.58px solid #d5d5d5;
    border-radius: 13px;
    background: #f3f3f5;
    max-height: 320px;
    overflow-y: auto;
}

.order-city-search__option {
    width: 100%;
    border: 0;
    border-top: 1px solid #d5d5d5;
    background: transparent;
    padding: 12px 16px;
    text-align: left;
    font-family: "Open Sans", sans-serif;
    font-size: 29.13px;
    line-height: 36.41px;
    color: #252525;
    cursor: pointer;
}

.order-city-search__option:first-child {
    border-top: 0;
}

.order-city-search__option:hover,
.order-city-search__option:focus-visible {
    background: #e7e7eb;
    outline: none;
}

.order-city-search__empty {
    display: block;
    padding: 12px 16px;
    font-family: "Open Sans", sans-serif;
    font-size: 29.13px;
    line-height: 36.41px;
    color: #757575;
}

.order-fields__phone {
    display: grid;
    grid-template-columns: 124px 1fr;
    gap: 8px;
}

.order-dropdown--prefix .order-dropdown__trigger {
    padding-left: 12px;
}

.order-dropdown--prefix .order-dropdown__option {
    padding-left: 12px;
}

.order-fields__control--phone {
    min-width: 0;
}

.order-map {
    width: 100%;
}

.order-map__widget {
    width: clamp(384.8px, calc(384.8px + (968.2 - 384.8) * ((100vw - 440px) / (1600 - 440))), 968.2px);
    height: clamp(267.5px, calc(267.5px + (673 - 267.5) * ((100vw - 440px) / (1600 - 440))), 673px);
    margin: 0 auto;
    border: none;
    border-radius: 0;
    background: #f2f2f2;
    overflow: hidden;
}

.order-map--hidden .order-map__widget {
    display: none;
}

.order-map__hint {
    margin-top: 12px;
    font-size: 16px;
    line-height: 22px;
    color: #555555;
}

.order-map__warning {
    margin: 0 0 12px;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    line-height: 22px;
    font-weight: 400;
    color: #ff0000;
}

.order-map__warning[hidden] {
    display: none;
}

.order-form__submit {
    width: 100%;
    height: 95px;
    border: none;
    border-radius: 13px;
    background: #000000;
    color: #ffffff;
    font-size: 27.76px;
    line-height: 31.59px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
}

@media screen and (min-width: 1600px) {
    .order-fields__phone {
        grid-template-columns: 122px 300px;
    }

    .order-dropdown--prefix .order-dropdown__trigger {
        width: 122px;
        max-width: 122px;
    }

    .order-fields__control--phone {
        width: 300px;
        max-width: 300px;
    }
}

@media screen and (min-width: 1025px) {
    .order-fields__phone {
        grid-template-columns: 122px 312px;
    }

    .order-fields__item > .order-dropdown {
        width: 442px;
        max-width: 100%;
    }

    .order-fields__item > .order-dropdown .order-dropdown__trigger {
        width: 100%;
        max-width: 100%;
    }

    .order-fields__item > .order-dropdown .order-dropdown__menu {
        right: auto;
        width: 100%;
    }

    .order-fields__item > .order-city-search {
        width: 442px;
        max-width: 100%;
    }

    .order-fields__control--phone {
        width: 312px;
        max-width: 312px;
    }
}

@media screen and (max-width: 908px) {
    .order-form {
        padding: 34px 26px;
    }

    .order-form__back-link {
        margin-bottom: 18px;
        font-size: 18px;
        line-height: 24px;
    }

    .order-form__content {
        gap: 34px;
    }

    .order-product-selector__option {
        width: calc(50% - 13px);
        min-height: 174px;
    }

    .order-fields__label {
        font-size: 18px;
        line-height: 24px;
    }

    .order-fields__control,
    .order-fields__control::placeholder {
        font-size: 17px;
        line-height: 24px;
    }

    .order-fields__error {
        font-size: 14px;
        line-height: 18px;
    }

    .order-dropdown__trigger,
    .order-dropdown__option,
    .order-city-search__option,
    .order-city-search__empty {
        font-size: 17px;
        line-height: 24px;
    }
}

@media screen and (max-width: 768px) {
    .order-page {
        padding: 20px 10px;
    }

    .order-form {
        border-radius: 0;
        padding: 22px 14px 18px;
    }

    .order-form__back-link {
        margin-bottom: 12px;
        font-size: 11.04px;
        line-height: 14.71px;
        font-weight: 600;
    }

    .order-form__content {
        gap: 22px;
    }

    .order-section {
        gap: 10px;
    }

    .order-section__title {
        font-size: 13.01px;
        line-height: 17.35px;
        font-weight: 600;
    }

    .order-product-selector {
        gap: 10px;
    }

    .order-product-selector__option {
        width: 175.68px;
        height: 158.58px;
        border-radius: 4px;
        padding: 8px;
    }

    .order-product-selector__option img {
        max-width: 100px;
    }

    .order-delivery-selector {
        gap: 8px;
    }

    .order-delivery-selector__option {
        min-height: 32px;
        border-radius: 4px;
        padding: 7px 9px;
        font-size: 10.5px;
        line-height: 13px;
        height: 40.2px;
    }

    .order-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "fullName fullName"
            "country country"
            "city city"
            "phone email"
            "address address";
        gap: 8px 8px;
    }

    .order-fields__item:nth-child(1) {
        grid-area: fullName;
    }

    .order-fields__item:nth-child(2) {
        grid-area: country;
    }

    .order-fields__item:nth-child(3) {
        grid-area: phone;
    }

    .order-fields__item:nth-child(4) {
        grid-area: city;
    }

    .order-fields__item:nth-child(5) {
        grid-area: email;
    }

    .order-fields__item:nth-child(6) {
        grid-area: address;
    }

    .order-fields:has([data-address-field][hidden]) {
        grid-template-areas:
            "fullName fullName"
            "country country"
            "city city"
            "phone email";
    }

    .order-fields__item {
        gap: 3px;
    }

    .order-fields__error {
        margin-top: 0;
        font-size: 9px;
        line-height: 12px;
    }

    .order-fields__label {
        font-size: 11.04px;
        line-height: 14.71px;
        font-weight: 600;
    }

    .order-fields__control {

        height: 40.2px;
        min-height: 40.2px;
        border-radius: 4px;
        padding: 6px 8px;
        font-size: 11.58px;
        line-height: 14.47px;
        font-weight: 400;
    }

    .order-fields__control::placeholder {
        font-size: 11.58px;
        line-height: 14.47px;
        font-weight: 400;
    }

    .order-fields__item > .order-dropdown .order-dropdown__trigger {
        width: 100%;
        max-width: 100%;
    }

    .order-dropdown__trigger {

        height: 40.2px;
        min-height: 40.2px;
        border-radius: 5.17px;
        border: 1.58px solid #d5d5d5;
        padding: 6px 24px 6px 8px;
        font-size: 11.58px;
        line-height: 14.47px;
        background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
        background-size: 4px 4px, 4px 4px;
    }

    .order-dropdown__menu {
        right: auto;
        width: 100%;
        border-bottom-left-radius: 5.17px;
        border-bottom-right-radius: 5.17px;
    }

    .order-dropdown__option {
        padding: 6px 8px;
        font-size: 11.58px;
        line-height: 14.47px;
    }

    .order-city-search__menu {
        border-bottom-left-radius: 5.17px;
        border-bottom-right-radius: 5.17px;
    }

    .order-city-search__option,
    .order-city-search__empty {
        padding: 6px 8px;
        font-size: 11.58px;
        line-height: 14.47px;
    }

    .order-fields__phone {
        grid-template-columns: 74px 1fr;
        gap: 5px;
    }

    .order-dropdown--prefix .order-dropdown__trigger {
        padding-right: 20px;
        background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
        background-size: 4px 4px, 4px 4px;
    }

    .order-map__hint {
        margin-top: 8px;
        font-size: 11.58px;
        line-height: 14.47px;
    }

    .order-map__warning {
        margin-bottom: 8px;
        font-size: 11.58px;
        line-height: 14.47px;
    }

    .order-form__submit {
        height: 37.76px;
        border-radius: 5.17px;
        font-size: 11.03px;
        line-height: 12.55px;
    }
}
