/**
 * Polygon Image Map - Frontend Styles
 */

.pim-frontend {
    position: relative;
    width: 100%;
    line-height: 0;
}

.pim-frontend .pim-img {
    display: block;
    width: 100%;
    height: auto;
}

.pim-frontend .pim-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pim-frontend .pim-poly {
    pointer-events: auto;
    cursor: pointer;
    transition: fill 0.2s ease;
}

.pim-frontend .pim-poly:focus {
    outline: none;
}

/* Tooltip */
.pim-frontend .pim-tooltip {
    position: absolute;
    z-index: 1000;
    padding: 10px 14px;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    max-width: 280px;
    text-align: center;
    transform: translateX(-50%);
}

.pim-frontend .pim-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.pim-frontend .pim-tooltip strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

/* Mobile */
@media (max-width: 768px) {
    .pim-frontend .pim-tooltip {
        font-size: 13px;
        padding: 8px 12px;
        max-width: 200px;
    }
}

/* Custom Popup Modal */
.pim-custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pim-custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.pim-custom-modal-content {
    position: relative;
    background: #fff;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 100000;
}

.pim-custom-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pim-custom-modal-close:hover {
    background: #000;
}

.pim-custom-modal-body {
    padding: 0;
    min-width: 300px;
}

/* Only force visibility, keep original Elementor styles */
.pim-custom-modal-body .elementor-invisible {
    visibility: visible !important;
}

/* Loader */
.pim-loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: pim-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes pim-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Modal */
@media (max-width: 768px) {
    .pim-custom-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 8px;
    }

    .pim-custom-modal-body {
        padding: 15px;
        min-width: 280px;
    }

    .pim-custom-modal-close {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}
