.shipping_fields_wrapper {
    position: relative;
}

/* The same checkout form opens on product pages without woocommerce-checkout. */
.popup-catalog .delivery-block .shipping_fields_wrapper>.div-block-17.shipping_fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 25rem;
    column-gap: 0;
    align-items: start;
}

.popup-catalog .lineinput,
.popup-catalog .lineinput:focus {
    outline-color: transparent;
}

.popup-catalog .lineinput:focus-visible {
    box-shadow: inset 0 -2px #fff;
}

.shipping_fields_wrapper:not(.is-ready)>.shipping_fields {
    display: none !important;
}

.shipping_fields_wrapper.is-ready>.hajime-shipping-init {
    display: none;
}

.hajime-shipping-init {
    min-height: 70px;
    color: #aaa;
    font-size: 14rem;
}

.hajime-shipping-retry {
    display: block;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid #fff;
    color: #fff;
    background: transparent;
    cursor: pointer;
}

.hajime-shipping-retry[hidden] {
    display: none;
}

.delivery-block:has(#shipping_method_0_flat_rate6:checked) .shipping_fields>.hajime-cdek-checkout-field {
    display: block;
}

.delivery-block:has(#shipping_method_0_flat_rate6:checked) .shipping_fields>.hajime-cdek-picker-open:not([hidden]) {
    display: inline-flex;
}

