/* =========================================================
   Location picker — map modal & field summary
   ========================================================= */

.wz-location {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wz-location-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--wz-radius-sm);
    border: 1.5px dashed var(--wz-border);
    background: #f8f9fd;
    transition: border-color 0.2s, background 0.2s;
}

.wz-location-card.is-set {
    border-style: solid;
    border-color: rgba(59, 91, 253, 0.35);
    background: var(--wz-primary-soft);
}

.wz-location-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--wz-primary);
    box-shadow: 0 2px 8px rgba(59, 91, 253, 0.12);
}

.wz-location-card.is-set .wz-location-icon {
    color: var(--wz-success);
}

.wz-location-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--wz-text-soft);
    margin-bottom: 4px;
}

.wz-location-card.is-set .wz-location-status {
    color: var(--wz-success);
}

.wz-location-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--wz-text);
    word-break: break-word;
}

.wz-location-coords {
    margin-top: 6px;
    font-size: 12px;
    color: var(--wz-text-soft);
    direction: ltr;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wz-location-open {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---- Full-screen modal ---- */
body.wz-loc-open {
    overflow: hidden;
}

.wz-loc-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.wz-loc-modal[hidden] {
    display: none !important;
}

.wz-loc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
}

.wz-loc-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    background: var(--wz-surface);
    animation: wzLocIn 0.26s ease;
    overflow: hidden;
}

@keyframes wzLocIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .wz-loc-modal {
        padding: 20px;
        align-items: center;
    }

    .wz-loc-sheet {
        width: min(760px, 100%);
        height: min(90vh, 860px);
        max-height: 90vh;
        border-radius: var(--wz-radius);
        box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    }
}

/* ---- Header (compact) ---- */
.wz-loc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--wz-surface);
    flex-shrink: 0;
    border-bottom: 1px solid var(--wz-border);
}

.wz-loc-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.wz-loc-header-spacer {
    width: 40px;
    flex-shrink: 0;
}

.wz-loc-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #f0f3fa;
    color: var(--wz-text);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.wz-loc-icon-btn:active {
    transform: scale(0.96);
}

/* ---- Map stage (fills all space between header & bottom) ---- */
.wz-loc-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #dce3ef;
}

.wz-loc-map-wrap {
    position: absolute;
    inset: 0;
}

.wz-loc-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.wz-loc-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 6px 0 0 0;
    margin: 0;
    padding: 2px 6px;
}

.wz-loc-map .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
    border-radius: 10px !important;
    overflow: hidden;
    margin-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    margin-left: 12px !important;
}

.wz-loc-map .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}

/* Center pin */
.wz-loc-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-100% + 6px));
    z-index: 450;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
    transition: transform 0.15s ease;
}

.wz-loc-map-wrap.is-moving .wz-loc-pin {
    transform: translate(-50%, calc(-100% + 2px)) scale(1.06);
}

/* ---- Floating search (above map tiles) ---- */
.wz-loc-search-float {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 500;
    pointer-events: none;
}

.wz-loc-search-float > * {
    pointer-events: auto;
}

.wz-loc-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 0 14px;
    box-shadow: 0 8px 28px rgba(28, 35, 51, 0.16);
    transition: box-shadow 0.2s;
}

.wz-loc-search-box:focus-within {
    box-shadow: 0 10px 32px rgba(59, 91, 253, 0.22);
}

.wz-loc-search-ico {
    color: var(--wz-text-soft);
    flex-shrink: 0;
}

.wz-loc-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font: inherit;
    font-size: 15px;
    outline: none;
    min-width: 0;
}

.wz-loc-search-input::-webkit-search-cancel-button {
    display: none;
}

.wz-loc-search-clear {
    border: none;
    background: #e8ecf4;
    color: var(--wz-text-soft);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.wz-loc-results {
    margin: 8px 0 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(28, 35, 51, 0.18);
    max-height: min(38vh, 260px);
    overflow-y: auto;
}

.wz-loc-result {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wz-loc-result:hover,
.wz-loc-result:focus {
    background: var(--wz-primary-soft);
    outline: none;
}

.wz-loc-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wz-text);
}

.wz-loc-result-sub {
    font-size: 12px;
    color: var(--wz-text-soft);
    line-height: 1.4;
}

.wz-loc-result--empty {
    cursor: default;
    color: var(--wz-text-soft);
    text-align: center;
    padding: 16px;
}

.wz-loc-result--empty:hover {
    background: transparent;
}

/* ---- Bottom panel (address + actions) ---- */
.wz-loc-bottom {
    flex-shrink: 0;
    background: var(--wz-surface);
    border-top: 1px solid var(--wz-border);
    padding: 12px 14px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(28, 35, 51, 0.06);
}

.wz-loc-address-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--wz-text-soft);
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.wz-loc-address-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--wz-text);
    min-height: 1.4em;
    word-break: break-word;
}

.wz-loc-address-text.is-loading {
    color: var(--wz-text-soft);
}

.wz-loc-coords {
    margin-top: 4px;
    font-size: 11px;
    color: var(--wz-text-soft);
    direction: ltr;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wz-loc-footer {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.wz-loc-gps {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.wz-loc-confirm {
    flex: 1;
}

@media (max-width: 420px) {
    .wz-loc-gps {
        font-size: 13px;
        padding-left: 12px;
        padding-right: 12px;
    }
}
