.atp-location-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.atp-location-map-container {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* More specific selector to override any theme SVG styles - target by ID for highest specificity */
#atp-location-map-svg,
.atp-location-map-wrapper .atp-location-map-container svg#atp-location-map-svg,
.atp-location-map-wrapper .atp-location-map-container svg.atp-map-svg,
.atp-location-map-wrapper .atp-location-map-container .atp-map-svg,
.atp-location-map-container svg.atp-map-svg,
.atp-location-map-wrapper svg.atp-map-svg {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: block !important;
    position: relative !important;
    /* Ensure SVG is visible - override any theme styles */
    opacity: 1 !important;
    visibility: visible !important;
    /* Force hardware acceleration */
    transform: translateZ(0) !important;
    /* Maintain aspect ratio based on viewBox (1577 / 1076 = 1.465) */
    aspect-ratio: 1577 / 1076 !important;
    /* Ensure SVG is below pins but visible */
    z-index: 1 !important;
}

.atp-map-pins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Ensure pins container is above SVG */
    z-index: 2;
}

.atp-map-pin {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    /* Pin aligns bottom-center to the coordinate point */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
}

.atp-map-pin:hover {
    z-index: 10001; /* Bring entire pin (including tooltip) above all other pins */
}

.atp-map-pin:hover .atp-pin-tooltip {
    opacity: 1;
    visibility: visible;
}

.atp-pin-svg {
    display: block;
    /* Scale pin based on viewport width - maintains aspect ratio */
    /* Base size: ~24.62px at 1577px viewport = ~1.56vw */
    width: clamp(16px, 1.56vw, 32px);
    /* Maintain aspect ratio: 24.62 / 33.62 = 0.732 */
    height: clamp(21.83px, 2.13vw, 43.66px);
    /* Modern browsers - let height auto-scale */
    aspect-ratio: 24.62 / 33.62;
    transition: transform 0.2s ease;
    max-width: 100%;
}

.atp-map-pin:hover .atp-pin-svg {
    transform: scale(1.1);
}

.atp-pin-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1; /* Relative to parent pin - parent z-index controls stacking */
}

.atp-pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.atp-pin-fallback {
    display: block;
    width: clamp(16px, 1.56vw, 32px);
    height: clamp(16px, 1.56vw, 32px);
    font-size: clamp(16px, 1.56vw, 32px);
}

/* Config mode styles */
.atp-location-map-wrapper[data-config-mode="1"] .atp-map-svg {
    cursor: crosshair;
}


.atp-config-notice {
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

.atp-coordinate-tooltip {
    position: absolute;
    padding: 8px 12px;
    background: #000;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .atp-pin-svg {
        width: clamp(14px, 1.3vw, 24px);
        /* Height scales proportionally (ratio 0.732) */
        height: clamp(19.12px, 1.78vw, 32.78px);
    }
    
    .atp-pin-tooltip {
        font-size: clamp(10px, 2.5vw, 12px);
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .atp-pin-svg {
        width: clamp(12px, 1.2vw, 20px);
        /* Height scales proportionally (ratio 0.732) */
        height: clamp(16.38px, 1.64vw, 27.32px);
    }
    
    .atp-pin-tooltip {
        font-size: clamp(9px, 2.2vw, 11px);
        padding: 3px 6px;
        margin-bottom: 6px;
    }
}

