#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;
}

#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;
    }
}
