/* ═══════════════════════════════════════════════════════ */
/*  MDT Location Popup — matches MERN LocationPicker.jsx  */
/* ═══════════════════════════════════════════════════════ */

/* Overlay */
.mdt-loc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mdt-loc-overlay.mdt-loc--visible {
    opacity: 1;
}

/* Popup card */
.mdt-loc-popup {
    background: #fff;
    border-radius: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.mdt-loc-overlay.mdt-loc--visible .mdt-loc-popup {
    transform: scale(1);
    opacity: 1;
}

/* ── Top Bar ── */
.mdt-loc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 8px;
}

.mdt-loc-topbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.mdt-loc-back-btn {
    color: #64748b;
}

.mdt-loc-back-btn:hover {
    background: #f3f4f6;
    color: #15161D;
}

.mdt-loc-close-btn {
    color: #94a3b8;
}

.mdt-loc-close-btn:hover {
    background: #fef2f2;
    color: #D11243;
}

.mdt-loc-topbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mdt-loc-topbar-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D11243;
}

.mdt-loc-topbar-title span {
    font-size: 14px;
    font-weight: 700;
    color: #15161D;
    letter-spacing: -0.02em;
}

/* ── Content Area ── */
.mdt-loc-content {
    padding: 12px 24px 24px;
    min-height: 320px;
    position: relative;
}

/* ── Steps (show/hide) ── */
.mdt-loc-step {
    display: none;
    flex-direction: column;
    animation: mdtFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mdt-loc-step--active {
    display: flex;
}

@keyframes mdtFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── STEP: CHOOSE ── */
.mdt-loc-choose-header {
    text-align: center;
    margin-bottom: 8px;
}

.mdt-loc-choose-header h2 {
    font-size: 20px;
    font-weight: 900;
    color: #15161D;
    letter-spacing: -0.03em;
    margin: 0 0 4px;
}

.mdt-loc-choose-header p {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0;
}

/* Option cards */
.mdt-loc-option-card {
    width: 100%;
    padding: 24px;
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    background: rgba(249, 250, 251, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    transition: all 0.2s;
    margin-top: 16px;
}

.mdt-loc-option-card:hover {
    border-color: rgba(209, 18, 67, 0.3);
    background: rgba(254, 242, 242, 0.3);
}

.mdt-loc-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mdt-loc-option-card:hover .mdt-loc-option-icon {
    color: #D11243;
    border-color: #fecdd3;
    background: #fef2f2;
}

.mdt-loc-option-text {
    flex: 1;
    min-width: 0;
}

.mdt-loc-option-title {
    font-weight: 700;
    font-size: 16px;
    color: #15161D;
    margin: 0;
    transition: color 0.2s;
}

.mdt-loc-option-card:hover .mdt-loc-option-title {
    color: #D11243;
}

.mdt-loc-option-sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin: 2px 0 0;
}

.mdt-loc-option-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mdt-loc-option-card:hover .mdt-loc-option-arrow {
    color: #D11243;
    transform: translateX(4px);
}

/* Footer */
.mdt-loc-choose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    margin-top: 16px;
}

.mdt-loc-skip-btn {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.mdt-loc-skip-btn:hover {
    color: #15161D;
}

/* ── STEP: ENTER (Search) ── */
.mdt-loc-step-header {
    margin-bottom: 16px;
}

.mdt-loc-step-header h2 {
    font-size: 18px;
    font-weight: 900;
    color: #15161D;
    letter-spacing: -0.02em;
    margin: 0 0 2px;
}

.mdt-loc-step-header p {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0;
}

/* Search input */
.mdt-loc-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.mdt-loc-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.mdt-loc-search-wrap input {
    width: 100%;
    background: #f9fafb;
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    padding: 16px 40px 16px 44px;
    font-size: 14px;
    font-weight: 500;
    color: #15161D;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.mdt-loc-search-wrap input::placeholder {
    color: #cbd5e1;
}

.mdt-loc-search-wrap input:focus {
    border-color: rgba(209, 18, 67, 0.4);
    box-shadow: 0 0 0 3px rgba(209, 18, 67, 0.08);
    background: #fff;
}

.mdt-loc-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0;
    display: flex;
}

.mdt-loc-search-clear:hover {
    color: #64748b;
}

/* Search loading */
.mdt-loc-search-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 12px;
    font-size: 12px;
    color: #94a3b8;
}

