/* ── TheImlers Map Locator – Public Styles ── */

.tml-map-wrap {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
    background: #f1f5f9;
}

.tml-map-canvas {
    width: 100%;
    height: 100%;
}

/* Loading overlay */
.tml-map-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    font-family: system-ui, sans-serif;
    transition: opacity .3s;
    z-index: 10;
}
.tml-map-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Spinner */
.tml-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: tml-spin .7s linear infinite;
}
@keyframes tml-spin { to { transform: rotate(360deg); } }

/* Error */
.tml-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
}

/* Info window overrides */
.tml-info-window {
    font-family: system-ui, -apple-system, sans-serif;
    min-width: 180px;
    max-width: 260px;
}
.tml-info-window h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}
.tml-info-window p {
    margin: 0 0 5px;
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
}
.tml-iw-description {
    font-size: 12px !important;
    color: #64748b !important;
    font-style: italic;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 7px !important;
}
.tml-iw-address,
.tml-iw-phone {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.tml-iw-icon {
    flex-shrink: 0;
    font-size: 11px;
    margin-top: 1px;
}
.tml-iw-phone a {
    color: #2563EB;
    text-decoration: none;
}
.tml-iw-phone a:hover {
    text-decoration: underline;
}
.tml-info-window .tml-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 5px 10px;
    background: #2563EB;
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    transition: background .15s;
}
.tml-info-window .tml-directions-link:hover {
    background: #1d4ed8;
    text-decoration: none;
}

/* ── Legend ── */
.tml-embed-wrap {
    font-family: system-ui, -apple-system, sans-serif;
}

.tml-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.tml-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, transform .15s, background .18s;
    user-select: none;
    outline: none;
    position: relative;
}
.tml-legend-item:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}
.tml-legend-item.hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,.07);
}
.tml-legend-item.active {
    border-color: #2563EB;
    background: #eff6ff;
    box-shadow: 0 4px 16px rgba(37,99,235,.15);
    transform: translateY(-2px);
}
.tml-legend-item.active .tml-legend-arrow {
    color: #2563EB;
    transform: translateX(3px);
}

/* Colored pin badge */
.tml-legend-pin {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    transition: box-shadow .18s, transform .15s;
}
.tml-legend-item.hover .tml-legend-pin,
.tml-legend-item.active .tml-legend-pin {
    box-shadow: 0 4px 12px rgba(0,0,0,.28);
}
.tml-legend-pin svg {
    transform: rotate(45deg); /* un-rotate the icon inside */
    flex-shrink: 0;
}

/* Text block */
.tml-legend-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tml-legend-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.tml-legend-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Chevron */
.tml-legend-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: #cbd5e1;
    transition: color .18s, transform .18s;
    line-height: 1;
}

/* Single-column compact view on narrow screens */
@media (max-width: 480px) {
    .tml-legend {
        grid-template-columns: 1fr;
    }
}
