/* --- JANELA FLUTUANTE DA LUPA --- */
.modal-lupa-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10001; /* Acima dos outros */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-lupa-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-lupa-content {
    background: #121212;
    border: 1px solid #2ecc71;
    border-radius: 15px;
    width: 95%;
    max-width: 600px;
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal-lupa-overlay.show .modal-lupa-content {
    transform: translateY(0) scale(1);
}

.lupa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.lupa-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-fechar-lupa {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-fechar-lupa:hover {
    color: #ff4444;
    transform: rotate(90deg);
}

.lupa-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lupa-instrucao {
    color: #888;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: center;
}

/* --- CONTAINER DA IMAGEM E LUPA --- */
.lupa-img-container {
    position: relative;
    width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    overflow: visible;
    cursor: crosshair;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none; /* Previne rolagem da tela no celular ao usar a lupa */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

#imgBaseLupa {
    max-width: 100%;
    max-height: 60vh;
    display: block;
    object-fit: contain;
}

/* --- A LUPA (VIDRO) --- */
.vidro-lupa {
    position: absolute;
    border: 3px solid rgba(46, 204, 113, 0.8);
    border-radius: 50%;
    cursor: none;
    /* Tamanho do círculo da lupa */
    width: 150px;
    height: 150px;
    background-repeat: no-repeat;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,0.5);
    display: none; /* Escondida inicialmente */
    pointer-events: none; /* Para não bugar o mousemove */
    z-index: 10;
}

/* --- CONTROLES DE ZOOM --- */
.lupa-controles {
    margin-top: 20px;
    width: 100%;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

#rangeZoom {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #333;
    border-radius: 5px;
    outline: none;
}

#rangeZoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2ecc71;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
    transition: 0.2s;
}

#rangeZoom::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}