/* FivePost checkout integration by Ekleo */
.fivepost-pickup-inline {
    margin: 10px 0 0 26px;
    padding: 12px 14px;
    background: #f7f9fc;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
}
.fivepost-pickup-current {
    color: #172b4d;
    font-size: 13px;
    line-height: 1.45;
}
.fivepost-pickup-current strong { font-weight: 700; }
.fivepost-pickup-delivery {
    margin-top: 3px;
    color: #667790;
    font-size: 12px;
}
.fivepost-pickup-warning {
    margin-top: 7px;
    color: #b54708;
    font-size: 12px;
}
.fivepost-pickup-button {
    margin-top: 9px;
    padding: 7px 12px;
    border: 1px solid #7f86dd;
    border-radius: 7px;
    background: #fff;
    color: #7f86dd;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.fivepost-pickup-button:hover,
.fivepost-pickup-button:focus {
    background: #f1f2ff;
    color: #6870ca;
    outline: 0;
}
body.fivepost-modal-open { overflow: hidden; }
.fivepost-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);
}
.fivepost-modal-backdrop.is-open { display: flex; }
.fivepost-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);
}
.fivepost-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid #e9edf3;
}
.fivepost-modal-title {
    color: #0e213d;
    font-size: 20px;
    font-weight: 750;
}
.fivepost-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;
}
.fivepost-modal-search {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eef1f5;
}
#fivepost-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;
}
#fivepost-point-search:focus {
    border-color: #7f86dd;
    box-shadow: 0 0 0 3px rgba(127, 134, 221, .12);
}
.fivepost-modal-hint {
    margin-top: 7px;
    color: #8793a5;
    font-size: 11px;
}
.fivepost-modal-body {
    min-height: 360px;
    overflow: hidden;
    padding: 14px 20px 20px;
}
.fivepost-point-state {
    min-height: 20px;
    margin-bottom: 10px;
    color: #728198;
    font-size: 12px;
}
.fivepost-point-state.is-error { color: #b42318; }
.fivepost-point-state.is-loading { color: #7f86dd; }
.fivepost-point-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.fivepost-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;
}
.fivepost-point-card:hover:not(:disabled) {
    border-color: #7f86dd;
    box-shadow: 0 5px 18px rgba(104, 112, 202, .12);
    transform: translateY(-1px);
}
.fivepost-point-card.is-selected {
    border-color: #7f86dd;
    box-shadow: inset 0 0 0 1px #7f86dd;
}
.fivepost-point-card.is-disabled {
    background: #fafbfc;
    opacity: .72;
    cursor: not-allowed;
}
.fivepost-point-card.is-loading { opacity: .55; }
.fivepost-point-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}
.fivepost-point-type,
.fivepost-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;
}
.fivepost-point-selected {
    background: #f1f2ff;
    color: #7f86dd;
}
.fivepost-point-address {
    color: #152b4b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}
.fivepost-point-additional {
    margin-top: 5px;
    color: #77869b;
    font-size: 11px;
    line-height: 1.35;
}
.fivepost-point-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 10px;
    color: #5f7088;
    font-size: 11px;
}
.fivepost-point-cost {
    color: #0d7c43;
    font-weight: 700;
}
.fivepost-point-reason {
    margin-top: 9px;
    color: #a15c00;
    font-size: 11px;
    line-height: 1.35;
}
@media (max-width: 767px) {
    .fivepost-pickup-inline { margin-left: 0; }
    .fivepost-modal-backdrop { padding: 0; align-items: flex-end; }
    .fivepost-modal-dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }
    .fivepost-point-results { grid-template-columns: 1fr; }
    .fivepost-modal-header { padding: 15px 16px; }
    .fivepost-modal-title { font-size: 17px; }
    .fivepost-modal-search { padding: 13px 16px 10px; }
    .fivepost-modal-body { padding: 12px 16px 18px; }
}