.delivery-block:has(#shipping_method_0_flat_rate3:checked) .shipping_fields>.hajime-cdek-checkout-punkt,
.delivery-block:has(#shipping_method_0_flat_rate3:checked) .shipping_fields>.hajime-cdek-checkout-city,
.delivery-block:has(#shipping_method_0_flat_rate3:checked) .shipping_fields>.hajime-cdek-picker-open {
    display: none !important;
}

.delivery-block:has(#shipping_method_0_flat_rate6:checked) .shipping_fields #shipping_punkt {
    display: none;
}

.shipping_fields>.hajime-cdek-checkout-field {
    grid-column: 1 / -1;
    position: relative;
    width: 100%;
}

.hajime-cdek-checkout-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hajime-cdek-checkout-value {
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 30rem;
    padding: 0 0 9rem;
    border: 0;
    border-bottom: 1px solid #fff;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 15rem;
    line-height: 1.3;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    outline-color: transparent;
    overflow-wrap: anywhere;
}

.hajime-cdek-checkout-value.is-empty {
    color: #4c4c4c;
}

.hajime-cdek-picker-open {
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    width: 221rem;
    max-width: 100%;
    min-height: 52rem;
    margin-top: 0;
    padding: 3rem 16rem;
    border: 1px solid #fff;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 15rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    outline-color: transparent;
}

.popup-catalog .shipping_fields>.hajime-cdek-picker-open:not([hidden]) {
    grid-column: 1 / -1;
    margin-top: -9rem;
}

.hajime-cdek-picker-change {
    background: transparent;
    color: #fff;
}

.hajime-cdek-picker-open[hidden] {
    display: none !important;
}

.hajime-cdek-picker-open:hover,
.hajime-cdek-picker-open:active {
    background: #ddd;
    color: #000;
}

.hajime-cdek-picker-change:hover,
.hajime-cdek-picker-change:active {
    background: #fff;
}

.hajime-cdek-checkout-value:focus-visible,
.hajime-cdek-picker-open:focus-visible {
    box-shadow: inset 0 -2px #fff;
}

.hajime-cdek-picker-open:disabled,
.hajime-cdek-checkout-value:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.hajime-cdek-checkout-value:disabled {
    color: #777;
    opacity: 1;
}

@media (max-width: 834px) {
    .popup-catalog:has(.show-delivery) {
        position: fixed;
        inset: 54px 0 0;
        display: block;
        overflow: auto;
        background: #000;
    }

    .popup-catalog:has(.show-delivery)>.close-pop {
        display: none;
    }

    .popup-catalog:has(.show-delivery) .pop-content.pop-up-cat.show-delivery {
        position: relative;
        inset: auto;
        width: 100%;
        max-width: none;
        min-height: 100%;
        height: auto;
        padding: 22px 17px 28px;
        overflow: visible;
    }

    .popup-catalog:has(.show-delivery) .pop-content.pop-up-cat.show-delivery>.spleet {
        display: none;
    }

    .popup-catalog:has(.show-delivery) .cart-in-popup {
        max-height: none;
        margin: 0;
        overflow: visible;
    }

    .popup-catalog:has(.show-delivery) .delivery-block {
        position: relative;
        inset: auto;
        z-index: auto;
        width: 100%;
        max-width: none;
        min-height: 0;
        align-items: stretch;
        padding: 0;
        overflow: visible;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18 {
        width: 100%;
        max-width: none;
        margin-top: 30px;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18._1 {
        margin-top: 0;
    }

    .popup-catalog:has(.show-delivery) .delivery-block .div-block-17 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 479px) {
    .popup-catalog:has(.show-delivery) .cart-in-popup {
        font-size: 15px;
        line-height: 1.3;
    }

    .popup-catalog:has(.show-delivery) .pop-content.pop-up-cat.show-delivery {
        padding: 29px 15px 15px;
    }

    .popup-catalog:has(.show-delivery) .delivery-block {
        flex-direction: column;
        gap: 0;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18 {
        margin-top: 60px;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18._1 {
        margin-top: 0;
    }

    .popup-catalog:has(.show-delivery) .delivery-block .p-15-20 {
        padding-bottom: 0;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.3;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18 .div-block-17 {
        grid-template-columns: 1fr;
        margin-top: 29.5px;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.div-block-18._1>.div-block-17 {
        /* The upstream stylesheet sets the billing row gap to zero with !important. */
        row-gap: 25px !important;
    }

    .popup-catalog:has(.show-delivery) .delivery-block wc-order-attribution-inputs {
        display: none;
    }

    .popup-catalog:has(.show-delivery) .lineinput {
        min-width: 0;
        width: 100%;
        min-height: 30px;
        margin-bottom: 0;
        padding-bottom: 9px;
        font-size: 15px;
        line-height: 1.3;
    }

    .popup-catalog:has(.show-delivery) .delivery-block .cart-shipping-wrapper {
        row-gap: 24px;
    }

    .popup-catalog:has(.show-delivery) .radio-prod {
        margin-bottom: 0;
        font-size: 15px;
        font-weight: 500;
    }

    .popup-catalog:has(.show-delivery) .radio-prod_span {
        font-weight: 500;
    }

    .popup-catalog:has(.show-delivery) .radio-prod:has(>input)::before {
        box-sizing: border-box;
        width: 17px;
        height: 17px;
        margin-right: 15px;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.shipping_fields_wrapper {
        margin-top: 39px;
        padding-top: 0;
    }

    .popup-catalog:has(.show-delivery) .delivery-block>.shipping_fields_wrapper>.shipping_fields,
    .popup-catalog:has(.show-delivery) .delivery-block:has(#shipping_method_0_flat_rate6:checked)>.shipping_fields_wrapper>.shipping_fields {
        margin-top: 0;
        row-gap: 25px;
    }

    .popup-catalog:has(.show-delivery) .shipping_fields>.hajime-cdek-picker-open:not([hidden]) {
        margin-top: -5px;
    }

    .popup-catalog:has(.show-delivery) .cart-form-wrapper {
        display: none;
    }

    .popup-catalog:has(.show-delivery) .div-block-15.final {
        padding-top: 60px;
        padding-bottom: 0;
    }

    .popup-catalog:has(.show-delivery) .cart-totals-wrapper {
        margin-top: 25px;
    }

    .popup-catalog:has(.show-delivery) .cart_totals {
        gap: 9.5px;
    }

    .popup-catalog:has(.show-delivery) .p-12-18.in-form {
        margin-top: 20px;
        font-size: 12px;
        line-height: 1.4;
    }

    html:has(.popup-catalog .show-delivery) .navbar .brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        padding: 0;
        font-size: 15px;
        font-weight: 500;
    }

    .hajime-cdek-picker-open {
        width: 100%;
        min-height: 52px;
        padding: 3px 16px;
        font-size: 15px;
    }

    .hajime-cdek-checkout-value {
        min-height: 30px;
        padding-bottom: 9px;
        font-size: 15px;
    }

    .popup-catalog:has(.show-delivery) .submit_order_wrapper>.sumb {
        height: 52px;
        font-size: 15px;
    }
}

.hajime-cdek-map-actions { grid-column: 1 / -1; width: 100%; }
.hajime-cdek-map-actions button { width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid #fff; background: #fff; color: #000; font: inherit; font-size: 14rem; text-transform: uppercase; cursor: pointer; }
.hajime-cdek-map-actions button:focus-visible { outline-color: transparent; box-shadow: inset 0 -2px #fff; }

.hajime-cdek-picker[hidden],
.hajime-cdek-picker [hidden] {
    display: none !important;
}

.hajime-cdek-picker {
    position: fixed;
    z-index: 100001;
    inset: 0;
    color: #fff;
    font-family: inherit;
    font-size: 15rem;
    line-height: 1.45;
}

.hajime-cdek-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 82%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.hajime-cdek-picker.is-open .hajime-cdek-picker__backdrop {
    opacity: 1;
}

.hajime-cdek-picker__panel {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(var(--hajime-cdek-drawer-width, 477px), 100vw);
    height: 100%;
    height: 100dvh;
    background: #000;
    border-left: 1px solid #444;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.hajime-cdek-picker.is-open .hajime-cdek-picker__panel {
    transform: translateX(0);
}

.hajime-cdek-picker__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 8px;
}

.hajime-cdek-picker h2 {
    margin: 0;
    color: #fff;
    font: inherit;
    font-size: 15rem;
    font-weight: 600;
    line-height: 1.35;
    text-transform: uppercase;
}

.hajime-cdek-picker__close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 30rem;
    line-height: 1;
    cursor: pointer;
}

.hajime-cdek-picker__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 18px 20px 28px;
}

.hajime-cdek-picker label {
    display: block;
    margin-bottom: 7px;
    color: #777;
    font-size: 14rem;
    text-transform: uppercase;
}

.hajime-cdek-picker input[type="search"] {
    display: block;
    width: 100%;
    min-height: 30px;
    padding: 0 0 7px;
    border: 0;
    border-bottom: 1px solid #fff;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 15rem;
    outline-color: transparent;
}

.hajime-cdek-picker input::placeholder {
    color: #777;
}

.hajime-cdek-picker__status {
    min-height: 1.5em;
    margin: 8px 0;
    color: #777;
    font-size: 12rem;
}

.hajime-cdek-picker__city-results {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.hajime-cdek-picker__city-results li {
    border-bottom: 1px solid #444;
}

.hajime-cdek-picker__city-option {
    display: block;
    width: 100%;
    padding: 15px 2px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hajime-cdek-picker__city-option:hover {
    background: #222;
}

.hajime-cdek-picker__error button {
    min-height: 42px;
    margin-top: 15px;
    padding: 8px 16px;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.hajime-cdek-picker__error {
    padding: 12px 0;
    color: #fff;
}

.hajime-cdek-picker__error p {
    margin: 0;
}

body.hajime-cdek-picker-lock {
    overflow: hidden;
}

@media (max-width: 700px) {
    .hajime-cdek-picker {
        top: 54px;
        font-size: 15px;
        line-height: 1.4;
    }

    .hajime-cdek-picker__panel {
        width: 100vw;
        height: 100%;
        border-left: 0;
    }

    .hajime-cdek-picker__header {
        padding: 27px 15px 0;
    }

    .hajime-cdek-picker h2 {
        font-size: 15px;
        font-weight: 500;
        line-height: 1.3;
    }

    .hajime-cdek-picker__close {
        transform: translate(10px, -10px);
    }

    .hajime-cdek-picker .hajime-cdek-picker__body {
        padding: 15px 15px 26px;
        scrollbar-gutter: auto;
    }

    .hajime-cdek-picker label {
        font-size: 15px;
        color: #4c4c4c;
    }

    .hajime-cdek-picker input[type="search"] {
        font-size: 15px;
    }

    .hajime-cdek-picker__status {
        font-size: 12px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .hajime-cdek-picker__backdrop,
    .hajime-cdek-picker__panel {
        transition: none;
    }
}

.hajime-cdek-picker__search { position: relative; }
.hajime-cdek-picker__search input { box-sizing: border-box; padding-right: 44px; }
#hajime-cdek-city-clear { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: 0; background: transparent; color: #fff; font: inherit; cursor: pointer; }
.hajime-cdek-picker__close { min-width: 44px; min-height: 44px; }
.hajime-cdek-picker :focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.hajime-cdek-picker input[type="search"]:focus-visible { outline-color: transparent; box-shadow: inset 0 -2px #fff; }
.hajime-cdek-picker__body { scrollbar-color: #777 #000; scrollbar-width: thin; scrollbar-gutter: stable; }

