/* ==========================================================================
   FRED CAR MAP — CORE STYLES
   ========================================================================== */

/* --- Base positioning for map elements --- */
.fredcarmap-pane,
.fredcarmap-tile,
.fredcarmap-marker-icon,
.fredcarmap-marker-shadow,
.fredcarmap-tile-container,
.fredcarmap-pane > svg,
.fredcarmap-pane > canvas,
.fredcarmap-zoom-box,
.fredcarmap-image-layer,
.fredcarmap-layer {
    position: absolute;
    top: 0;
    left: 0;
}

.fredcarmap-container {
    overflow: hidden;
    background: #ddd;
    outline-offset: 1px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.75rem;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* --- Tile & marker behavior --- */
.fredcarmap-tile,
.fredcarmap-marker-icon,
.fredcarmap-marker-shadow {
    user-select: none;
    -webkit-user-drag: none;
}

.fredcarmap-tile::selection {
    background: transparent;
}

.fredcarmap-safari .fredcarmap-tile {
    image-rendering: -webkit-optimize-contrast;
}

.fredcarmap-safari .fredcarmap-tile-container {
    width: 1600px;
    height: 1600px;
    -webkit-transform-origin: 0 0;
}

.fredcarmap-marker-icon,
.fredcarmap-marker-shadow {
    display: block;
}

/* --- Image constraints --- */
.fredcarmap-container .fredcarmap-overlay-pane svg,
.fredcarmap-container .fredcarmap-marker-pane img,
.fredcarmap-container .fredcarmap-shadow-pane img,
.fredcarmap-container .fredcarmap-tile-pane img,
.fredcarmap-container img.fredcarmap-image-layer,
.fredcarmap-container .fredcarmap-tile {
    max-width: none !important;
    max-height: none !important;
    width: auto;
    padding: 0;
}

.fredcarmap-container img.fredcarmap-tile {
    mix-blend-mode: plus-lighter;
}

/* --- Touch interactions --- */
.fredcarmap-container.fredcarmap-touch-zoom {
    -ms-touch-action: pan-x pan-y;
    touch-action: pan-x pan-y;
}

.fredcarmap-container.fredcarmap-touch-drag {
    -ms-touch-action: pinch-zoom;
    touch-action: none;
}

.fredcarmap-container.fredcarmap-touch-drag.fredcarmap-touch-zoom {
    -ms-touch-action: none;
    touch-action: none;
}

/* --- Tile visibility --- */
.fredcarmap-tile {
    filter: inherit;
    visibility: hidden;
}

.fredcarmap-tile-loaded {
    visibility: inherit;
}

/* --- Zoom box --- */
.fredcarmap-zoom-box {
    width: 0;
    height: 0;
    box-sizing: border-box;
    z-index: 800;
}

/* --- Z-index layers --- */
.fredcarmap-pane         { z-index: 400; }
.fredcarmap-tile-pane    { z-index: 200; }
.fredcarmap-overlay-pane { z-index: 400; }
.fredcarmap-shadow-pane  { z-index: 500; }
.fredcarmap-marker-pane  { z-index: 600; }
.fredcarmap-tooltip-pane { z-index: 650; }
.fredcarmap-popup-pane   { z-index: 700; }

.fredcarmap-map-pane canvas { z-index: 100; }
.fredcarmap-map-pane svg    { z-index: 200; }

/* ==========================================================================
   CONTROLS
   ========================================================================== */

.fredcarmap-control {
    position: relative;
    z-index: 800;
    pointer-events: auto;
    float: left;
    clear: both;
}

.fredcarmap-top,
.fredcarmap-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.fredcarmap-top    { top: 0; }
.fredcarmap-bottom { bottom: 0; }
.fredcarmap-left   { left: 0; }
.fredcarmap-right  { right: 0; }

.fredcarmap-top .fredcarmap-control    { margin-top: 10px; }
.fredcarmap-bottom .fredcarmap-control { margin-bottom: 10px; }
.fredcarmap-left .fredcarmap-control   { margin-left: 10px; }
.fredcarmap-right .fredcarmap-control  { margin-right: 10px; float: right; }

/* --- Toolbar --- */
.fredcarmap-bar {
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    border-radius: 4px;
}

.fredcarmap-bar a {
    display: block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    text-decoration: none;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    color: black;
}

.fredcarmap-bar a:hover {
    background-color: #f4f4f4;
}

/* --- Zoom control --- */
.fredcarmap-control-zoom-in,
.fredcarmap-control-zoom-out {
    font: bold 18px 'Lucida Console', Monaco, monospace;
}

/* --- Layers control --- */
.fredcarmap-control-layers {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.fredcarmap-fade-anim .fredcarmap-popup {
    opacity: 0;
    transition: opacity 0.2s linear;
}

.fredcarmap-fade-anim .fredcarmap-map-pane .fredcarmap-popup {
    opacity: 1;
}

.fredcarmap-zoom-animated {
    transform-origin: 0 0;
}

svg.fredcarmap-zoom-animated {
    will-change: transform;
}

.fredcarmap-zoom-anim .fredcarmap-zoom-animated {
    transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}

.fredcarmap-zoom-anim .fredcarmap-tile,
.fredcarmap-pan-anim .fredcarmap-tile {
    transition: none;
}

.fredcarmap-zoom-anim .fredcarmap-zoom-hide {
    visibility: hidden;
}

/* ==========================================================================
   CURSORS & INTERACTIVITY
   ========================================================================== */

.fredcarmap-interactive { cursor: pointer; }
.fredcarmap-grab        { cursor: grab; }
.fredcarmap-crosshair   { cursor: crosshair; }

.fredcarmap-dragging .fredcarmap-grab,
.fredcarmap-dragging .fredcarmap-marker-draggable {
    cursor: grabbing;
}

/* Disable pointer events by default */
.fredcarmap-marker-icon,
.fredcarmap-marker-shadow,
.fredcarmap-image-layer,
.fredcarmap-pane > svg path,
.fredcarmap-tile-container {
    pointer-events: none;
}

/* Enable when interactive */
.fredcarmap-marker-icon.fredcarmap-interactive,
.fredcarmap-image-layer.fredcarmap-interactive,
.fredcarmap-pane > svg path.fredcarmap-interactive {
    pointer-events: auto;
}

/* ==========================================================================
   POPUPS & TOOLTIPS
   ========================================================================== */

.fredcarmap-popup {
    position: absolute;
    text-align: center;
    margin-bottom: 20px;
}

.fredcarmap-popup-content-wrapper {
    padding: 1px;
    text-align: left;
    border-radius: 12px;
}

.fredcarmap-popup-content {
    margin: 13px 24px 13px 20px;
    line-height: 1.3;
    font-size: 1.08333em;
}

.fredcarmap-tooltip {
    position: absolute;
    padding: 6px;
    background-color: #fff;
    border: 1px solid #fff;
    border-radius: 3px;
    color: #222;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
