#deliveryplz-modal {
    --rf-deliveryplz-brand: #ff4900;
    --rf-deliveryplz-brand-soft: rgba(255, 73, 0, 0.08);
    --rf-deliveryplz-border: #ded8d5;
    --rf-deliveryplz-text: #372b27;
    --rf-deliveryplz-muted: #6d6461;
}

body.deliveryplz-bottom-sheet-open {
    overflow: hidden;
}

.deliveryplz-bottom-sheet {
    display: none;
}

@media (max-width: 767.98px) {
    .deliveryplz-bottom-sheet {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2100;
        visibility: hidden;
        pointer-events: none;
    }

    .deliveryplz-bottom-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        transition: opacity .25s ease;
    }

    .deliveryplz-bottom-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 70vh;
        min-height: 55vh;
        overflow-y: auto;
        padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
        background: #fff;
        box-shadow: 0 -12px 36px rgba(15, 23, 42, .2);
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    }

    .deliveryplz-bottom-sheet.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    .deliveryplz-bottom-sheet.is-open .deliveryplz-bottom-sheet__backdrop {
        opacity: 1;
    }

    .deliveryplz-bottom-sheet.is-open .deliveryplz-bottom-sheet__panel {
        transform: translateY(0);
    }

    .deliveryplz-bottom-sheet__handle {
        width: 38px;
        height: 4px;
        margin: 0 auto 13px;
        border-radius: 999px;
        background: #b8b8b8;
    }

    .deliveryplz-bottom-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 20px;
    }

    .deliveryplz-bottom-sheet__header h2 {
        margin: 0;
        color: #161616;
        font-size: 1.05rem;
        font-weight: 800;
    }

    .deliveryplz-bottom-sheet__close {
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #555;
        font-size: 1.6rem;
        line-height: 1;
    }

    .deliveryplz-bottom-sheet__label {
        margin-bottom: 8px;
        color: #161616;
        font-size: .82rem;
        font-weight: 800;
    }

    .deliveryplz-bottom-sheet__label--time {
        margin-top: 23px;
    }

    .deliveryplz-bottom-sheet__type-grid,
    .deliveryplz-bottom-sheet__time-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .deliveryplz-bottom-sheet__choice {
        min-height: 48px;
        padding: 10px 8px;
        border: 1px solid #dedede;
        border-radius: 10px;
        background: #fff;
        color: #242424;
        font-size: .82rem;
        font-weight: 700;
    }

    .deliveryplz-bottom-sheet__choice i {
        margin-right: 5px;
        font-size: 1rem;
        color: #ff4900;
    }

    .deliveryplz-bottom-sheet__choice.is-active {
        border-color: #ff4900;
        background: #ff4900;
        color: #fff;
    }

    .deliveryplz-bottom-sheet__choice.is-active i {
        color: #fff;
    }

    .deliveryplz-bottom-sheet__address[hidden] {
        display: none;
    }

    .deliveryplz-bottom-sheet__address {
        margin-top: 14px;
    }

    .deliveryplz-bottom-sheet__address-row {
        display: flex;
        gap: 8px;
    }

    .deliveryplz-bottom-sheet__address-row .form-control {
        min-height: 44px;
        border-radius: 10px;
        border-color: #dedede;
        /* Mobile Safari zooms focused inputs below 16px. Keep the address
           field readable and prevent automatic page zoom on focus. */
        font-size: 16px;
    }

    .deliveryplz-bottom-sheet__location {
        flex: 0 0 44px;
        min-height: 44px;
        border: 1px solid #dedede;
        border-radius: 10px;
        background: #fff;
        color: #ff4900;
    }

    .deliveryplz-bottom-sheet__address-error {
        margin-top: 6px;
        color: #c62828;
        font-size: .75rem;
    }

    .deliveryplz-bottom-sheet__suggestions {
        position: relative;
        z-index: 2;
        max-height: min(240px, 36vh);
        overflow-y: auto;
        overflow-x: hidden;
        margin-top: 4px;
        border: 1px solid #dedede;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
    }

    .deliveryplz-bottom-sheet__planned {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 12px;
        padding: 10px;
        border-radius: 12px;
        background: #fff5ef;
    }

    .deliveryplz-bottom-sheet__planned[hidden] {
        display: none;
    }

    .deliveryplz-bottom-sheet__planned label {
        display: block;
        margin-bottom: 5px;
        color: #3b3b3b;
        font-size: .72rem;
        font-weight: 600;
    }

    .deliveryplz-bottom-sheet__planned .form-select {
        min-height: 42px;
        border-radius: 10px;
        border-color: #dedede;
        font-size: .8rem;
    }

    .deliveryplz-bottom-sheet__submit {
        width: 100%;
        min-height: 48px;
        margin-top: 18px;
        border: 0;
        border-radius: 12px;
        background: #ff4900;
        color: #fff;
        font-size: .9rem;
        font-weight: 800;
    }
}