/* Suggestions */
.mdt-loc-suggestions {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    background: #fff;
    margin-bottom: 16px;
}

.mdt-loc-suggestion-item {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.15s;
    border-bottom: 1px solid #fafafa;
}

.mdt-loc-suggestion-item:last-child {
    border-bottom: none;
}

.mdt-loc-suggestion-item:hover {
    background: rgba(254, 242, 242, 0.5);
}

.mdt-loc-suggestion-item svg {
    color: #D11243;
    margin-top: 2px;
    flex-shrink: 0;
}

.mdt-loc-suggestion-item span {
    font-size: 12px;
    font-weight: 500;
    color: #15161D;
    line-height: 1.4;
}

/* Selected preview (green card) */
.mdt-loc-selected-preview {
    padding: 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    margin-bottom: 16px;
    animation: mdtFadeIn 0.3s ease;
}

.mdt-loc-selected-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #059669;
    margin: 0 0 4px;
}

.mdt-loc-selected-text {
    font-size: 12px;
    font-weight: 600;
    color: #15161D;
    line-height: 1.5;
    margin: 0;
}

/* Error block */
.mdt-loc-error-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.mdt-loc-error-msg {
    padding: 12px 16px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    border-radius: 16px;
    text-align: center;
}

.mdt-loc-retry-btn {
    width: 100%;
    padding: 10px;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.mdt-loc-retry-btn:hover {
    background: #e5e7eb;
}

/* Spacer */
.mdt-loc-spacer {
    flex: 1;
}

/* Confirm button */
.mdt-loc-confirm-btn {
    width: 100%;
    padding: 20px;
    background: #D11243;
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 14px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(209, 18, 67, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    margin-top: 16px;
}

.mdt-loc-confirm-btn:hover:not(:disabled) {
    background: #b00f38;
}

.mdt-loc-confirm-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.mdt-loc-confirm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── STEP: DETECT (GPS) ── */
.mdt-loc-detect-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.mdt-loc-detect-before {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mdt-loc-detect-icon-wrap {
    width: 96px;
    height: 96px;
    border-radius: 2rem;
    background: linear-gradient(135deg, #fef2f2, #fecdd3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: #D11243;
    box-shadow: 0 2px 8px rgba(209, 18, 67, 0.08);
}

.mdt-loc-detect-btn {
    padding: 20px 40px;
    background: linear-gradient(135deg, #D11243, #e8366b);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(209, 18, 67, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.mdt-loc-detect-btn:hover {
    box-shadow: 0 12px 30px rgba(209, 18, 67, 0.3);
}

.mdt-loc-detect-btn:active {
    transform: scale(0.96);
}

.mdt-loc-detect-btn:disabled {
    opacity: 0.6;
}

.mdt-loc-detect-hint {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 16px;
    text-align: center;
    max-width: 240px;
}

/* After detection */
.mdt-loc-detect-after {
    width: 100%;
    animation: mdtFadeIn 0.3s ease;
}

.mdt-loc-detected-card {
    padding: 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    margin-bottom: 16px;
}

.mdt-loc-detected-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mdt-loc-detected-badge-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
}

.mdt-loc-detected-badge span {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #059669;
}

.mdt-loc-detected-text {
    font-size: 14px;
    font-weight: 600;
    color: #15161D;
    line-height: 1.5;
    margin: 0;
}

.mdt-loc-redetect-btn {
    width: 100%;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #D11243;
    background: #fef2f2;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    margin-bottom: 16px;
}

.mdt-loc-redetect-btn:hover {
    background: #fecdd3;
}

/* ── Spinner ── */
@keyframes mdtSpin {
    to {
        transform: rotate(360deg);
    }
}

.mdt-spin {
    animation: mdtSpin 0.8s linear infinite;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .mdt-loc-popup {
        border-radius: 1.5rem;
        margin: 8px;
    }

    .mdt-loc-topbar {
        padding: 16px 16px 8px;
    }

    .mdt-loc-content {
        padding: 8px 16px 20px;
    }

    .mdt-loc-option-card {
        padding: 16px;
        gap: 12px;
    }

    .mdt-loc-option-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .mdt-loc-option-icon svg {
        width: 20px;
        height: 20px;
    }

    .mdt-loc-detect-icon-wrap {
        width: 72px;
        height: 72px;
    }

    .mdt-loc-detect-icon-wrap svg {
        width: 32px;
        height: 32px;
    }

    .mdt-loc-detect-btn {
        padding: 16px 28px;
    }
}