/* Yandex Delivery checkout integration by Ekleo */
.yandex-delivery-pickup-inline {
    margin: 10px 0 0 26px;
    padding: 12px 14px;
    background: #f7f9fc;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
}
.yandex-delivery-pickup-current {
    color: #172b4d;
    font-size: 13px;
    line-height: 1.45;
}
.yandex-delivery-pickup-current strong { font-weight: 700; }
.yandex-delivery-pickup-delivery {
    margin-top: 3px;
    color: #667790;
    font-size: 12px;
}
.yandex-delivery-pickup-warning {
    margin-top: 7px;
    color: #b54708;
    font-size: 12px;
}
.yandex-delivery-pickup-button {
    margin-top: 9px;
    padding: 7px 12px;
    border: 1px solid #0b5fff;
    border-radius: 7px;
    background: #fff;
    color: #0b5fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.yandex-delivery-pickup-button:hover,
.yandex-delivery-pickup-button:focus {
    background: #eef4ff;
    color: #004fd8;
    outline: 0;
}
body.yandex-delivery-modal-open { overflow: hidden; }
.yandex-delivery-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 28, 47, .58);
}
.yandex-delivery-modal-backdrop.is-open { display: flex; }
.yandex-delivery-modal-dialog {
    width: min(1120px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(7, 24, 48, .25);
}
.yandex-delivery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid #e9edf3;
}
.yandex-delivery-modal-title {
    color: #0e213d;
    font-size: 20px;
    font-weight: 750;
}
.yandex-delivery-modal-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #f2f5f9;
    color: #52637b;
    font-size: 27px;
    line-height: 34px;
    cursor: pointer;
}
.yandex-delivery-modal-search {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eef1f5;
}
#yandex-delivery-point-search {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cfd8e5;
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: #172b4d;
    font-size: 14px;
}
#yandex-delivery-point-search:focus {
    border-color: #0b5fff;
    box-shadow: 0 0 0 3px rgba(11, 95, 255, .10);
}
.yandex-delivery-modal-hint {
    margin-top: 7px;
    color: #8793a5;
    font-size: 11px;
}
.yandex-delivery-modal-body {
    min-height: 360px;
    overflow: hidden;
    padding: 14px 20px 20px;
}
.yandex-delivery-point-state {
    min-height: 20px;
    margin-bottom: 10px;
    color: #728198;
    font-size: 12px;
}
.yandex-delivery-point-state.is-error { color: #b42318; }
.yandex-delivery-point-state.is-loading { color: #0b5fff; }
.yandex-delivery-point-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.yandex-delivery-point-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #dce3ed;
    border-radius: 12px;
    background: #fff;
    color: #172b4d;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.yandex-delivery-point-card:hover:not(:disabled) {
    border-color: #0b5fff;
    box-shadow: 0 5px 18px rgba(10, 70, 180, .10);
    transform: translateY(-1px);
}
.yandex-delivery-point-card.is-selected {
    border-color: #0b5fff;
    box-shadow: inset 0 0 0 1px #0b5fff;
}
.yandex-delivery-point-card.is-disabled {
    background: #fafbfc;
    opacity: .72;
    cursor: not-allowed;
}
.yandex-delivery-point-card.is-loading { opacity: .55; }
.yandex-delivery-point-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}
.yandex-delivery-point-type,
.yandex-delivery-point-selected {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f0f4f9;
    color: #60718a;
    font-size: 10px;
    font-weight: 700;
}
.yandex-delivery-point-selected {
    background: #e8f1ff;
    color: #0b5fff;
}
.yandex-delivery-point-address {
    color: #152b4b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}
.yandex-delivery-point-additional {
    margin-top: 5px;
    color: #77869b;
    font-size: 11px;
    line-height: 1.35;
}
.yandex-delivery-point-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 10px;
    color: #5f7088;
    font-size: 11px;
}
.yandex-delivery-point-cost {
    color: #0d7c43;
    font-weight: 700;
}
.yandex-delivery-point-reason {
    margin-top: 9px;
    color: #a15c00;
    font-size: 11px;
    line-height: 1.35;
}
@media (max-width: 767px) {
    .yandex-delivery-pickup-inline { margin-left: 0; }
    .yandex-delivery-modal-backdrop { padding: 0; align-items: flex-end; }
    .yandex-delivery-modal-dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }
    .yandex-delivery-point-results { grid-template-columns: 1fr; }
    .yandex-delivery-modal-header { padding: 15px 16px; }
    .yandex-delivery-modal-title { font-size: 17px; }
    .yandex-delivery-modal-search { padding: 13px 16px 10px; }
    .yandex-delivery-modal-body { padding: 12px 16px 18px; }
}

.yandex-delivery-shipping-item:has(input[value="yandex-delivery.yandex-delivery"]:disabled) {
    cursor: pointer;
}
.yandex-delivery-shipping-item:has(input[value="yandex-delivery.yandex-delivery"]:disabled) .yandex-delivery-pickup-inline {
    opacity: 1;
}


/* oCheckout 1.x compatibility: the method card is a flex label and is replaced
   through AJAX. Keep our picker as a full-width second line inside that card. */
