/* ════════════════════════════════════════════════════════════════════════
   TransLog — Maps   (round 64)
   ────────────────────────────────────────────────────────────────────────
   Styles for tracking maps + business location maps using Leaflet.
   Site palette: --gold #E8A317  --navy #0B1D3A  --cream #f5efe6
   ════════════════════════════════════════════════════════════════════════ */

/* ── Map container (shared) ─────────────────────────────────────── */
.tlmap-tracking,
.tlmap-business {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
    background: #f1f5f9;
    position: relative;
    z-index: 0;          /* keep below sticky header */
}
.tlmap-tracking { min-height: 360px; }
.tlmap-business { min-height: 380px; }

/* Loading state */
.tlmap-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    gap: 14px;
    z-index: 1;
}
.tlmap-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #E8A317;
    border-radius: 50%;
    animation: tlmap-spin 0.8s linear infinite;
}
@keyframes tlmap-spin {
    to { transform: rotate(360deg); }
}
.tlmap-loading-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Error state */
.tlmap-error {
    padding: 30px 24px;
    text-align: center;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 14px;
    font-size: 0.92rem;
}

/* Custom pins — kill the default Leaflet shadow on divIcons */
.tlmap-pin {
    background: none !important;
    border: none !important;
    filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.25));
}
.tlmap-pin svg {
    display: block;
}

/* Logo pin (used on business maps when admin enables "show logo on pin") */
.tlmap-logo-pin {
    position: relative;
    width: 56px;
    height: 68px;
    pointer-events: auto;
}
.tlmap-logo-pin-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #E8A317;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
    position: relative;
    z-index: 2;
}
.tlmap-logo-pin-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    box-sizing: border-box;
}
.tlmap-logo-pin-stem {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 14px solid #E8A317;
    z-index: 1;
}

/* ── Popup card (Leaflet popup contents) ───────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18) !important;
}
.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
}
.tlmap-popup-card {
    min-width: 220px;
}
.tlmap-popup-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0B1D3A;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.tlmap-popup-row {
    margin: 4px 0;
    color: #334155;
}
.tlmap-popup-row a {
    color: #0B1D3A;
    text-decoration: none;
}
.tlmap-popup-row a:hover {
    color: #E8A317;
    text-decoration: underline;
}
.tlmap-popup-directions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.tlmap-popup-directions a {
    color: #E8A317;
    font-weight: 600;
}

/* ── Tracking map specific — header strip above the map ─────── */
.tlmap-tracking-wrap {
    margin: 32px 0;
}
.tlmap-tracking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #0B1D3A;
}
.tlmap-tracking-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.tlmap-tracking-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #475569;
}
.tlmap-tracking-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tlmap-tracking-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tlmap-tracking-legend-dot.is-sender   { background: #E8A317; }
.tlmap-tracking-legend-dot.is-receiver { background: #0B1D3A; border: 2px solid #E8A317; }
.tlmap-tracking-legend-dot.is-event    { background: #fff; border: 2px solid #E8A317; }
.tlmap-tracking-legend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px dashed #E8A317;
}

/* ── Business map module wrapper — styling for the section ─── */
.module-business-map {
    padding: 60px 0;
}
.module-business-map-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 32px;
    padding: 0 20px;
}
.module-business-map-eyebrow {
    color: #E8A317;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-style: italic;
}
.module-business-map-heading {
    color: #0B1D3A;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.2;
}
.module-business-map-subtitle {
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}
.module-business-map-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Mobile polish ───────────────────────────────────────────── */
@media (max-width: 720px) {
    .tlmap-tracking { min-height: 280px; }
    .tlmap-business { min-height: 320px; }
    .tlmap-tracking-wrap { margin: 24px 0; }
    .tlmap-tracking-legend { font-size: 0.78rem; gap: 12px; }
    .module-business-map { padding: 40px 0; }
    .module-business-map-heading { font-size: 1.5rem; }
}