#deliveryplz-marketplace-modal .modal-dialog {
    width: min(600px, calc(100% - 24px));
    max-width: 600px;
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    overflow: visible;
}

#deliveryplz-marketplace-modal .modal-content {
    border: 0;
    border-radius: 16px;
    padding: 24px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    box-shadow: 0 24px 70px rgba(20, 20, 20, .28);
}

.deliveryplz-marketplace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.deliveryplz-marketplace-head h2 {
    margin: 0;
    color: #2f343d;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.deliveryplz-marketplace-close {
    width: 36px;
    height: 36px;
    padding: 6px;
    border: 0;
    background: transparent;
    color: #30343b;
}

.deliveryplz-marketplace-close svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.deliveryplz-marketplace-field { position: relative; }

#deliveryplz-marketplace-address {
    width: 100%;
    height: 49px;
    border: 1px solid #8e8b88;
    border-radius: 12px;
    padding: 0 14px;
    color: #2f343d;
    font-size: 1rem;
    outline: none;
}

#deliveryplz-marketplace-address:focus {
    border-color: #ff4d00;
    box-shadow: 0 0 0 3px rgba(255, 77, 0, .12);
}

#deliveryplz-marketplace-suggestions {
    position: relative;
    top: auto;
    left: 0;
    right: 0;
    z-index: 2;
    width: 100%;
    max-height: min(300px, 42vh);
    margin-top: 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.deliveryplz-marketplace-location {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin-top: 8px;
    padding: 15px 2px 8px;
    border: 0;
    background: transparent;
    color: #252a31;
    text-align: left;
}

.deliveryplz-marketplace-location i { width: 20px; color: #30343b; }

.deliveryplz-marketplace-history {
    margin-top: 14px;
    border-top: 1px solid #eee9e6;
    padding-top: 12px;
}

.deliveryplz-marketplace-history__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    color: #30343b;
    font-size: .9rem;
}

.deliveryplz-marketplace-history__edit {
    border: 0;
    background: transparent;
    color: #ff4d00;
    font-size: .78rem;
    cursor: pointer;
}

.deliveryplz-marketplace-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #f1eeec;
    background: #fff;
    color: #30343b;
    text-align: left;
    cursor: pointer;
}

.deliveryplz-marketplace-history__item:hover { background: #fff7f3; }

.deliveryplz-address-suggestion.is-active { background: #fff1ea; color: #ff4d00; }

.deliveryplz-marketplace-history__remove {
    flex: 0 0 auto;
    margin-left: 10px;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.deliveryplz-marketplace-save:disabled { opacity: .55; }

.deliveryplz-marketplace-error {
    margin-top: 12px;
    color: #b42318;
    font-size: .86rem;
}

@media (max-width: 575.98px) {
    #deliveryplz-marketplace-modal .modal-dialog { align-items: flex-end; min-height: 100%; margin: 0 auto; }
    #deliveryplz-marketplace-modal .modal-dialog { max-height: 100vh; }
    #deliveryplz-marketplace-modal .modal-content {
        border-radius: 18px 18px 0 0;
        max-height: calc(100vh - 8px);
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    }
    #deliveryplz-marketplace-suggestions { max-height: min(280px, 38vh); }
    .deliveryplz-marketplace-head h2 { font-size: 1.25rem; }
}

#deliveryplz-modal .modal-dialog {
    max-width: 560px;
    margin: 1.5rem auto;
}

#deliveryplz-modal .modal-content {
    border-radius: 28px;
    border: 0;
    background: #fff;
    padding: 1.8rem 1.7rem 1.9rem;
    color: var(--rf-deliveryplz-text);
    box-shadow: 0 26px 54px rgba(55, 43, 39, 0.18);
    position: relative;
}

#deliveryplz-modal .modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 28px 28px 0 0;
    background: var(--rf-deliveryplz-brand);
}

.deliveryplz-modal-body {
    text-align: center;
    padding-top: 0.35rem;
}

