.phone-input {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.phone-input > .chosen-container {
    position: relative !important;
    display: block;
    flex: 0 0 120px;
    width: 120px !important;
    min-width: 0;
    height: 48px;
}

.phone-input > .chosen-container.chosen-with-drop,
.phone-input > .chosen-container.chosen-container-active.chosen-with-drop {
    height: 48px !important;
}

.profile .profile-data .profile-right .profile-data .data-data fieldset .phone-input > .chosen-container {
    width: 120px !important;
}

/* Same width as the other profile inputs: they are capped at 310px from 768px up and full width on mobile.
   120px code + 8px gap leaves ~182px for the number on desktop. */
@media (min-width: 768px) {
    .profile .profile-data .profile-right .profile-data .data-data fieldset .phone-input {
        max-width: 310px;
    }
}

/* Profile checkbox label: the generic profile label rule (display:block, 20px left padding) beat .check-label,
   so the checkbox was indented and wrapped text went under it. */
.profile .profile-data .profile-right .profile-data .data-data fieldset label.check-label {
    display: flex;
    padding: 0;
    font-weight: normal;
}

.phone-input > .chosen-container .chosen-single {
    box-sizing: border-box;
    height: 48px !important;
    width: 100%;
}

.phone-input input[type="tel"] {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.checkout .block .data fieldset .phone-input input[type="tel"],
.registration .phone-input input[type="tel"] {
    height: 48px;
    color: #000;
    font-size: 14px;
    border: 1px solid #000;
    border-radius: 30px;
    padding: 0 22px;
}

.registration .phone-input {
    margin-bottom: 24px;
}

.registration .phone-input input[type="tel"],
.registration .phone-input input[type="tel"]::placeholder {
    text-transform: none;
}

.registration .phone-input > .chosen-container .chosen-single {
    padding-left: 22px;
    text-transform: none;
}

.registration .phone-input > .chosen-container .chosen-single span {
    font-size: 14px;
}

.registration .phone-input > .chosen-container .chosen-single span::after {
    top: 18px;
    width: 18px;
    height: 9px;
    background: url(img/svg-languages.svg) no-repeat right top;
    background-size: cover;
}

.registration .phone-input .chosen-drop,
.registration .phone-input .chosen-results li {
    text-align: left !important;
}

.registration .phone-input .chosen-results li {
    padding-left: 18px;
}

.profile .profile-data .profile-right .profile-data .data-data .phone-input input[type="tel"] {
    height: 48px;
    border: 1px solid #000;
    border-radius: 30px;
    padding: 0 22px;
}

.phone-input > .chosen-container .chosen-single {
    border: 1px solid #000;
    border-radius: 30px;
    min-height: 48px;
    line-height: 46px;
}

.checkout .phone-input > .chosen-container .chosen-single,
.registration .phone-input > .chosen-container .chosen-single {
    min-height: 48px;
    line-height: 46px;
    padding-right: 34px;
}

.profile .profile-data .profile-right .profile-data .data-data fieldset .phone-input .chosen-single {
    padding-right: 34px;
}

.checkout .phone-input > .chosen-container .chosen-single span,
.registration .phone-input > .chosen-container .chosen-single span {
    padding-top: 7px;
    padding-left: 0;
    padding-right: 0;
    margin-right: 0;
    float: none;
    overflow: visible;
    text-align: left !important;
}

.profile .profile-data .profile-right .profile-data .data-data fieldset .phone-input .chosen-single span {
    padding-top: 7px;
    padding-right: 0;
    margin-right: 0;
    float: none;
    overflow: visible;
    text-align: left !important;
}

.phone-input > .chosen-container .chosen-single span::after {
    right: -15px !important;
}

.phone-input input[type="tel"].error {
    border-color: #e53935;
}

.phone-input .chosen-drop {
    position: absolute !important;
    top: 100%;
    min-width: 245px;
    background: #fff !important;
    border: 0;
    box-shadow: none;
}

.phone-input .chosen-results {
    height: auto !important;
    max-height: 200px;
    overflow-y: auto;
    background: #fff !important;
}

.profile.profile--editing-phone .profile-data,
.profile.profile--editing-phone #personal .data-data {
    overflow: visible;
}

.profile.profile--editing-phone #personal {
    position: relative;
    z-index: 5;
}

.checkout .block-customer {
    position: relative;
    z-index: 5;
}

.basket.basket--checkout {
    display: flow-root;
    overflow: visible;
}

.checkout .block-customer .checkout-table {
    display: flow-root;
    overflow: visible;
}

.checkout .block-customer .checkout-table__col:first-child {
    position: relative;
    z-index: 2;
}

.checkout .block-customer .customer_phone_fieldset {
    position: relative;
    z-index: 10;
}

.checkout .phone-input > .chosen-container.chosen-with-drop,
.profile .phone-input > .chosen-container.chosen-with-drop {
    z-index: 20;
}

.checkout .pickupPoinSelectCity > br {
    display: none;
}

.checkout .pickupPoinSelectCity > .chosen-container {
    position: relative !important;
    display: block !important;
    top: auto !important;
    height: 48px !important;
    margin: 0 0 20px !important;
}

.checkout .pickupPoinSelectCity > .chosen-container.chosen-with-drop {
    z-index: 20;
}

.checkout .pickupPoinSelectCity .chosen-drop,
.checkout .country_fieldset .chosen-drop {
    position: absolute !important;
    top: 100%;
}

.checkout .pickupPoinSelectCity .chosen-results {
    height: auto !important;
    max-height: 200px;
    overflow-y: auto;
}

/* The compiled theme hides Chosen's search row for every single select. */
.checkout .country_fieldset .chosen-search,
.checkout .pickupPoinSelectCity .chosen-search,
.phone-input .chosen-search {
    display: block !important;
    position: relative !important;
    left: auto !important;
    padding: 8px;
}

.checkout .country_fieldset .chosen-search input[type="text"],
.checkout .pickupPoinSelectCity .chosen-search input[type="text"],
.phone-input .chosen-search input[type="text"] {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 1px solid #bbb !important;
    border-radius: 5px !important;
    background: #fff !important;
    font-size: 14px;
    line-height: 34px !important;
}

@media (max-width: 767px) {
    .checkout .country_fieldset > .chosen-container,
    .checkout .pickupPoinSelectCity .chosen-container {
        width: 100% !important;
    }
}

/* Mobile: the theme makes every .chosen-container position:absolute (desktop reserves 70px of padding for it),
   but responsive.css cuts that padding, so the country dropdown overlapped the delivery select below it. */
@media (max-width: 768px) {
    .checkout .country_fieldset > .chosen-container {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: 48px;
        margin: 0;
    }

    .checkout .country_fieldset > .chosen-container.chosen-with-drop {
        z-index: 20;
    }
}

/* Mobile checkout, customer block:
   - the two columns stack, but responsive.css left 30px of side padding, so inputs were narrower than the dropdowns above;
   - the newsletter checkbox sat in the first column, i.e. between the phone and the city field. It goes last. */
@media (max-width: 768px) {
    .checkout .block-customer .checkout-table {
        display: flex;
        flex-direction: column;
        margin-left: 0;
        margin-right: 0;
    }

    .checkout .block-customer .checkout-table__col {
        display: contents;
    }

    .checkout .block-customer .checkout-table .newsletter_fieldset {
        order: 99;
    }
}
