/* Payment Details — modern checkout modal */

#paymentModal.payment-modal {
    max-width: min(720px, calc(100vw - 24px));
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow:
        0 0 0 1px rgba(56, 161, 105, 0.12),
        0 32px 64px rgba(0, 0, 0, 0.55);
}

#paymentModal .payment-modal__header {
    position: relative;
    padding: 22px 24px 20px;
    background: linear-gradient(135deg, #0f766e 0%, #059669 42%, #10b981 100%);
    border-bottom: none;
}

#paymentModal .payment-modal__header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 45%);
    pointer-events: none;
}

#paymentModal .payment-modal__header h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

#paymentModal .payment-modal__header h2 i {
    font-size: 1.15rem;
    opacity: 0.95;
}

#paymentModal .close-about-modal {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
}

#paymentModal .close-about-modal:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg);
}

#paymentModal .payment-modal__steps {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

#paymentModal .payment-step-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

#paymentModal .payment-step-pill i {
    font-size: 0.8rem;
}

#paymentModal .payment-step-pill.is-active {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(52, 211, 153, 0.35);
}

#paymentModal .payment-step-pill.is-done {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
}

#paymentModal .payment-modal__body {
    padding: 20px 22px 24px !important;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    max-height: min(72vh, 640px);
    overflow-y: auto;
}

#paymentModal .payment-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
}

#paymentModal .payment-section-title i {
    color: #34d399;
    font-size: 1rem;
}

/* Delivery step */
#paymentModal .payment-delivery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

#paymentModal .payment-delivery-grid--compact {
    grid-template-columns: 1fr;
}

#paymentModal .payment-map-wrap--full {
    grid-column: 1 / -1;
}

#paymentModal .payment-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

#paymentModal .payment-field label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

#paymentModal .payment-field input,
#paymentModal .payment-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#paymentModal .payment-field input:focus,
#paymentModal .payment-field textarea:focus {
    outline: none;
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

#paymentModal .payment-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

#paymentModal .payment-field--full {
    grid-column: 1 / -1;
}

#paymentModal .payment-mini-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    grid-column: 1 / -1;
}

/* Map */
#paymentModal .payment-map-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

#paymentModal .delivery-map {
    width: 100%;
    height: 240px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    z-index: 1;
}

#paymentModal .payment-map-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#paymentModal .payment-map-locate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

#paymentModal .payment-map-locate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

#paymentModal .payment-map-locate:disabled {
    opacity: 0.65;
    cursor: wait;
}

#paymentModal .payment-map-hint {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}

#paymentModal .payment-map-hint.is-set {
    color: #6ee7b7;
    font-weight: 600;
}

#paymentModal .payment-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #60a5fa;
    text-decoration: none;
    word-break: break-all;
}

#paymentModal .payment-map-link:hover {
    text-decoration: underline;
}

/* Leaflet tweaks inside modal */
#paymentModal .leaflet-container {
    font-family: inherit;
    background: #0f172a;
}

#paymentModal .leaflet-control-zoom a {
    background: rgba(30, 41, 59, 0.95) !important;
    color: #e2e8f0 !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

#paymentModal .leaflet-control-attribution {
    font-size: 0.65rem;
    background: rgba(15, 23, 42, 0.75) !important;
    color: #94a3b8 !important;
}

#paymentModal .payment-map-pin {
    background: transparent;
    border: none;
}

#paymentModal .payment-map-pin__dot {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #ef4444;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    margin-left: -2px;
}

/* Buttons */
#paymentModal .pay-now-btn {
    width: 100%;
    margin-top: 18px;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.3);
}

#paymentModal .pay-now-btn:hover {
    box-shadow: 0 14px 32px rgba(16, 185, 129, 0.42);
}

/* FIB payment */
.fib-payment-panel {
    text-align: center;
    padding: 8px 4px 4px;
}

.fib-payment-intro {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: var(--gray, #94a3b8);
    line-height: 1.45;
}

.fib-payment-loading {
    padding: 28px 12px;
    color: #10b981;
    font-weight: 600;
}

.fib-payment-loading i {
    margin-right: 8px;
}

.fib-amount-line {
    margin: 0 0 10px;
    font-size: 1rem;
}

.fib-readable-line {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--gray, #94a3b8);
}

.fib-qr-wrap {
    display: inline-block;
    padding: 14px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
}

.fib-qr-image {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.fib-valid-until {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--gray, #94a3b8);
}

.fib-open-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 14px;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    color: #fff !important;
    background: linear-gradient(135deg, #0f766e 0%, #059669 100%);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fib-open-app-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(16, 185, 129, 0.45);
    color: #fff !important;
}

.fib-app-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 auto 16px;
    max-width: 320px;
}

.fib-payment-body--touch .fib-app-buttons {
    margin-bottom: 18px;
}

.fib-payment-body--touch .fib-open-app-btn {
    min-height: 52px;
    font-size: 1.05rem;
}

.fib-open-app-btn--secondary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.35);
}

.fib-status-msg {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.fib-payment-error {
    margin: 12px 0 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
}

.fib-payment-error code {
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
}

.fib-payment-error a {
    color: #6ee7b7;
    font-weight: 600;
}

@media (max-width: 640px) {
    #paymentModal.payment-modal {
        max-width: calc(100vw - 16px);
        border-radius: 18px;
    }

    #paymentModal .payment-delivery-grid {
        grid-template-columns: 1fr;
    }

    #paymentModal .payment-mini-row {
        grid-template-columns: 1fr;
    }

    #paymentModal .delivery-map {
        height: 220px;
    }

    #paymentModal .payment-step-pill span.pill-text {
        display: none;
    }

    #paymentModal .payment-modal__steps {
        padding: 10px 12px;
    }
}

/* Order result modal (after FIB / cash / card checkout) */
.order-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    z-index: 1250;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
}

.order-result-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.order-result-modal {
    z-index: 1260;
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    border: none;
}

.order-result-modal__header {
    position: relative;
    padding: 28px 20px 24px;
    text-align: center;
    color: #fff;
    border-radius: 20px 20px 0 0;
}

.order-result-modal--success .order-result-modal__header {
    background: linear-gradient(135deg, #047857 0%, #10b981 55%, #34d399 100%);
}

.order-result-modal--error .order-result-modal__header {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 55%, #f87171 100%);
}

.order-result-modal--warning .order-result-modal__header {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 55%, #fbbf24 100%);
}

.order-result-modal__icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.order-result-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.order-result-modal__close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.order-result-modal__body {
    padding: 22px 24px 26px;
    text-align: center;
}

.order-result-modal__title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.dark-theme .order-result-modal__title {
    color: #f1f5f9;
}

.order-result-modal__message {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #475569;
}

.dark-theme .order-result-modal__message {
    color: #94a3b8;
}

.order-result-modal__order-no {
    margin: 0 0 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-weight: 600;
    font-size: 0.92rem;
}

.order-result-modal--error .order-result-modal__order-no {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.order-result-modal__btn {
    width: 100%;
    margin-top: 4px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.order-result-modal--success .order-result-modal__btn {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}

.order-result-modal--error .order-result-modal__btn {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
}

.order-result-modal--warning .order-result-modal__btn {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}