.deliveryplz-section {
    border: 0;
    border-radius: 28px;
    padding: 1.45rem 1.15rem 1.2rem;
    box-shadow: 0 12px 34px rgba(255, 73, 0, 0.05);
    background: linear-gradient(180deg, rgba(255, 251, 249, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.deliveryplz-section + .deliveryplz-section {
    margin-top: 1.75rem;
}

.deliveryplz-language-select-wrap {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.8rem 0;
}

.deliveryplz-language-select {
    width: auto;
    min-width: 118px;
    max-width: 180px;
    border-radius: 999px;
    border-color: rgba(255, 73, 0, 0.28);
    color: var(--rf-deliveryplz-text);
    font-weight: 600;
    font-size: 0.82rem;
    background-color: #fff;
    box-shadow: 0 8px 18px rgba(55, 43, 39, 0.08);
}

.deliveryplz-language-select:focus {
    border-color: var(--rf-deliveryplz-brand);
    box-shadow: 0 0 0 0.2rem rgba(255, 73, 0, 0.18);
}

.deliveryplz-title {
    font-size: 1.02rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding-right: 0;
    letter-spacing: -0.01em;
    text-align: center;
}

.deliveryplz-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    color: rgba(55, 43, 39, 0.72);
    font-weight: 600;
    padding: 0;
    margin: -0.15rem 0 0.9rem;
    justify-content: center;
}

.deliveryplz-back i {
    color: rgba(55, 43, 39, 0.6);
}

.deliveryplz-back:hover {
    color: var(--rf-deliveryplz-text);
    text-decoration: underline;
}

.deliveryplz-back:focus-visible {
    outline: 3px solid rgba(255, 73, 0, 0.35);
    outline-offset: 4px;
    border-radius: 10px;
}

.deliveryplz-back-time {
    display: none;
}

#deliveryplz-step-time > .deliveryplz-back:not(.deliveryplz-back-time) {
    margin-top: 0.35rem;
}

.deliveryplz-toggle,
.deliveryplz-time-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.deliveryplz-time-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.deliveryplz-time-toggle button {
    width: 100%;
}

.deliveryplz-toggle button,
.deliveryplz-time-toggle button {
    border-radius: 14px;
    border: 1px solid var(--rf-deliveryplz-border);
    background: #fff;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--rf-deliveryplz-text);
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(55, 43, 39, 0.07);
}

.deliveryplz-time-toggle button[data-time-choice="asap"] {
    min-width: 150px;
}

.deliveryplz-time-toggle.deliveryplz-only-later {
    grid-template-columns: 1fr;
}

.deliveryplz-time-toggle.deliveryplz-only-later [data-time-choice="asap"] {
    display: none;
}

.deliveryplz-toggle button small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--rf-deliveryplz-muted);
}

.deliveryplz-toggle button.is-active,
.deliveryplz-time-toggle button.is-active {
    background: var(--rf-deliveryplz-brand);
    border-color: var(--rf-deliveryplz-brand);
    color: #fff;
    box-shadow: 0 10px 22px rgba(255, 73, 0, 0.35);
}

.deliveryplz-toggle button.is-active small {
    color: #fff;
    opacity: 0.9;
}

.deliveryplz-toggle button:focus-visible,
.deliveryplz-time-toggle button:focus-visible {
    outline: 3px solid rgba(255, 73, 0, 0.35);
    outline-offset: 2px;
}

.deliveryplz-input-group {
    display: flex;
    align-items: stretch;
    border-radius: 18px;
    border: 1px solid var(--rf-deliveryplz-border);
    overflow: hidden;
    margin-top: 0.75rem;
    background: #fff;
}

.deliveryplz-input-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    color: var(--rf-deliveryplz-brand);
    background: var(--rf-deliveryplz-brand-soft);
}

.deliveryplz-input-group .form-control {
    border: none;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    text-align: center;
    font-weight: 600;
    color: var(--rf-deliveryplz-text);
}

.deliveryplz-input-group .form-control:focus {
    box-shadow: none;
}

.deliveryplz-input-group button {
    border: none;
    background: var(--rf-deliveryplz-brand);
    color: #fff;
    padding: 0 1.25rem;
}

.deliveryplz-helper {
    font-size: 0.9rem;
    color: var(--rf-deliveryplz-muted);
    margin-top: 1rem;
    text-align: center;
}

.deliveryplz-address-grid {
    display: grid;
    gap: 0.8rem;
    text-align: left;
}

.deliveryplz-address-single {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    border-radius: 14px;
    border: 2px solid var(--rf-deliveryplz-brand);
    background: #fff;
    padding: 0.55rem 0.9rem 0.55rem;
    min-height: 64px;
    box-sizing: border-box;
}