.fivepost-shipping-item:has(input[value="fivepost.fivepost"]:disabled) {
    cursor: pointer;
}
.fivepost-shipping-item:has(input[value="fivepost.fivepost"]:disabled) .fivepost-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 .fivepost-pickup-inline {
    flex: 0 0 100%;
    width: 100%;
    margin: 2px 0 0 0;
    padding: 10px 12px;
}
.ocheckout-page .ock-method.fivepost-shipping-item {
    align-items: center;
}
.ocheckout-page .ock-method .fivepost-pickup-button {
    position: relative;
    z-index: 2;
}
@media (max-width: 480px) {
    .ocheckout-page .ock-method .fivepost-pickup-inline {
        margin-left: 0;
        padding: 10px;
    }
    .ocheckout-page .ock-method .fivepost-pickup-button {
        width: 100%;
    }
}

/* v1.3.1 Marsbgame: map-only pickup selector. */
.fivepost-picker-layout {
    display: block;
    width: 100%;
    min-height: 500px;
    height: min(66vh, 620px);
}
.fivepost-map-column {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dce3ed;
    border-radius: 12px;
    background: #f5f7fb;
}
.fivepost-point-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
}
.fivepost-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;
}
.fivepost-map-balloon {
    max-width: 310px;
    color: #172b4d;
    font-size: 12px;
    line-height: 1.45;
}
.fivepost-map-balloon-type {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    margin-bottom: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f2ff;
    color: #6870ca;
    font-size: 10px;
    font-weight: 700;
}
.fivepost-map-balloon-address { font-weight: 700; }
.fivepost-map-balloon-additional { margin-top: 5px; color: #77869b; font-size: 11px; }
.fivepost-map-balloon-meta { margin-top: 6px; color: #61728a; }
.fivepost-map-balloon-reason { margin-top: 7px; color: #a15c00; }
.fivepost-map-select {
    margin-top: 9px;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: #7f86dd;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.fivepost-map-select:hover,
.fivepost-map-select:focus {
    background: #6870ca;
    outline: 0;
}
@media (max-width: 767px) {
    .fivepost-modal-body { overflow: hidden; }
    .fivepost-picker-layout {
        height: min(66vh, 560px);
        min-height: 360px;
    }
    .fivepost-map-column,
    .fivepost-point-map {
        min-height: 360px;
        height: 100%;
    }
}


/* =========================================================
   Marsbgame SimpleCheckout integration
   ========================================================= */
#simplecheckout_shipping .fivepost-shipping-item {
    display: block;
}

#simplecheckout_shipping .fivepost-shipping-item .fivepost-pickup-inline,
#simplecheckout_shipping .fivepost-select-mode .fivepost-pickup-inline {
    margin: 10px 0 0 0;
    padding: 12px 14px;
    border: 1px solid #e2e4f4;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f8ff 0%, #f3f4ff 100%);
}

#simplecheckout_shipping .fivepost-shipping-item .fivepost-pickup-current,
#simplecheckout_shipping .fivepost-select-mode .fivepost-pickup-current {
    color: #32343d;
}

#simplecheckout_shipping .fivepost-pickup-button {
    border-color: #7f86dd;
    background: #7f86dd;
    color: #fff;
    border-radius: 10px;
    padding: 8px 13px;
}

#simplecheckout_shipping .fivepost-pickup-button:hover,
#simplecheckout_shipping .fivepost-pickup-button:focus {
    border-color: #6870ca;
    background: #6870ca;
    color: #fff;
}

#simplecheckout_shipping .fivepost-shipping-item:has(input[value="fivepost.fivepost"]:disabled) {
    border-color: rgba(127, 134, 221, .45);
    background: rgba(127, 134, 221, .035);
    cursor: pointer;
}

#simplecheckout_shipping .fivepost-shipping-item:has(input[value="fivepost.fivepost"]:disabled) label {
    cursor: pointer;
}

#simplecheckout_shipping .fivepost-select-mode {
    margin-top: 10px;
}

.fivepost-point-card.is-selected,
.fivepost-point-card.is-map-focused {
    border-color: #7f86dd;
}

.fivepost-point-selected,
.fivepost-point-state.is-loading {
    color: #6870ca;
}

.fivepost-map-select {
    background: #7f86dd;
}

@media (max-width: 767px) {
    #simplecheckout_shipping .fivepost-shipping-item .fivepost-pickup-inline,
    #simplecheckout_shipping .fivepost-select-mode .fivepost-pickup-inline {
        padding: 11px 12px;
    }

    #simplecheckout_shipping .fivepost-pickup-button {
        width: 100%;
    }
}
