/* Map picker and read-only map, including the narrow-screen height.
   Booking and the technician profile both use these classes. */

/* --------------------------------------------------------------------------
   Map picker (booking + technician profile)
   -------------------------------------------------------------------------- */

.tk-map {
    margin-top: 12px;
    margin-bottom: 8px;
}
.tk-map__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.tk-map__search {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.tk-map__search .tk-input {
    flex: 1;
    min-width: 0;
}
.tk-map__results {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    overflow: hidden;
}
.tk-map__results li + li {
    border-top: 1px solid var(--line);
}
.tk-map__result {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.tk-map__result:hover,
.tk-map__result:focus-visible {
    background: var(--bg-input);
}
.tk-map__status {
    color: var(--silver-dim);
    font-size: .88rem;
    font-weight: 600;
}
.tk-address-choices {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}
.tk-address-choices legend {
    font-weight: 800;
    padding: 0 6px;
}
.tk-address-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.tk-address-choice:has(input:checked) {
    border-color: var(--cyan);
}
.tk-address-choice span {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
    min-width: 0;
}
.tk-map__canvas {
    width: 100%;
    height: 240px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(0, 180, 230, .08), transparent 55%),
        var(--bg-input);
    overflow: hidden;
}
.tk-map__canvas--empty {
    display: grid;
    place-items: center;
    color: var(--silver-faint);
    font-size: .9rem;
}
.tk-map__canvas--empty::after {
    content: attr(data-empty-label);
}
.tk-map__canvas--osm {
    position: relative;
    cursor: grab;
    touch-action: none;
    background: #cfd8dc;
}
.tk-map__canvas--osm:active {
    cursor: grabbing;
}
.tk-map__tiles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.tk-map__tiles img {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.tk-map__pin {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cyan);
    cursor: grab;
    transform: translate(-50%, -100%);
    touch-action: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}
.tk-map__pin:active {
    cursor: grabbing;
}
.tk-map__zoom {
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.tk-map__zoom-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.tk-map__zoom-btn + .tk-map__zoom-btn {
    border-top: 1px solid var(--line);
}
.tk-map__zoom-btn:hover,
.tk-map__zoom-btn:focus-visible {
    background: var(--bg-input);
}
.tk-map__attrib {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    padding: 2px 6px;
    background: rgba(255, 255, 255, .82);
    color: #222;
    font-size: 10px;
    line-height: 1.3;
    text-decoration: none;
}
.tk-map__attrib:hover {
    text-decoration: underline;
}
.tk-map-view {
    display: block;
    margin-top: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    overflow: hidden;
}
.tk-map-view iframe,
.tk-map-view img {
    display: block;
    width: 100%;
    height: 200px;
    border: 0;
}
.tk-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .tk-map__canvas { height: 220px; }
    .tk-map__toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tk-map__toolbar .tk-btn { width: auto; min-height: 44px; flex: 1 1 auto; }
    .tk-map__status { width: 100%; }
    .tk-map-view { min-height: 200px; }
}