.deliveryplz-address-single i {
    color: rgba(55, 43, 39, 0.72);
    font-size: 1rem;
    flex: 0 0 auto;
    margin-top: 0.9rem;
}

.deliveryplz-address-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding-top: 0.05rem;
}

.deliveryplz-address-label {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.8rem;
    line-height: 1.1;
    color: rgba(55, 43, 39, 0.72);
    font-weight: 500;
    text-align: left;
}

.deliveryplz-address-single .form-control {
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    color: var(--rf-deliveryplz-text);
    font-weight: 600;
    box-shadow: none !important;
    font-size: 1rem;
    line-height: 1.25;
    background: transparent !important;
    outline: none !important;
    min-height: 1.4rem;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}

.deliveryplz-address-single .form-control:focus {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
}

.deliveryplz-address-single .form-control::placeholder {
    color: rgba(55, 43, 39, 0.42);
}

.deliveryplz-address-single:focus-within {
    border-color: var(--rf-deliveryplz-brand);
    box-shadow: 0 0 0 0.16rem rgba(255, 73, 0, 0.12);
}

.deliveryplz-address-suggestions {
    border: 1px solid var(--rf-deliveryplz-border);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(55, 43, 39, 0.14);
}

.deliveryplz-address-suggestion {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(222, 216, 213, 0.7);
    background: #fff;
    padding: 0.75rem 0.9rem;
    text-align: left;
    color: var(--rf-deliveryplz-text);
    font-weight: 650;
}

.deliveryplz-address-suggestion:last-child {
    border-bottom: 0;
}

.deliveryplz-address-suggestion:hover,
.deliveryplz-address-suggestion:focus {
    background: var(--rf-deliveryplz-brand-soft);
    outline: none;
}

.rf-checkout .checkout-address-suggestions {
    --rf-deliveryplz-brand-soft: rgba(255, 73, 0, 0.08);
    --rf-deliveryplz-border: #ded8d5;
    --rf-deliveryplz-text: #372b27;
    margin-top: 0.45rem;
    position: relative;
    z-index: 20;
}

.deliveryplz-submit,
.deliveryplz-location-btn {
    border-radius: 16px;
    padding: 1rem 1.05rem;
    font-weight: 700;
    min-height: 56px;
}

.deliveryplz-submit {
    border: 1px solid var(--rf-deliveryplz-brand);
    background: var(--rf-deliveryplz-brand);
    color: #fff;
    box-shadow: 0 10px 22px rgba(255, 73, 0, 0.25);
}

.deliveryplz-location-btn {
    border: 1px solid var(--rf-deliveryplz-border);
    background: #edf8ff;
    color: #0878bf;
    border-color: #edf8ff;
}

.deliveryplz-location-btn i {
    color: var(--rf-deliveryplz-brand);
    margin-right: 0.35rem;
}

.deliveryplz-planned {
    border: 1px solid var(--rf-deliveryplz-border);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 73, 0, 0.05);
    margin-top: 1rem;
    display: none;
}

.deliveryplz-planned .form-select {
    border-radius: 12px;
    border-color: var(--rf-deliveryplz-border);
}

.deliveryplz-note {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: var(--rf-deliveryplz-muted);
}

[data-deliveryplz-timepicker].deliveryplz-timepicker-locked .btn-timepicker {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}

[data-deliveryplz-timepicker].deliveryplz-timepicker-locked::after {
    content: none !important;
    display: none !important;
}

@media (min-width: 576px) {
    #deliveryplz-modal .modal-dialog {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100% - 3rem);
        margin: 0 auto;
    }

    #deliveryplz-modal .modal-content {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    #deliveryplz-modal {
        --bs-modal-margin: 1.5rem;
    }

    #deliveryplz-modal .modal-dialog {
        /* Hard-center on mobile (robust against Bootstrap/custom overrides) */
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;

        width: calc(100% - 2.5rem) !important;
        max-width: 420px !important;
        margin: 0 !important;

        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        pointer-events: auto;
    }

    #deliveryplz-modal .modal-dialog.modal-dialog-centered {
        /* Keep centered behavior (we position the dialog itself) */
        min-height: auto !important;
    }

    #deliveryplz-modal .modal-content {
        border-radius: 22px;
        min-height: auto;
        padding: 1.4rem 1.2rem 1.45rem;
    }

    .deliveryplz-toggle button,
    .deliveryplz-time-toggle button {
        min-width: 110px;
    }

    .deliveryplz-time-toggle button[data-time-choice="asap"] {
        min-width: 140px;
    }
}