.ocheckout-page .ock-method .yandex-delivery-pickup-inline {
    flex: 0 0 100%;
    width: 100%;
    margin: 2px 0 0 0;
    padding: 10px 12px;
}
.ocheckout-page .ock-method.yandex-delivery-shipping-item {
    align-items: center;
}
.ocheckout-page .ock-method .yandex-delivery-pickup-button {
    position: relative;
    z-index: 2;
}
@media (max-width: 480px) {
    .ocheckout-page .ock-method .yandex-delivery-pickup-inline {
        margin-left: 0;
        padding: 10px;
    }
    .ocheckout-page .ock-method .yandex-delivery-pickup-button {
        width: 100%;
    }
}

/* v1.2.0: Yandex map + list pickup selector */
.yandex-delivery-picker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
    gap: 14px;
    min-height: 500px;
    height: min(58vh, 560px);
}
.yandex-delivery-map-column,
.yandex-delivery-list-column { min-width: 0; min-height: 0; position: relative; }
.yandex-delivery-map-column { overflow: hidden; border: 1px solid #dce3ed; border-radius: 12px; background: #f5f7fb; }
.yandex-delivery-point-map { width: 100%; height: 100%; min-height: 420px; }
.yandex-delivery-map-message {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: none;
    padding: 9px 11px; border-radius: 9px; background: rgba(255,255,255,.96);
    box-shadow: 0 5px 18px rgba(15,32,58,.14); color: #53647d; font-size: 11px; line-height: 1.4;
}
.yandex-delivery-list-column { overflow-y: auto; padding-right: 3px; }
.yandex-delivery-point-card.is-map-focused { border-color: #0b5fff; box-shadow: 0 0 0 2px rgba(11,95,255,.12); }
.yandex-delivery-map-balloon { max-width: 280px; color: #172b4d; font-size: 12px; line-height: 1.45; }
.yandex-delivery-map-balloon-address { font-weight: 700; }
.yandex-delivery-map-balloon-meta { margin-top: 6px; color: #61728a; }
.yandex-delivery-map-balloon-reason { margin-top: 7px; color: #a15c00; }
.yandex-delivery-map-select {
    margin-top: 9px; padding: 7px 10px; border: 0; border-radius: 7px;
    background: #0b5fff; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
}
@media (max-width: 767px) {
    .yandex-delivery-modal-body { overflow-y: auto; }
    .yandex-delivery-picker-layout { display: flex; flex-direction: column; height: auto; min-height: 0; }
    .yandex-delivery-map-column { flex: 0 0 auto; height: 300px; min-height: 300px; }
    .yandex-delivery-point-map { min-height: 300px; height: 300px; }
    .yandex-delivery-list-column { overflow: visible; max-height: none; }
}


/* v1.0.5 — oCheckout: same pickup card/button language as FivePost and Ozon. */
.ocheckout-page .ock-method.yandex-delivery-shipping-item,
.ocheckout-page .ock-method:has(input[name="shipping_method"][value="yandex_delivery.pickup"]) {
    align-items: center;
}
.ocheckout-page .ock-method > .yandex-delivery-pickup-inline {
    flex: 0 0 100%;
    width: 100%;
    margin: 2px 0 0 0 !important;
    padding: 10px 12px !important;
    background: #f7f9fc;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
}
.ocheckout-page .ock-method > .yandex-delivery-pickup-inline .yandex-delivery-pickup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin-top: 9px;
    padding: 7px 12px;
    border: 1px solid #0b5fff !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #0b5fff !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.ocheckout-page .ock-method > .yandex-delivery-pickup-inline .yandex-delivery-pickup-button:hover,
.ocheckout-page .ock-method > .yandex-delivery-pickup-inline .yandex-delivery-pickup-button:focus {
    background: #eef4ff !important;
    color: #004fd8 !important;
}
@media (max-width: 480px) {
    .ocheckout-page .ock-method > .yandex-delivery-pickup-inline .yandex-delivery-pickup-button { width: auto !important; }
}


/* v1.0.5 — server-rendered oCheckout PVZ control for our exact method. */
.ocheckout-page .ock-method .ock-pvzx-btn[data-fn="yandexDeliveryOpenPickup"] {
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid #0b5fff;
    border-radius: 7px;
    background: #fff;
    color: #0b5fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}
.ocheckout-page .ock-method .ock-pvzx-btn[data-fn="yandexDeliveryOpenPickup"]::before {
    display: none;
}
.ocheckout-page .ock-method .ock-pvzx-btn[data-fn="yandexDeliveryOpenPickup"]:hover,
.ocheckout-page .ock-method .ock-pvzx-btn[data-fn="yandexDeliveryOpenPickup"]:focus {
    background: #eef4ff;
    color: #004fd8;
    outline: 0;
}


/* v1.0.9 — map-only pickup selector and oCheckout cleanup. */
.yandex-delivery-picker-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 500px;
    height: min(62vh, 600px);
}
.yandex-delivery-list-column,
#yandex-delivery-point-results {
    display: none !important;
}
.yandex-delivery-map-column {
    width: 100%;
}
.yandex-delivery-point-map {
    min-height: 500px;
}
.ocheckout-page .ock-method.yandex-delivery-shipping-item .ock-method-sub[data-yandex-delivery-hidden-sub="1"] {
    display: none !important;
}
@media (max-width: 767px) {
    .yandex-delivery-picker-layout { height: 62vh; min-height: 340px; }
    .yandex-delivery-map-column, .yandex-delivery-point-map { height: 100%; min-height: 340px; }
}
